Bug 23454 - thread number changes, when using rr record/replay
Summary: thread number changes, when using rr record/replay
Status: UNCONFIRMED
Alias: None
Product: gdb
Classification: Unclassified
Component: record (show other bugs)
Version: HEAD
: P2 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-26 11:30 UTC by kevin.mangold
Modified: 2018-07-27 14:13 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
gdbthread.h and thread.c (22.12 KB, application/x-zip-compressed)
2018-07-26 11:30 UTC, kevin.mangold
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kevin.mangold 2018-07-26 11:30:21 UTC
Created attachment 11154 [details]
gdbthread.h and thread.c

When gdb is used with the rr record/replay tool, the thread number changes everytime a thread creation gets re-executed. 
For more information look at this rr issue: https://github.com/mozilla/rr/issues/2229
I fixed this bug, by saving a map with corresponding thread id's to thread numbers. When the thread id already existed, we are using the old thread number, if not everything stays the same. 
Normal using of gdb doesn't get affected, it only affects, when used with rr (and maybe other record/replay debugger...)
I attach my changes in thread.c and gdbthread.h
Comment 1 Tom Tromey 2018-07-27 14:13:58 UTC
Hi.  Thanks for the patch.
gdb patches should be sent to the gdb-patches list;
see the contribution checklist for details:
https://sourceware.org/gdb/wiki/ContributionChecklist