From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29285 invoked by alias); 16 May 2011 15:41:50 -0000 Received: (qmail 29272 invoked by uid 22791); 16 May 2011 15:41:48 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from imr4.ericy.com (HELO imr4.ericy.com) (198.24.6.8) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 May 2011 15:41:32 +0000 Received: from eusaamw0711.eamcs.ericsson.se ([147.117.20.178]) by imr4.ericy.com (8.14.3/8.14.3/Debian-9.1ubuntu1) with ESMTP id p4GFfA97020086; Mon, 16 May 2011 10:41:31 -0500 Received: from EUSAACMS0703.eamcs.ericsson.se ([169.254.1.12]) by eusaamw0711.eamcs.ericsson.se ([147.117.20.178]) with mapi; Mon, 16 May 2011 11:41:14 -0400 From: Marc Khouzam To: "'Tom Tromey'" CC: "'sami wagiaalla'" , "'gdb-patches@sourceware.org'" Date: Mon, 16 May 2011 15:41: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-05/txt/msg00357.txt.bz2 =20 > -----Original Message----- > From: gdb-patches-owner@sourceware.org=20 > [mailto:gdb-patches-owner@sourceware.org] On Behalf Of Marc Khouzam > Sent: Monday, April 25, 2011 2:31 PM > To: 'Tom Tromey' > Cc: 'sami wagiaalla'; 'gdb-patches@sourceware.org' > Subject: RE: Patch for non-stop remote assertion >=20 > > -----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? >=20 > Thanks! That works. No more assertion and I can do > extended-remote debugging. >=20 > I noticed a third use of get_current_arch () in that file, > within method python_on_normal_stop (). Should that one be > changed also? >=20 > How do you want to move forward with this? Since the proposed was yours, I didn't think it was my place to post it, but if it will save you time, I can take it from here, repost the patch, and upon approval, commit to 7.3 and HEAD. What do you say? Thanks Marc >=20 > Thanks again >=20 > Marc >=20 > >=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 >=20