From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Vladimir Prus <vladimir@codesourcery.com>
Subject: Re: RFC: fix race in multiexec case
Date: Wed, 06 Jan 2010 16:32:00 -0000 [thread overview]
Message-ID: <201001061631.59732.pedro@codesourcery.com> (raw)
In-Reply-To: <201001051126.58970.vladimir@codesourcery.com>
On Tuesday 05 January 2010 08:26:58, Vladimir Prus wrote:
> However, find_lwp_pid returns NULL for null_ptid, and this code segfaults.
> I attach a minimal patch that appears to fix this, but I feel uneasy about it.
Ah, this bit runs before the almighty context_switch line. Your fix is correct.
> Maybe, inferior_ptid should be reset much earlier?
Yes, at some point, we should clean this all up and context switch
as soon as we see an event, like in non-stop (fetch_inferior_event).
Not much point in not doing so, now that the globals that formed
the supposed "context" are gone.
> diff --git a/gdb/infrun.c b/gdb/infrun.c
> index d8ca40d..300af62 100644
> --- a/gdb/infrun.c
> +++ b/gdb/infrun.c
> @@ -3232,7 +3232,8 @@ targets should add new threads to the thread list themselves in non-stop mode.")
> if (ecs->event_thread->stop_signal == TARGET_SIGNAL_TRAP)
> {
> int thread_hop_needed = 0;
> - struct address_space *aspace = get_regcache_aspace (get_current_regcache ());
> + struct address_space *aspace =
> + get_regcache_aspace (get_thread_regcache (ecs->ptid));
>
> /* Check if a regular breakpoint has been hit before checking
> for a potential single step breakpoint. Otherwise, GDB will
>
This is OK.
--
Pedro Alves
next prev parent reply other threads:[~2010-01-06 16:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-05 8:27 Vladimir Prus
2010-01-06 16:32 ` Pedro Alves [this message]
2010-01-08 14:10 ` Vladimir Prus
2010-01-08 14:23 ` Pedro Alves
2010-01-08 16:54 ` Vladimir Prus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201001061631.59732.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=vladimir@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox