Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 342791 - NPE in debug expression hover - null frame context
Summary: NPE in debug expression hover - null frame context
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf (show other bugs)
Version: 7.0.2   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 8.0   Edit
Assignee: Anton Leherbauer CLA
QA Contact: Pawel Piech CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-14 01:59 EDT by Kirk Beitz CLA
Modified: 2011-04-14 04:23 EDT (History)
3 users (show)

See Also:


Attachments
guard against null frame returned from getFrame() at edge of debug session (2.35 KB, patch)
2011-04-14 01:59 EDT, Kirk Beitz CLA
no flags Details | Diff
guards against null IFrameDMContext in several functions (3.88 KB, patch)
2011-04-14 02:49 EDT, Kirk Beitz CLA
aleherb+eclipse: iplog+
aleherb+eclipse: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kirk Beitz CLA 2011-04-14 01:59:54 EDT
Created attachment 193219 [details]
guard against null frame returned from getFrame() at edge of debug session

at a point in the debug session where the frame was going away, i got a trace (not saved, unfortunately) in which an NPE was shown in the code referenced in the attached patch.
Comment 1 Anton Leherbauer CLA 2011-04-14 02:28:44 EDT
Makes sense.  The same could happen in evaluateExpression().
Comment 2 Kirk Beitz CLA 2011-04-14 02:49:38 EDT
Created attachment 193222 [details]
guards against null IFrameDMContext in several functions

(In reply to comment #1)
> Makes sense.  The same could happen in evaluateExpression().

ok, i've replaced the attachment with one including a null-guard for frame in evaluateExpression() as well, and also one in the execute() @override in private nested class GetExpressionValueQuery .

please commit on my behalf if you feel appropriate.  thanks.
Comment 3 CDT Genie CLA 2011-04-14 04:23:08 EDT
*** cdt cvs genie on behalf of aleherbau ***
Bug 342791 - NPE in debug expression hover - null frame context
Patch by Kirk Beitz

[*] AbstractDsfDebugTextHover.java 1.10 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/AbstractDsfDebugTextHover.java?root=Tools_Project&r1=1.9&r2=1.10
Comment 4 Anton Leherbauer CLA 2011-04-14 04:23:45 EDT
(In reply to comment #2)
> ok, i've replaced the attachment with one including a null-guard for frame in
> evaluateExpression() as well, and also one in the execute() @override in
> private nested class GetExpressionValueQuery .

The guard in execute() is not necessary with the one in evaluateExpression().  I removed that, but added a null check for dsfSession in getHoverInfo2().

> please commit on my behalf if you feel appropriate.  thanks.

Committed on HEAD, thanks.