| Summary: | [event] Thread created event with wrong id after restart for GDB < 7.0 | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Marc Khouzam <marc.khouzam> | ||||||
| Component: | cdt-debug-dsf-gdb | Assignee: | Marc Khouzam <marc.khouzam> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | Marc Khouzam <marc.khouzam> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | cdtdoug, pawel.1.piech | ||||||
| Version: | 8.0 | Flags: | marc.khouzam:
review?
(john.cortell) |
||||||
| Target Milestone: | 8.0 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Bug Depends on: | 313372 | ||||||||
| Bug Blocks: | |||||||||
| Attachments: |
|
||||||||
|
Description
Marc Khouzam
Created attachment 195032 [details]
Proposed fix
This bug only happens for GDB < 7.0 since it is for those versions that we need to keep our own thread counter.
This patch makes use of the printout
[Thread debugging using libthread_db enabled]
which seems to happen only when the program starts or restarts. In that case, we reset the thread counter.
This fix works well on Linux but I'm not sure about Windows.
I'll commit it as it is an improvement from the current situation, but I'll try to verify it for Windows.
*** cdt cvs genie on behalf of mkhouzam *** Bug 339456: Thread created event with wrong id after restart for GDB < 7.0 [*] CLIEventProcessor.java 1.9 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.8&r2=1.9 *** cdt cvs genie on behalf of mkhouzam *** Bug 339456: Thread created event with wrong id after restart for GDB < 7.0 [*] GDBControl.java 1.30 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java?root=Tools_Project&r1=1.29&r2=1.30 (In reply to comment #1) > This patch makes use of the printout > > [Thread debugging using libthread_db enabled] > > I'll commit it as it is an improvement from the current situation, but I'll try > to verify it for Windows. There is no such printout on Windows, so this fix does not work there. The output looks like: 624,853 [MI] 15-break-insert -t -f main 624,871 [MI] 15^done,bkpt={number="4",type="breakpoint",disp="del",enabled="y",addr="0x00401399",fu\ nc="main",file="..\\src\\TestDSFGDB.cpp",fullname="C:\\Users\\Marc\\runtime-DSFGDB\\TestDSFGDB\\Debu\ g/..\\src\\TestDSFGDB.cpp",line="193",times="0"} 624,872 [MI] (gdb) 624,875 [MI] 16-exec-run 624,883 [MI] 16^running 624,884 [MI] (gdb) 624,921 [MI] ~"[New thread 2424.0x1f94]\n" 624,948 [MI] &"Error: dll starting at 0x76e20000 not found.\n" 624,950 [MI] &"Error: dll starting at 0x76390000 not found.\n" 624,954 [MI] &"Error: dll starting at 0x76e20000 not found.\n" 624,956 [MI] &"Error: dll starting at 0x76f40000 not found.\n" 625,026 [MI] 16*stopped,thread-id="1",frame={addr="0x00401399",func="main",args=[],file="..\\src\\T\ estDSFGDB.cpp",fullname="C:\\Users\\Marc\\runtime-DSFGDB\\TestDSFGDB\\Debug/..\\src\\TestDSFGDB.cpp"\ ,line="193"} I'll have to come up with something else, that is not based on GDB output. A better solution for both Linux and Windows is probably to listen for IStartedEvent for a container, which indicates the start/restart of a process. Since this change is for GDB < 7.0, we don't have to worry about multi-process, so this solution should work. Created attachment 195598 [details]
More generic fix
I should have doe this from the start.
This fix simply listens for an IStartedDMEvent for a container which indicates a start/restart, and resets the thread counter.
Committed to HEAD.
John, can you review? *** cdt cvs genie on behalf of mkhouzam *** Bug 339456: Thread created event with wrong id after restart for GDB < 7.0 [*] CLIEventProcessor.java 1.10 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.9&r2=1.10 |