From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27042 invoked by alias); 25 Apr 2011 18:12:19 -0000 Received: (qmail 27026 invoked by uid 22791); 25 Apr 2011 18:12:17 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 25 Apr 2011 18:12:02 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3PIBx5W015415 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 25 Apr 2011 14:11:59 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p3PIBxsd010476; Mon, 25 Apr 2011 14:11:59 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p3PIBwg5024002; Mon, 25 Apr 2011 14:11:58 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 3B1553781C7; Mon, 25 Apr 2011 12:11:58 -0600 (MDT) From: Tom Tromey To: Marc Khouzam Cc: "'sami wagiaalla'" , "'gdb-patches\@sourceware.org'" Subject: Re: Patch for non-stop remote assertion References: <4D4C62FA.5080101@redhat.com> Date: Mon, 25 Apr 2011 18:12:00 -0000 In-Reply-To: (Marc Khouzam's message of "Wed, 20 Apr 2011 16:26:35 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00447.txt.bz2 >>>>> "Marc" == Marc Khouzam 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);