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

Bug 350731

Summary: Frame/Thread/Process should be kept in sync between UI and gdb console
Product: [Tools] CDT Reporter: Aaron <AaronMSwan>
Component: cdt-debugAssignee: cdt-debug-inbox <cdt-debug-inbox>
Status: CLOSED WONTFIX QA Contact: Ken Ryall <ken.ryall>
Severity: minor    
Priority: P3 CC: cdtdoug, marc.khouzam, nobody, pawel.1.piech
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Aaron CLA 2011-06-29 13:48:45 EDT
Build Identifier: M20100211-1343

In the Eclipse Debug perspective, if a frame is selected in the Debug panel, the gdb frame is set to 0. The Eclipse frame list is also numbered reversed to the gdb frame list. Shouldn't Eclipse use the gdb frame numbering?

Reproducible: Always

Steps to Reproduce:
1.Debug a program with multiple stack frames
2.Select the GDB console
3.Type "f 1" to go up a frame
4.Click on a previous frame in the Debug panel in the Debug perspective
5.Select the GDB console
6.Type "f" to see the frame is set to 0
Comment 1 Marc Khouzam CLA 2011-06-29 15:12:19 EDT
This sounds like a duplicate of Bug 192742.  Agreed?

Note that the new CDT debugger integration which is used for Helios and Indigo does not number the frames (maybe it should?)
Comment 2 Aaron CLA 2011-06-29 15:43:58 EDT
(In reply to comment #1)
> This sounds like a duplicate of Bug 192742.  Agreed?
> 
> Note that the new CDT debugger integration which is used for Helios and Indigo
> does not number the frames (maybe it should?)

The duplicate you've listed looks very similar. I'm not sure It's entirely the same thing. Either way, in the end, it would be nice if a user could switch frames using either the CLI console or the Debug panel and keep the two in sync. I noticed after I submitted the bug that while entering commands in the CLI console, my frame number changed between two print commands, causing the second command to error. As you suggested, these all seem related.

And I think frame numbers would be helpful in the Debug panel.
Comment 3 Marc Khouzam CLA 2011-06-30 05:32:55 EDT
(In reply to comment #2)
> (In reply to comment #1)
> > This sounds like a duplicate of Bug 192742.  Agreed?
> > 
> > Note that the new CDT debugger integration which is used for Helios and Indigo
> > does not number the frames (maybe it should?)
> 
> The duplicate you've listed looks very similar. I'm not sure It's entirely the
> same thing. Either way, in the end, it would be nice if a user could switch
> frames using either the CLI console or the Debug panel and keep the two in
> sync. 

What you are asking here is a little different.  Bug 192742 requests that the console be independent from the UI for the stack frame number.  You suggest that the two be kept in sync.  It is not clear to me which solution would be the more user-friendly (or even do-able).

I expect to do some major work on the gdb console for the next release of Eclipse, so this may clarify this bug.

I'll leave this bug open and rename it to describe the point in question.

> And I think frame numbers would be helpful in the Debug panel.

I've opened Bug 350791 about that.
Comment 4 Nobody - feel free to take it CLA 2011-06-30 10:40:14 EDT
Here is my two cents. In the first CDI implementation we tried to keep the Debug view selection in sync with GDB. It caused as a lot of trouble and we eventually decided to abandon this idea. 
There are many unintended (from the user's point of view) context switches in the Debug view when the session is started, resumed or suspended. Following them and trying to sync the current context with GDB is very difficult and completely unnecessary.
Comment 5 Marc Khouzam CLA 2011-06-30 11:01:57 EDT
Thanks Mikhail.

I'm closing as WONTFIX and Bug 192742 would be the solution we can go for.