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

Bug 367508

Summary: Show Exception Object in Variables Window when in Finally Block
Product: [Eclipse Project] JDT Reporter: Nathan Reynolds <numeralnathan>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3    
Version: 3.8   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Nathan Reynolds CLA 2011-12-23 12:09:16 EST
Build Identifier: 20110916-0149

A finally block can be executed because of an exception being thrown in the try block.  When this happens, it would help to see the exception object in the Variables debugger window.  Thus, one could look at the exception message as well as inspect the call stack at the time of the exception.

Last time I checked the byte code of how a finally block is implemented, I found two copies of the finally block.  A copy for each of the normal and exception exits.  The exception copy pushes the exception object on to the stack, executes the code, and then pops the exception object from the stack and throws it.  The debugger would have to get the exception object from the stack.

My memory is now sketchy.  But, I think the stack is cleared at the beginning
of the finally block.  So, the exception object should be at the top of the
stack in the first slot.

Reproducible: Always