This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/2] mi: Restore original thread/frame when specifying --thread or --thread-group
On 16-08-05 04:58 PM, Simon Marchi wrote:
> On 16-08-05 01:26 PM, Pedro Alves wrote:
>> Yeah. The approach of extending the previous_inferior_ptid's scope a bit would
>> avoid this, since it wouldn't need to revert back anything with a cleanup.
>> Might end up being that once all the spots are identified, switching to
>> the other approach ends up being a simpler patch.
>
> Hmm maybe. I'll try to continue on that path and see what it gives. I really feel
> like I don't know what I am doing, but I'll try anyway, that's how we learn I suppose :).
Given the timeframe, I don't think it's realistic nor a good idea to push
to get this into 7.12. Unless there's an obvious way to do it that I missed,
the changes are quite big and risky so close to the release.
Here's my work-in-progress branch in case you'd like to take a high level look.
https://github.com/simark/binutils-gdb/commits/user-selected-ptid
It's not all pretty, but I got the testsuite to pass (at least with native x86
Linux, I haven't tried with remote yet...). The "user_selection" object keeps
the currently selected inferior and thread, but not the frame yet. That means
that if you are inspecting an arbitrary frame and there's an MI command with
--thread, the inferior/thread will be kept, but not your frame.