| Summary: | GDB 7.x getOsId() pattern match too restrictive (DSF) | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | John Dallaway <john> | ||||||
| Component: | cdt-debug-dsf-gdb | Assignee: | Marc Khouzam <marc.khouzam> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | Marc Khouzam <marc.khouzam> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | john.cortell, pawel.1.piech | ||||||
| Version: | 7.0 | Flags: | john.cortell:
review+
|
||||||
| Target Milestone: | 7.0.2 | ||||||||
| Hardware: | PC | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
John Dallaway
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. |