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

Bug 311416

Summary: [vm][cache] Stack frames missing in debug view
Product: [Tools] CDT Reporter: Marc Khouzam <marc.khouzam>
Component: cdt-debug-dsf-gdbAssignee: Pawel Piech <pawel.1.piech>
Status: RESOLVED FIXED QA Contact: Marc Khouzam <marc.khouzam>
Severity: major    
Priority: P3 CC: aleherb+eclipse, pawel.1.piech
Version: 7.0Flags: marc.khouzam: review+
Target Milestone: 7.0   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Snaptshot of missing frames (there is not main)
none
Snapshot after refreshing the view
marc.khouzam: iplog-
Fix.
none
Tiny simplification
marc.khouzam: iplog-
Java doc fix marc.khouzam: iplog-

Description Marc Khouzam CLA 2010-05-03 14:37:24 EDT
Created attachment 166845 [details]
Snaptshot of missing frames (there is not main)

I believe the fix to Bug 310992 is causing problems in the debug view.  When I step into a recursive method, I only see two stack frames in the debug view.  If I refresh the view, I see all the frames.

I think this only happens if I turn off the "Limit stack frames" preferences.
Comment 1 Marc Khouzam CLA 2010-05-03 14:38:19 EDT
Created attachment 166846 [details]
Snapshot after refreshing the view

Snapshots of before and after a refresh.  We can see some missing frames.
Comment 2 Pawel Piech CLA 2010-05-04 00:52:38 EDT
Created attachment 166902 [details]
Fix.
Comment 3 Pawel Piech CLA 2010-05-04 00:54:23 EDT
(In reply to comment #0)
> I believe the fix to Bug 310992 is causing problems in the debug view.  When I
> step into a recursive method, I only see two stack frames in the debug view. 
> If I refresh the view, I see all the frames.
Fortunately it's a false alarm, the bug is a caching bug in MIStack.

Marc, please review.
Comment 4 Anton Leherbauer CLA 2010-05-04 03:03:30 EDT
(In reply to comment #3)
> Fortunately it's a false alarm, the bug is a caching bug in MIStack.

Nice find.  Thanks, Pawel!
Comment 5 Marc Khouzam CLA 2010-05-04 09:20:34 EDT
Created attachment 166950 [details]
Tiny simplification

Thanks for the fix Pawel!  I guess the extra refresh that was removed by bug 310992 was hiding this bug.  Sorry about the mis-diagnosis.

I've committed this patch to simplify the check that had the error.  I hope that is ok with you.
Comment 6 Marc Khouzam CLA 2010-05-04 09:36:50 EDT
Created attachment 166952 [details]
Java doc fix

Looking at this code, I realize that the javadoc for IStack.getStackDepth() is not clear (I wrote it :-( ).  I think we should indicate if getStackDepth() should restrict itself to maxDepth or if it is allowed to return a number greater than stackDepth.  

After thinking about it, I think we should allow the service to return more depth that requested if it wants (it could be a cheap operation).  In fact, the DSF-GDB implementation, when using the cache you just fixed, does not always respect the maxDepth param.  But the views are prepared for that.

I suggest the following change.  Not committed.
What do you think?
Comment 7 Pawel Piech CLA 2010-05-04 13:27:08 EDT
(In reply to comment #5)
> I've committed this patch to simplify the check that had the error.  I hope
> that is ok with you.
+1

(In reply to comment #6)
> I suggest the following change.  Not committed.
> What do you think?
Yes, this makes sense to me.
Comment 8 Marc Khouzam CLA 2010-05-04 13:58:27 EDT
(In reply to comment #7)
> (In reply to comment #6)
> > I suggest the following change.  Not committed.
> > What do you think?
> Yes, this makes sense to me.

Thanks.  Committed to HEAD.