harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivan Popov" <ivan.g.po...@gmail.com>
Subject Re: [JDKTools][JDWP]Let's start JDWP java6 updating
Date Fri, 22 Feb 2008 13:30:04 GMT
I agree with Gregory, this is very strange and unexpected usage of
JDWP agent. It's not supported by JDWP specification and thus may vary
in different implementation depending on how implementation handles
errors

The main problem is that technically JDWP protocol is symmetric,
that's why it's possible for JDWP agents to connect to each other and
even perform handshake. After successfull handshake several JDWP
packets are transferred over JDWP connection between the agents.

There are three kinds of JDWP packets (commands, replies, events)
which have similar structure. JDWP spec defines that commands may only
transfer to agent, while replies and events may only transfer from
agent. In this particular case this rule is broken. Current Harmony's
implementation relies on this order and reports errors if it is broken
(may be not in a very good manner). RI's implementation seems just
silently ignoring unexpected packets and does not print errors.

It's quite easy to modify Harmony's agent to recognize such situation
and provide more meaningful diagnostics. I don't think that RI's
behavior with silently ignoring errors is better in this case.

Thanks.
Ivan

On Fri, Feb 22, 2008 at 6:52 PM, Oliver Deakin
<oliver.deakin@googlemail.com> wrote:
>
> Gregory Shimansky wrote:
>  > Oliver Deakin said the following on 22.02.2008 12:35:
>  >> Hi Jimmy,
>  >>
>  >> This is a great idea, but I have a feeling there may still need to be
>  >> some work done on the current version. I have noticed the following:
>  >>
>  >> 1) You cannot launch Harmony with
>  >> java -agentlib:jdwp=transport=dt_socket,server=n,address=8888
>  >>
>  >> without specifying a class at the end of the command line. This is
>  >> not a major issue, just a difference to the RI. If you run the above
>  >> command line, the launcher short circuits to the launcher command
>  >> line help and exits.*
>  >> *
>  >> 2) If I try to launch two Harmony VMs using the following command lines:
>  >> java
>  >> -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8888
>  >> HelloWorld
>  >> java -agentlib:jdwp=transport=dt_socket,server=n,address=8888 HelloWorld
>  >
>  > I am not sure I understand the intention to run these two command
>  > lines. To connect to a JDWP agent you need a real JDWP client, e.g.
>  > Eclipse or jdb. AFAIU JDWP agent cannot talk to itself over JDWP
>  > protocol.
>  >
>
>  Hi Gregory,
>
>  Im not saying that this is a standard way to connect, but it appears to
>  expose a difference between implementations. You can run these two
>  command lines on the RI without any errors whatsoever. Although this is
>  not normal practise it leaves me wondering what the cause of these
>  errors are on Harmony.
>
>  Regards,
>  Oliver
>
>
>
>  --
>  Oliver Deakin
>  Unless stated otherwise above:
>  IBM United Kingdom Limited - Registered in England and Wales with number 741598.
>  Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>
>

Mime
View raw message