On 2010-07-05 21:28, Daniel Gong wrote:
Back to this question, I still do not find a proper solution.

I think expressions like "object.method()" can only be evaluated at the
debuggee side, because the debugger does not have enough information to
evaluate it. Then, if this kind of expression can be evaluated at the
debuggee side, expressions like "a+b" are supposed to be able to be
evaluated too.

"object.method()" can be done by jdwp command ObjectReference::InvokeMethod; primitive type operations, such as "3 / 4", can be done in debugger side, but I guess you have to parse it yourself.


I'm not sure whether my understanding is right. If I'm right, there should
be some interface at the debugger side that can evaluate a valid java
expression, does anyone know what it is? If I'm wrong, is there any library

At least there is no jdwp commands can do this AFAIK.

that I can use to parse a java expression and evaluated it as Regis said?

Best wishes
Daniel Gong


On Wed, Jun 9, 2010 at 9:27 AM, Regis<xu.re...@gmail.com>  wrote:

On 2010-06-08 19:07, Daniel Gong wrote:

Hi everyone,

As you know I'm now preparing to develop jdb command line tool. I've
encountered a problem. JDB has the functionality of display value of a
java
expression, but how can I calculate the value from an expression string?
I've thought about the problem for days and still cannot figure it out. I
need some help from you. Thanks :)

Best wishes
Daniel Gong


I guess you need to parse the string to find out which part should be
calculated at debuggee side, and which can be done at jdb side.

--
Best Regards,
Regis.




--
Best Regards,
Regis.

Reply via email to