Bug 510031 - [debug view] Harmonize displayed thread ids with GDB's
Summary: [debug view] Harmonize displayed thread ids with GDB's
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: Next   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-06 07:08 EST by Marc Dumais CLA
Modified: 2020-09-04 15:19 EDT (History)
2 users (show)

See Also:


Attachments
CDT Debug View - thread ids today (sequential, global) (77.37 KB, image/png)
2017-01-06 07:08 EST, Marc Dumais CLA
no flags Details
CDT Debug View - what it looks like with harmonized thread ids (81.41 KB, image/png)
2017-01-06 07:09 EST, Marc Dumais CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Dumais CLA 2017-01-06 07:08:02 EST
Created attachment 266155 [details]
CDT Debug View - thread ids today (sequential, global)

Since a few versions, GDB (on the CLI) had changed the way it displays its thread ids, whenever there is more than one inferior added to a debug session (the alternate display scheme sticks even if the session goes back to a single inferior later). 

With a single inferior, the thread ids reported are sequential and start at 1, incrementing with each created thread :
(gdb) info thread
  Id   Target Id         Frame 
* 1    Thread 0x7ffff7fca780 (LWP 5466) "multipleThreads" (running)
  2    Thread 0x7ffff6fd6700 (LWP 5485) "multipleThreads" (running)
  3    Thread 0x7ffff67d5700 (LWP 5486) "multipleThreads" (running)
  4    Thread 0x7ffff5fd4700 (LWP 5487) "multipleThreads" (running)
  5    Thread 0x7ffff57d3700 (LWP 5488) "multipleThreads" (running)
  6    Thread 0x7ffff4fd2700 (LWP 5489) "multipleThreads" (running)
  7    Thread 0x7ffff47d1700 (LWP 5490) "multipleThreads" (running)
  8    Thread 0x7ffff3fd0700 (LWP 5491) "multipleThreads" (running)
  9    Thread 0x7ffff37cf700 (LWP 5492) "multipleThreads" (running)
  10   Thread 0x7ffff2fce700 (LWP 5493) "multipleThreads" (running)
(gdb) 

With more than one inferior, GDB switches to a scheme where the id is qualified with its inferior number. For example, thread 5 of inferior 1 would be reported as thread "1.5" :
(gdb) info thread
  Id   Target Id         Frame 
  1.1  Thread 0x7ffff7fca780 (LWP 5466) "multipleThreads" (running)
  1.2  Thread 0x7ffff6fd6700 (LWP 5485) "multipleThreads" (running)
  1.3  Thread 0x7ffff67d5700 (LWP 5486) "multipleThreads" (running)
  1.4  Thread 0x7ffff5fd4700 (LWP 5487) "multipleThreads" (running)
  1.5  Thread 0x7ffff57d3700 (LWP 5488) "multipleThreads" (running)
  1.6  Thread 0x7ffff4fd2700 (LWP 5489) "multipleThreads" (running)
  1.7  Thread 0x7ffff47d1700 (LWP 5490) "multipleThreads" (running)
  1.8  Thread 0x7ffff3fd0700 (LWP 5491) "multipleThreads" (running)
  1.9  Thread 0x7ffff37cf700 (LWP 5492) "multipleThreads" (running)
  1.10 Thread 0x7ffff2fce700 (LWP 5493) "multipleThreads" (running)
* 2.1  process 7555 "bash" 0x000000000041eab0 in main ()

In CDT, we always use the first scheme, where the TID is sequential and global for all inferiors. However this can make things confusing for a user that compares the ids between the DV and the GDB console. It would be good to harmonize the displayed TIDs in both.
Comment 1 Marc Dumais CLA 2017-01-06 07:09:35 EST
Created attachment 266156 [details]
CDT Debug View - what it looks like with harmonized thread ids
Comment 2 Eclipse Genie CLA 2017-01-06 07:13:33 EST
New Gerrit change created: https://git.eclipse.org/r/88160
Comment 3 Eclipse Genie CLA 2017-01-06 08:06:45 EST
New Gerrit change created: https://git.eclipse.org/r/88161