From cf00dfa7c9b86f171c2f331f4bafcf2593d868e9 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 8 Jan 2010 16:54:14 +0000 Subject: [PATCH] Fix multiexec race. * infrun.c (handle_inferior_event): Use get_thread_regcache with events ptid, not get_current_regcache. --- gdb/ChangeLog | 6 ++++++ gdb/infrun.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index cb49ab9ddb..bfb8d29e6a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2010-01-08 Vladimir Prus + + Fix multiexec race. + * infrun.c (handle_inferior_event): Use get_thread_regcache + with events ptid, not get_current_regcache. + 2009-01-08 Joel Brobecker GDB crash with empty executable name (MinGW). diff --git a/gdb/infrun.c b/gdb/infrun.c index a657026b8b..cfa7e82865 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