This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Patch for non-stop remote assertion
- From: Tom Tromey <tromey at redhat dot com>
- To: Marc Khouzam <marc dot khouzam at ericsson dot com>
- Cc: "'sami wagiaalla'" <swagiaal at redhat dot com>, "'gdb-patches\ at sourceware dot org'" <gdb-patches at sourceware dot org>
- Date: Mon, 25 Apr 2011 12:11:58 -0600
- Subject: Re: Patch for non-stop remote assertion
- References: <4D4C62FA.5080101@redhat.com> <F7CE05678329534C957159168FA70DEC577DBD1E84@EUSAACMS0703.eamcs.ericsson.se>
>>>>> "Marc" == Marc Khouzam <marc.khouzam@ericsson.com> writes:
Marc> #7 0x081b79b6 in is_thread_state (ptid=..., state=THREAD_EXITED) at ../../src/gdb/thread.c:620
Marc> #8 0x081b7a17 in is_exited (ptid=...) at ../../src/gdb/thread.c:633
Marc> #9 0x080a5143 in has_stack_frames () at ../../src/gdb/frame.c:1336
Marc> #10 0x081ce2f4 in get_current_arch () at ../../src/gdb/arch-utils.c:757
Marc> #11 0x08132b48 in python_on_resume (ptid=...) at ../../src/gdb/python/py-inferior.c:103
I think the last time this came up, we established that it is not ok to
call get_current_arch at this point.
Basically, this is a botch in the Python API -- we designed it
improperly :(
Maybe this code (and a few associated functions) could use
target_gdbarch for the time being. That is safer and probably will not
lead to reduced functionality.
Could you try the appended?
Tom
diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c
index b9df394..45f5f04 100644
--- a/gdb/python/py-inferior.c
+++ b/gdb/python/py-inferior.c
@@ -100,7 +100,7 @@ python_on_resume (ptid_t ptid)
{
struct cleanup *cleanup;
- cleanup = ensure_python_env (get_current_arch (), current_language);
+ cleanup = ensure_python_env (target_gdbarch, current_language);
if (emit_continue_event (ptid) < 0)
gdbpy_print_stack ();
@@ -116,7 +116,7 @@ python_inferior_exit (struct inferior *inf)
ptid_t ptidp;
struct target_waitstatus status;
- cleanup = ensure_python_env (get_current_arch (), current_language);
+ cleanup = ensure_python_env (target_gdbarch, current_language);
get_last_target_status (&ptidp, &status);