gpt4 book ai didi

java - 无法检查本地声明的变量

转载 作者:IT老高 更新时间:2023-10-28 20:58:39 25 4
gpt4 key购买 nike

有时当我在 Eclipse 中调试代码时,虽然我可以毫无困难地查看和检查类成员变量,但我无法检查在函数中本地声明的变量的值。顺便说一句,当前函数的任何参数都会丢失它们的“真实”名称,而是会在“变量”窗口中看到它们的值,如 arg0、arg1、arg2 等,但至少这些值是可见的。

目前这种情况与核心 JDK 中定义的类有关。我已验证已安装且当前的 JRE 是 JDK。

有人能解释一下这种行为吗?

最佳答案

显然,answer是:

the rt.jar that ships with the JDK (where the core Java classes live) is not compiled with full debug information included in the .class files, so the debugger does not have local variable info.

Unfortunately, this is not something that Eclipse can do anything about - all debuggers will have the same problem with JDK core classes.

release notes of Eclipse 3.4状态:

Missing debug attributes
The debugger requires that class files be compiled with debug attributes if it is to be able to display line numbers and local variables. Quite often, class libraries (for example, "rt.jar") are compiled without complete debug attributes, and thus local variables and method arguments for those classes are not visible in the debugger.

关于java - 无法检查本地声明的变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/271521/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com