在 IntelliJ IDEA 中单步执行 JDK 源代码 [英] Step through JDK source code in IntelliJ IDEA

查看:74
本文介绍了在 IntelliJ IDEA 中单步执行 JDK 源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 IntelliJ IDEA 7 中单步执行 JDK 源代码并查看调试信息?我目前可以点击断点并逐步执行代码,但调试信息不​​可用.这意味着我看不到局部变量的值.

How can I step through JDK source code in IntelliJ IDEA 7 and see the debug info? I can currently hit breakpoints and step through the code, but the debug info is not available. This means I can't see the value of local variables.

如果重要的话,我只想单步执行一个类的源代码.
对于它的价值,它是 javax.swing.text.html.HTMLDocument 类,我确实有相应的 .java 文件的副本.

I only want to step through the source code of one class, if that matters.
For what it's worth, it's the javax.swing.text.html.HTMLDocument class and I do have a copy of the corresponding .java file.

推荐答案

如果你查看 [File menu ->] Settings -> Debugger -> Stepping 你会看到一个列表Do not step into these classes",大概是java.*"在那里列出.是这样吗?你可以在那里关闭它.

If you look in [File menu ->] Settings -> Debugger -> Stepping you will see a list "Do not step into these classes", probably with "java.*" listed there. Is that the case? You can turn that off there.

显然调试信息不​​可用.根据这个线程:

Apparently the debug information is not available. According to this thread:

遗憾的是,JDK 类剥离了参数和局部变量的调试信息.

Sadly the JDK classes have debug information for parameters and local variable stripped off.

几年前,我提交了一个请求,要求 Idea 从源代码中推断出必要的信息(基本上将变量名转换为索引到方法本地 var 中):
调试器:没有调试信息时显示变量信息

Years ago I filed a request that Idea should deduce the necessary information from the source code (basically converting variable names to indexes into the methods local var):
Debugger: Show variable information when no debug info

请投票/评论.

作为一种解决方法,您可以从源代码重新编译 JDK,但您需要排除一些未附加所有所需源代码的类.

As a workaround you can re-compile the JDK from sources, but you need to exclude some classes which do not have all needed source code attached.

有趣的是,您可以下载测试版 Java 6u18,其中包含调试信息(在调试包中).

Interestingly, you can download the beta version of Java 6u18, which has debug information in it (in the DEBUG bundle).

这篇关于在 IntelliJ IDEA 中单步执行 JDK 源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆