Community
Participate
Working Groups
Build Identifier: I20100608-0911 When using gdb version lower than 7.0 the "remote gdbserver attach" launch does not show the thread info right after I attach to the remote process. As a result of this most of the debug buttons (step-over, step-in, etc.) are disabled. Manual refresh brings me the tread info but still does not expand to where the current break point is. This problem does not observed when using gdb 7.0. Refer to this CDT mailing list post for details. http://dev.eclipse.org/mhonarc/lists/cdt-dev/msg19731.html Reproducible: Always Steps to Reproduce: 1. Create a "remote gdbserver attach" using gdb 6.8 2. Attach to a running process.
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