| Summary: | Remote gdbserver attach does not show thread info right after the attach | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Andy Jin <ajin> | ||||||
| Component: | cdt-debug-dsf-gdb | Assignee: | Marc Khouzam <marc.khouzam> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | Marc Khouzam <marc.khouzam> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | pawel.1.piech | ||||||
| Version: | 7.0 | Flags: | marc.khouzam:
review?
(pawel.1.piech) |
||||||
| Target Milestone: | 7.0.1 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Andy Jin
I debugged this and I believe the problem is caused by a missing *stopped event when we attach to the process. GDB 7.0 has a *stopped, but GDB 6.8 does not, and we need to dispatch one ourselves after the ^done of the attach command. This should probably be done in MIRunControlEventProcessor#commandDone, where we already do this for stepping operations. Created attachment 174416 [details]
Proposed fix
Working with Andy, we came up with this fix.
I didn't commit it yet because something still puzzles me.
How come this problem does not happen for a local attach session? I still don't see a *stopped event, but the thread list is shown.
I will also run the JUnit tests with this fix, to be safe.
I believe the reason this bug did not happen with a local attach is that the local attach is done as part of the FinalLaunchSequence, which at the end, sends a DataModelInitializedEvent. For the remote case, the DataModelInitializedEvent has already been sent by the time the user decides to attach to the process, which is why the *stopped event is needed. This fix will actually trigger the stopped event for the local attach case also, which is technically even better. The JUnit tests for GDB 6.8 all pass with this fix. Committed to HEAD. Pawel, can you review? *** cdt cvs genie on behalf of mkhouzam *** Bug 319307: Remote gdbserver attach does not show thread info right after the attach because of missing stopped event. [*] MIRunControlEventProcessor.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/mi/service/command/MIRunControlEventProcessor.java?root=Tools_Project&r1=1.11&r2=1.12 [*] CLIEventProcessor.java 1.6 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CLIEventProcessor.java?root=Tools_Project&r1=1.5&r2=1.6 - I re-tested the fix with my product configuration and it fixes the issue of thread list not showing up in attach session. However since our product is now based on CDT 7.0 release I can't include this fix because it's only checked in to CDT head. Is it possible to check in the fix to the cdt_7_0 branch so it can be included in the 7.0.1 release? Created attachment 174514 [details]
Fix for 7.0.1
This patch is for the 7_0 branch. It is slightly different because I added isAttachingOperation() as a private local method to MIRunControlEventProcessor instead of adding it as an API in CLIEventProcessor.
Committed to 7_0
- Thanks Marc. Working fine for me now. *** cdt cvs genie on behalf of mkhouzam *** Bug 319307: Added stopped event when getting an attach. [*] MIRunControlEventProcessor.java 1.11.2.1 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/MIRunControlEventProcessor.java?root=Tools_Project&r1=1.11&r2=1.11.2.1 |