Re: [PATCH v2 1/2] gdb: keep record of thread numbers for reverse execution targets

Magne Hov via Gdb-patches
2023-09-20T17:01:09Z

On Wed, Sep 20 2023, Pedro Alves wrote:

> On 2023-09-19 17:33, Tom Tromey wrote:
>>>>>>> "Magne" == Magne Hov via Gdb-patches <gdb-patches@sourceware.org> writes:
>>
>> Magne> Targets that support reverse execution may report threads that have
>> Magne> previously been seen to exit. Currently, GDB assigns a new thread
>> Magne> number every time it sees the same thread (re)appearing, but this is
>> Magne> problematic because it makes the output of `info threads` inconsistent,
>> Magne> and because thread-specific breakpoints depend on stable thread-numbers
>> Magne> in order to stop on the right thread.
>>
>> Thank you for the patch.
>>
>> Magne> + std::unordered_map<ptid_t, std::pair<int, int>, hash_ptid> ptid_thread_num_map;
>>
>> You'll have to update this for the hash_ptid -> std::hash<ptid_t>
>> change. However, that's trivial.
>
> I think I have some concerns. Could you hold off a bit?

No worries, I'll hold off until you've had time to have a look.

>
> Sorry I've not managed to stay on top of patch as I'd wish I would.
>

--
Magne Hov | Software Engineer | Direct: +44 7395 395 648 | mhov@undo.io

Undo | Record. Replay. Resolve