开发者

How does Eclipse/IDEA/etc. debugger obtain the information about local variable values and watch expression values?

I always thought that varibales are mapped to stack locations once your Java source is compiled; additionally, they may include the info about the variable names and their scope in classfiles, but that's optional AFAIK.

The question is - how do my Eclipse/IDEA IDEs allow me to set a watch expression containing the l开发者_运维知识库ocal variable name? To me, it's hard to understand :)


All those IDE base their debug services on top of the JavaTM Platform Debugger Architecture (JPDA).
More precisely, they are all using the Java Virtual Machine Tool Interface (JVM TI), which replaced from JDK5 the experimental JVMPI (Java Virtual Machine Profiling Interface).

That JVMTI includes a Watched Field function and a SetFieldModificationWatch function.

But that doesn't include local variable: there is actually an RFE opened since quite some time now: bug 4228507.
So in the case of local variable, chances are some kind of BCI is used (Byte Code Instrumentation) (like the TPTP Eclipse module does).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜