This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Bail out of processing stop if hook-stop resumes target / changes context
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 14 Sep 2015 15:50:46 +0100
- Subject: Re: [PATCH] Bail out of processing stop if hook-stop resumes target / changes context
- Authentication-results: sourceware.org; auth=none
- References: <1439836415-22008-1-git-send-email-palves at redhat dot com> <86zj1n1ycy dot fsf at gmail dot com> <55DC8E2C dot 6010308 at redhat dot com> <86twrkzwf4 dot fsf at gmail dot com> <55F086B0 dot 9040701 at redhat dot com> <86oah957k1 dot fsf at gmail dot com>
On 09/11/2015 03:55 PM, Yao Qi wrote:
> Pedro Alves <palves@redhat.com> writes:
>
>> We don't have infrastructure to run command lists like that. The
>> hook-stop might involve several execution commands, for
>> instance. See:
>> https://sourceware.org/ml/gdb-patches/2011-09/msg00037.html
>> And what motivated it:
>> https://sourceware.org/ml/gdb-patches/2011-06/msg00158.html
>
> Yeah, I didn't strongly believe we have such infrastructure, so I raised
> that question.
OK. I've pushed the patch in as is now.
>
>>
>> I don't currently see any real benefit in splitting interpreter
>> command execution to a bigger and more complicated state machine
>> like I was originally attempting. I've been thinking that longer
>> term, it'd be simpler/saner if we split run control and the
>> interpreter to separate threads. I actually have a prototype
>
> It sounds natural to move interpreter and run control to separate
> threads. It may be hard to convert single-threaded gdb to a
> multi-threaded version.
I took the giant lock approach [1]. I added a big gdb lock around the
event loop's select/poll calls. That is, at any given time, there's only
really one thread not blocked in select/poll calling into gdb handling
an event. This gives us a stack per interpreter, which is what I was after.
For true parallelism, my idea was to then break the big lock into
finer-brained locks, incrementally, as needed. Not unlike e.g. how Linux's
BKL was eliminated.
[1] https://en.wikipedia.org/wiki/Giant_lock
> Note that I am not against this direction.
Great.
Thanks for the review.
--
Pedro Alves