简体   繁体   English

Eclipse打印堆栈跟踪但不显示变量。 错误?

[英]Eclipse prints stack trace but doesn't show variables. Bug?

In my application formerly I got an NPE and, by setting a breakpoint at NullPointerException, could get a break, stack trace (in the Debug window), and current variables in the Variables window. 在我的应用程序中,我以前得到了一个N​​PE,并且通过在NullPointerException中设置断点,可以在Variables窗口中获得中断,堆栈跟踪(在Debug窗口中)和当前变量。

However, now there is an uncaught ArrayIndexOutOfBoundsException somewhere else. 但是,现在在其他地方存在未被捕获的ArrayIndexOutOfBoundsException。 In Eclipse, when having set a breakpoint at that exception, I only get a stack trace in console , but no variables are seen in the Variables window. 在Eclipse中,当在该异常处设置断点时,我只在控制台中获得堆栈跟踪,但在“变量”窗口中没有看到变量。 Is this a bug? 这是一个错误吗? I have also made sure the application does not catch the exception or prints the trace. 我还确保应用程序不会捕获异常或打印跟踪。

The breakpoint is so configured (copied): ArrayIndexOutOfBoundsException: caught and uncaught (both switches ON) 断点是如此配置(复制):ArrayIndexOutOfBoundsException:捕获和未捕获(两个都打开)
Suspend thread is ON, all other switches are OFF. 挂起线程为ON,所有其他开关均为OFF。

First line of trace: 第一行追踪:

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: -1

The solution to my own question is: No this is not a bug. 我自己的问题的解决方案是:不,这不是一个错误。 I started the application in the Eclipse Debug look via the small Play button on top of the Debug window. 我通过Debug窗口顶部的小Play按钮在Eclipse Debug外观中启动了应用程序。 But this didn't start a debug session because I had started a Run session earlier. 但是这并没有启动调试会话,因为我之前已经启动了Run会话。 There was, however, not a visible indication of that in the whole frame. 然而,在整个框架中没有明显的迹象。 I would consider it a design bug personally. 我个人认为这是一个设计错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM