逐步通过IntelliJ IDEA中的JDK源代码 [英] Step through JDK source code in IntelliJ IDEA

查看:596
本文介绍了逐步通过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).)

推荐答案

如果您查看[文件菜单 - >]设置 - >调试器 - >步进,您将看到一个列表不要进入这些类,可能在那里列出了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应该推导出必要的来自源代码的信息(基本上将变量名称转换为索引到方法local 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,其中包含调试信息 (在DEBUG bu ndle)。

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天全站免登陆