| Summary: | Interrupting target can leave Debug view in awkward state | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | John Cortell <john.cortell> | ||||||||||||
| Component: | cdt-debug-dsf-gdb | Assignee: | John Cortell <john.cortell> | ||||||||||||
| Status: | RESOLVED FIXED | QA Contact: | Marc Khouzam <marc.khouzam> | ||||||||||||
| Severity: | normal | ||||||||||||||
| Priority: | P3 | CC: | pawel.1.piech | ||||||||||||
| Version: | 7.0 | Flags: | marc.khouzam:
review+
|
||||||||||||
| Target Milestone: | 7.0 | ||||||||||||||
| Hardware: | PC | ||||||||||||||
| OS: | Windows XP | ||||||||||||||
| Whiteboard: | |||||||||||||||
| Attachments: |
|
||||||||||||||
|
Description
John Cortell
Created attachment 166784 [details]
gdb trace
Created attachment 166785 [details]
Screenshot showing the problem
Created attachment 166786 [details]
Fix
Marc, please review. Created attachment 166789 [details]
Screenshot showing behavior after patch
Funny, I had to deal with a similar error for Tracepoints. Weird that gdb does not return things properly for a case where the full data should be available. - I think the check in getStackDepth should be maxDepth != 1 instead of maxDepth > 1. A max depth of 0 will trigger a -stack-info-depth without any params, which request the full depth. This will happen if you turn off the "Limit number of stack frame preference". Pref->Run/Debug->View performance. - from comments I got from the gdb experts for tracepoints, when the call -stack-info-depth fails for one depth, it could succeed for a lesser depth which need not be 1. Pedro had suggested a divide a conquer algo to try to figure out the max depth e.g., when 11 fails, try 5, when it succeeds, try 7, if it succeeds try 9, when it fails try 8. I thought this was too complicated and I also resorted to a depth of 1 in those cases, with the hope that newer GDBs won't have this problem. After seeing your nice recursive call to getStackDepth() it made me think that we could try to do better than a depth of 1 by recursively calling it with maxDepth - 1. But that could cause 10 calls to -stack-info-depth, so if you find this too much, we could call recursively with maxDepth/2. To be honest, I'm fine with defaulting to 1 in this case, but I wanted you to know all the details. - if you fix getStackDepth, do you still need to modify getFrameData()? If getDepth() returns a proper depth, I think getFrameData will only ask for frames in that depth range. If you do, then I think the change you made only makes sense in the case where miFrameDmc.fLevel == 0. Also, you can probably call the method getTopFrame() (In reply to comment #6) > Funny, I had to deal with a similar error for Tracepoints. Weird that gdb does > not return things properly for a case where the full data should be available. > > - I think the check in getStackDepth should be maxDepth != 1 instead of > maxDepth > 1. A max depth of 0 will trigger a -stack-info-depth without any > params, which request the full depth. This will happen if you turn off the > "Limit number of stack frame preference". Pref->Run/Debug->View performance. Good catch. Will adjust > - from comments I got from the gdb experts for tracepoints, when the call > [snip] > I wanted you to know all the details. I think trying "one more time" is enough of a hack. Trying numerous times is too much of a hack, IMO. > - if you fix getStackDepth, do you still need to modify getFrameData()? If > getDepth() returns a proper depth, I think getFrameData will only ask for > frames in that depth range. That's what I figured, but we end up still asking beyond what we get from the stack depth command. Not sure why, but I didn't have time to go down that tangent. > If you do, then I think the change you made only > makes sense in the case where miFrameDmc.fLevel == 0. Also, you can probably > call the method getTopFrame() OK. I added the check for the level. Created attachment 166827 [details]
Updated patch based on Marc's review
Committed to HEAD.
Fixed *** cdt cvs genie on behalf of jcortell *** Bug 311380: Interrupting target can leave Debug view in awkward state [*] MIStack.java 1.13 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIStack.java?root=Tools_Project&r1=1.12&r2=1.13 |