From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25361 invoked by alias); 5 Jun 2009 14:04:50 -0000 Received: (qmail 25171 invoked by uid 22791); 5 Jun 2009 14:04:44 -0000 X-SWARE-Spam-Status: No, hits=-3.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 05 Jun 2009 14:04:34 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MCa23-0006pP-T1 for gdb-patches@sources.redhat.com; Fri, 05 Jun 2009 14:04:31 +0000 Received: from mobius.qnx.com ([209.226.137.108]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 05 Jun 2009 14:04:31 +0000 Received: from aristovski by mobius.qnx.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 05 Jun 2009 14:04:31 +0000 To: gdb-patches@sources.redhat.com From: Aleksandar Ristovski Subject: Re: ptid from core section Date: Fri, 05 Jun 2009 14:04:00 -0000 Message-ID: References: <4A23F9FF.8040708@qnx.com> <200906031941.55106.pedro@codesourcery.com> <200906051444.37443.pedro@codesourcery.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: <200906051444.37443.pedro@codesourcery.com> 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: 2009-06/txt/msg00096.txt.bz2 Pedro Alves wrote: > On Thursday 04 June 2009 19:31:58, Aleksandar Ristovski wrote: >> Pedro Alves wrote: >>> This is mostly OK as far as I'm concerned. One question though: >>> >>>> (ptid_from_core_section, core_section_name_from_ptid): New >>>> functions. >>> Is there still a reason the former takes bfd and bfd section pointers, >>> instead of being a mirror of the latter (say, ptid_from_core_section_name)? >>> >> Not a good reason. I just used what was available at the >> calling site. The attached patch makes arguments of the two >> new callbacks symmetrical (as much as was possible) as well >> as makes their names symmetrical. >> >> This time, gdbarch.[ch] included. >> >> > > Hmm, sorry I missed something before... > > AFAICS, core_gdbarch can end up being left NULL. Most code > that accesses it in corelow.c handles it's NULL-ness, while your In core_open, there is already a gdbarch callback which doesn't check for its NULL-ness (piece added by me), namely gdbarch_target_signal_from_host. What are the circumstances under which core_gdbarch would not be found? If we are opening a core from a system gdb was not configured for? > change adds some unconditional accesses. The path of > least resistence to fix this, is to move the callback defaults > to corelow.c, make the new callbacks optional, and check > for 'core_gdbarch && gdbarch_foo_p (core_gdbarch)' predicates > before calling the optional callbacks. > > ( This does raise the question of which gdbarch is the best in these > case: core_gdbarch; the executable's gdbarch; the more refined > target_gdbarch, which in turn is refined from current_gdbarch > through core_read_description. Yuk. ) > -- Aleksandar Ristovski QNX Software Systems