This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] [PR gdb/23454] thread number ID changes, when using rr record/replay
- From: Tom Tromey <tom at tromey dot com>
- To: "Mangold\, Kevin" <kevin dot mangold at siemens dot com>
- Cc: "gdb-patches\@sourceware.org" <gdb-patches at sourceware dot org>
- Date: Thu, 09 Aug 2018 14:42:35 -0600
- Subject: Re: [PATCH] [PR gdb/23454] thread number ID changes, when using rr record/replay
- References: <DEC42497C6A9034CAD2685219EF0AD2CF57CCB@DEFTHW99EH4MSX.ww902.siemens.net>
>>>>> "Kevin" == Mangold, Kevin <kevin.mangold@siemens.com> writes:
Kevin> This commit enables the ability to use gdb with rr and rr in eclipse.
Kevin> Fixes Bug 23454 on Bugzilla
Kevin> When replaying a thread creation gdb increments the thread ID number
Kevin> shown with 'info threads'. This caused different thread ID's,
Kevin> while replaying the same thread exectuion.
Kevin> In thread.c, we made a change that looks, if this thread already
Kevin> got a number and if yes, the thread gets the old number assigned.
Kevin> When using in eclipse, we have to manually increment the
Kevin> 'highest_thread_num' once. Therefore the command:
Kevin> 'rr_running_under_eclipse' was added, which can be used 'once'
Kevin> to set the correct highest_thread_num.
If I understand properly, what's going on here is that with rr, you can
reverse-step past the creation of a thread. Then, when replaying again,
the thread is recreated but with a new thread id. However, you would
like gdb to preserve the thread id.
I think preserving the thread id makes a lot of sense. However, I don't
think a new magic command like this is the way to go about it.
Would it be possible to record some pertinent information about a thread
when stepping backward, and then maintain a map that is used to reassign
the old thread id when the thread is recreated when moving forward?
Tom