Community
Participate
Working Groups
Created attachment 167383 [details] Messed up launch On my Linux I run: gdbserver.7.1 --multi :9999 Then, in Eclipse, I create an attach launch using gdbserver and gdb.7.1 and press debug. The resulting launch is messed up as shown in the snapshot.
This problem is because with GDB 7.1, we can receive a bogus process when we are not debugging anything -list-thread-groups ^done,groups=[{id="0",type="process",pid="0"}] I also noticed that GDB HEAD, which will soon become GDB 7.2, the pid field is missing altogether in this case -list-thread-groups ^done,groups=[{id="i1",type="process"}] We should ignore those kind of entries since they don't actually indicate a process that is being debugged.
Created attachment 173087 [details] Fix for HEAD Fix committed to HEAD
John, this is a small patch, can you review?
Adding John for a review
*** cdt cvs genie on behalf of mkhouzam *** Bug 311965: Ignore bogus processes returned by -list-thread-groups of GDB 7.1 and 7.2 [*] MIListThreadGroupsInfo.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/output/MIListThreadGroupsInfo.java?root=Tools_Project&r1=1.5&r2=1.6 [*] GDBProcesses_7_0.java 1.22 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java?root=Tools_Project&r1=1.21&r2=1.22
(In reply to comment #3) > John, this is a small patch, can you review? I don't claim to fully understand the reasoning behind the logic since I'm not all that familiar with gdb thread groups, but superficially, I see nothing wrong with the changes. I do question whether the assumption that a pid of zero is bogus. Does gdb reserve that value? Is is not possible some environment might actually have a process with ID 0? I would keep this fix but pursue this issue with the gdb folks since this seems to me more of a workaround than a solution.
(In reply to comment #6) > (In reply to comment #3) > > John, this is a small patch, can you review? > > I don't claim to fully understand the reasoning behind the logic since I'm not > all that familiar with gdb thread groups, but superficially, I see nothing > wrong with the changes. I do question whether the assumption that a pid of zero > is bogus. Does gdb reserve that value? Is is not possible some environment > might actually have a process with ID 0? I would keep this fix but pursue this > issue with the gdb folks since this seems to me more of a workaround than a > solution. :-) http://sourceware.org/ml/gdb/2010-06/msg00138.html But no answer yet. P.S. I'm working on a patch for 7.0.1 as well.
Created attachment 173147 [details] Fix for 7.0.1 This is the fix for 7.0.1. It's pretty much the same as for HEAD, but smaller, as I only added the exact changes that were actually needed. In HEAD, I had added support for a more detailed parsing of GDB output, which is not needed for 7.0.1. Committed to 7.0.1
John, another quick review just to make sure I didn't make a stupid mistake in this patch. Thanks.
*** cdt cvs genie on behalf of mkhouzam *** Bug 311965: Deal with bogus processes returned by -list-thread-groups [*] MIListThreadGroupsInfo.java 1.4.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/output/MIListThreadGroupsInfo.java?root=Tools_Project&r1=1.4&r2=1.4.2.1 [*] GDBProcesses_7_0.java 1.21.2.1 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java?root=Tools_Project&r1=1.21&r2=1.21.2.1