Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 343464

Summary: Evaluating a function that throws doesn't show the stacktrace
Product: [Eclipse Project] JDT Reporter: Chris West (Faux) <eclipse>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3    
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Hacky fix for display only
none
Hacky fix for display only without cruft none

Description Chris West (Faux) CLA 2011-04-20 18:30:57 EDT
Build Identifier: I20110127-2034

Running the Display action (ctrl+shift+d) on a method invocation that throws shows only the class of the exception.

It'd be much more useful to show the stack-trace and the message from the exception.  (These are currently (sometimes) sent to the console.)

This would also be useful in the Inspect action and the Expressions view.

Reproducible: Always

Steps to Reproduce:
1. Have a class that calls a function that throws, e.g.
class Scratch {
  public static void main(String[] args) {
    foo(); // line 3
  }

  private static void foo() {
    throw new RuntimeException();
  }
}

2. Breakpoint line 3 and run.
3. When the debugger is stopped on line 3, highlight foo() and execute Display (ctrl+shift+d).

You'll get:
"Error Evaluating: An exception occurred: java.lang.RuntimeException", instead of a stack-trace.
Comment 1 Chris West (Faux) CLA 2011-04-20 18:32:04 EDT
Created attachment 193764 [details]
Hacky fix for display only
Comment 2 Chris West (Faux) CLA 2011-04-20 18:33:22 EDT
Created attachment 193765 [details]
Hacky fix for display only without cruft

Ooops, dragged along some other outstanding changes there.