Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369168 - threadOSId is not extracted for non-pthread programs
Summary: threadOSId is not extracted for non-pthread programs
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.0.2   Edit
Assignee: Marc Khouzam CLA
QA Contact: Marc Khouzam CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 335027
  Show dependency tree
 
Reported: 2012-01-19 21:59 EST by Marc Khouzam CLA
Modified: 2012-02-29 13:21 EST (History)
3 users (show)

See Also:


Attachments
Fix (1.79 KB, patch)
2012-01-19 21:59 EST, Marc Khouzam CLA
marc.khouzam: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Khouzam CLA 2012-01-19 21:59:11 EST
Created attachment 209784 [details]
Fix

On Linux if a program is not compiled with pthread, it will still have a single thread which corresponds to the process.  This thread still has an OSId but we don't extract it well.

This is the same concept as a pthread program where the first thread has the same OSId as the process id.

The problem is that the syntax of the -thread-info MI command is slightly different when the program is not compiled with pthread.

Without pthread:
  target-id="process 3403"
with pthread:
  target-id="Thread 0xb7fe7b30 (LWP 3416)"

This fix should go into cdt_8_0 as well.

I still have to update the JUnit test to test this new parsing.
Comment 1 Marc Khouzam CLA 2012-01-19 22:33:48 EST
I simply added the line 
  assertEquals("abc123", MIThread.parseOsId("process abc123"));		
to MIThreadTests.testOsIdParsing()

I committed the fix to master and cdt_8_0
Comment 2 Marc Khouzam CLA 2012-01-19 22:38:35 EST
Note that this bug only applies to local debugging.  Remote debugging (attach or not) have the same -thread-info output for pthread and non-pthread programs.
Comment 3 CDT Genie CLA 2012-02-29 13:21:54 EST
*** cdt git genie on behalf of Marc Khouzam ***

    Bug 369168: threadOSId is not extracted for non-pthread programs

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=50640df3c04fbcf0c59873e18ddedba40e610c11
Comment 4 CDT Genie CLA 2012-02-29 13:21:56 EST
*** cdt git genie on behalf of Marc Khouzam ***

    Bug 369168: threadOSId is not extracted for non-pthread programs

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=03c9a71f0ad446078bd0847199ac6385a8809f74