Community
Participate
Working Groups
Build Identifier: Eclipse 3.6.0 I20100608-0911 (with cdt_7_0 branch and CDT HEAD) When debugging on remote hardware with an RTOS, the OS-specific thread ID returned by GDB can have a variety of formats. When debugging with GDB 6.x, CLIInfoThreadsInfo#parseThreadInfo() accommodates any alphanumeric character sequence as the thread ID. When debugging with GDB 7.x, the pattern matching in MIThread#parseOsId() is too restrictive so the OS-specific thread ID may not be seen in the Debug view. Reproducible: Always
Created attachment 179091 [details] MIThread-100917.patch This patch addresses the reported issue by adding an extra pattern match which catches any alphanumeric OS-specific thread ID which does not match the existing patterns. It should be usable for both CDT HEAD and the cdt_7_0 branch.
Created attachment 185359 [details] Updated fix to make case-insensitive Same patch as John's but I made it case insensitive in case Windows needs it. Committed to HEAD.
Committed to the 7_0 branch John D can you confirm it works as you expect? John C can you review?
*** cdt cvs genie on behalf of mkhouzam *** Bug 325552: GDB 7.x getOsId() pattern match too restrictive (DSF) [*] MIThread.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/MIThread.java?root=Tools_Project&r1=1.5&r2=1.6 [*] MIThread.java 1.2.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/MIThread.java?root=Tools_Project&r1=1.2&r2=1.2.2.1
*** cdt cvs genie on behalf of mkhouzam *** Bug 325552: License [*] MIThread.java 1.7 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/MIThread.java?root=Tools_Project&r1=1.6&r2=1.7
(In reply to comment #3) > Committed to the 7_0 branch > > John D can you confirm it works as you expect? The final patch applied to the cdt_7_0 branch works well for me. Thank you.
The fix looks good to me, but these sort of utility methods really should have unit tests to protect against regressions as we add support for new ID formats. I've added MIThreadTests.java. I do have one question, though. Shouldn't we be updating parseParentId(), too? At least for the possibility of "Thread" being in a different case. Also, is it not possible those IDs will be in the same format as the OS ones?
*** cdt cvs genie on behalf of jcortell *** Bug 325552: GDB 7.x getOsId() pattern match too restrictive (DSF) [*] MIThread.java 1.8 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/MIThread.java?root=Tools_Project&r1=1.7&r2=1.8 [+] MIThreadTests.java http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIThreadTests.java?root=Tools_Project&revision=1.1&view=markup
(In reply to comment #7) John, thank you for reviewing the patch. > I do have one question, though. Shouldn't we be updating parseParentId(), too? > At least for the possibility of "Thread" being in a different case. Also, is it > not possible those IDs will be in the same format as the OS ones? parseParentID() parses the same OS ID strings as parseOsId() but extracts the parent thread ID from those strings in cases where the parent thread ID is prefixed to the thread ID. It already accommodates lowercase "thread". I believe that the current implementation is OK.
(In reply to comment #9) > parseParentID() parses the same OS ID strings as parseOsId() but extracts the > parent thread ID from those strings in cases where the parent thread ID is > prefixed to the thread ID. It already accommodates lowercase "thread". I > believe that the current implementation is OK. Ah, right. I've added documentation to the method to make it a little more obvious.
Thanks John, and thanks for the tests.