| Summary: | [console] Inferior console does not get removed after a restart with GDB 7.0 and 7.1 | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Marc Khouzam <marc.khouzam> | ||||||
| Component: | cdt-debug-dsf-gdb | Assignee: | Marc Khouzam <marc.khouzam> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | Marc Khouzam <marc.khouzam> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | cdtdoug, pawel.1.piech | ||||||
| Version: | 8.0 | Flags: | marc.khouzam:
review?
(malaperle) |
||||||
| Target Milestone: | 8.0 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Marc Khouzam
This happens for GDB 7.0 as well Created attachment 195616 [details]
Fix
The problem is because GDB 7.0 and 7.1 use the pid of the process as the groupId. When we restart a process, we would look for the inferior that has the groupId==pid as an attribute. For 7.0 and 7.1, that value was not known when we created the console, and is "", so we don't find it.
ConsolePageParticipant was already handling this properly by making a special check for an empty groupId, which indicates that we are not in the multi-process case, so we can remove that inferior directly.
Another issue that came up after I fixed the first one, is that, for 7.0 and 7.1, after the restart, the new inferior would be tagged with the old groupId==pid, which was wrong, since the new instance of the process is going to have a new pid.
The attach patch takes care of both cases.
Committed to HEAD.
Marc-Andre, can you review? More console stuff. Hopefully the comments in the patch are good enough to explain the reasoning. *** cdt cvs genie on behalf of mkhouzam *** Bug 345751: Inferior console does not get removed after a restart with GDB 7.0 and 7.1 [*] StartOrRestartProcessSequence_7_0.java 1.11 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/StartOrRestartProcessSequence_7_0.java?root=Tools_Project&r1=1.10&r2=1.11 I'm cancelling the review for now so I don't waste anyone's time. Looking at Bug 345749 I now understand that I was not thorough enough when dealing with Restarts, when I made the change for multi-process. Therefore the solution to this current bug may change by the time Bug 345749 is fixed. I'll ask for a review when both bugs are fixed and the Restart case is properly handled. Created attachment 195657 [details] Update to follow bug 345749 The fix can be simplified now that Bug 345749 has improved the situation. Previously, for a restart, StartOrRestartProcessSequence_7_0 would have the container of the original process, so we had to be careful about using the right groupId. Now, thanks to the fix of bug 345749, the container of the process that will be running after the restart is passed in to StartOrRestartProcessSequence_7_0, so the groupId has already been chosen properly. Committed to HEAD. Marc-Andre, can you review this simpler fix? Note that both patches have been committed, with the second updating the first. *** cdt cvs genie on behalf of mkhouzam *** Bug 345751: Inferior console does not get removed after a restart with GDB 7.0 and 7.1. Cleanup after the fix to bug 345749 [*] StartOrRestartProcessSequence_7_0.java 1.12 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/StartOrRestartProcessSequence_7_0.java?root=Tools_Project&r1=1.11&r2=1.12 |