From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6842 invoked by alias); 25 Apr 2011 18:31:22 -0000 Received: (qmail 6823 invoked by uid 22791); 25 Apr 2011 18:31:21 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from imr3.ericy.com (HELO imr3.ericy.com) (198.24.6.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 25 Apr 2011 18:31:06 +0000 Received: from eusaamw0707.eamcs.ericsson.se ([147.117.20.32]) by imr3.ericy.com (8.13.8/8.13.8) with ESMTP id p3PIV4pY022536 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Mon, 25 Apr 2011 13:31:04 -0500 Received: from EUSAACMS0703.eamcs.ericsson.se ([169.254.1.12]) by eusaamw0707.eamcs.ericsson.se ([147.117.20.32]) with mapi; Mon, 25 Apr 2011 14:31:04 -0400 From: Marc Khouzam To: "'Tom Tromey'" CC: "'sami wagiaalla'" , "'gdb-patches@sourceware.org'" Date: Mon, 25 Apr 2011 18:31:00 -0000 Subject: RE: Patch for non-stop remote assertion Message-ID: References: <4D4C62FA.5080101@redhat.com> In-Reply-To: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-04/txt/msg00451.txt.bz2 > -----Original Message----- > From: Tom Tromey [mailto:tromey@redhat.com]=20 > Sent: Monday, April 25, 2011 2:12 PM > To: Marc Khouzam > Cc: 'sami wagiaalla'; 'gdb-patches@sourceware.org' > Subject: Re: Patch for non-stop remote assertion >=20 > >>>>> "Marc" =3D=3D Marc Khouzam writes: >=20 > Marc> #7 0x081b79b6 in is_thread_state (ptid=3D...,=20 > state=3DTHREAD_EXITED) at ../../src/gdb/thread.c:620 > Marc> #8 0x081b7a17 in is_exited (ptid=3D...) at=20 > ../../src/gdb/thread.c:633 > Marc> #9 0x080a5143 in has_stack_frames () at=20 > ../../src/gdb/frame.c:1336 > Marc> #10 0x081ce2f4 in get_current_arch () at=20 > ../../src/gdb/arch-utils.c:757 > Marc> #11 0x08132b48 in python_on_resume (ptid=3D...) at=20 > ../../src/gdb/python/py-inferior.c:103 >=20 > I think the last time this came up, we established that it is=20 > not ok to > call get_current_arch at this point. >=20 > Basically, this is a botch in the Python API -- we designed it > improperly :( >=20 > Maybe this code (and a few associated functions) could use > target_gdbarch for the time being. That is safer and=20 > probably will not > lead to reduced functionality. >=20 > Could you try the appended? Thanks! That works. No more assertion and I can do extended-remote debugging. I noticed a third use of get_current_arch () in that file, within method python_on_normal_stop (). Should that one be changed also? How do you want to move forward with this? Thanks again Marc >=20 > Tom >=20 > 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; >=20=20 > - cleanup =3D ensure_python_env (get_current_arch (),=20 > current_language); > + cleanup =3D ensure_python_env (target_gdbarch, current_language); >=20=20 > 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; >=20=20 > - cleanup =3D ensure_python_env (get_current_arch (),=20 > current_language); > + cleanup =3D ensure_python_env (target_gdbarch, current_language); >=20=20 > get_last_target_status (&ptidp, &status); >=20=20 >=20