From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29855 invoked by alias); 17 Apr 2012 11:51:39 -0000 Received: (qmail 29846 invoked by uid 22791); 17 Apr 2012 11:51:38 -0000 X-SWARE-Spam-Status: No, hits=-5.8 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,TW_BJ,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; Tue, 17 Apr 2012 11:51:05 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3HBoqOc031757 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 17 Apr 2012 07:50:53 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q3HBop08030947 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 17 Apr 2012 07:50:51 -0400 From: Tom Tromey To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: RFC: bfd_section should not be NULL in call to prim_record_minimal_* References: <1334610821-10974-1-git-send-email-brobecker@adacore.com> Date: Tue, 17 Apr 2012 12:03:00 -0000 In-Reply-To: <1334610821-10974-1-git-send-email-brobecker@adacore.com> (Joel Brobecker's message of "Mon, 16 Apr 2012 23:13:39 +0200") Message-ID: <87zkaawp9g.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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: 2012-04/txt/msg00458.txt.bz2 >>>>> "Joel" == Joel Brobecker writes: Joel> But I think it is wrong, because I think a lot of places in the GDB code Joel> make the assumption that a minimal symbol's obj_section is not NULL, and Joel> the only way to set it, I think, is to have the BFD section. Joel> So, I think the function documentation should be changed to remove Joel> the permission to pass NULL, and a gdb_assert should also be added Joel> to verify that SYMBOL_OBJ_SECTION (msymbol) != NULL after the Joel> BFD section to obj_section search. Joel> In the meantime, patch #2 fixes the problem by making sure that we Joel> always pass a BFD section. I haven't tested it against the official Joel> testsuite, I will do so now, but I also wanted to start this discussion Joel> before I forget. This change is fine with me -- even more than fine, I think removing special cases is generally better when possible. However, if this is just a regression caused by linespec changes, maybe it can also be fixed in another way. That is, you can find a minsym's objfile using msymbol_objfile; I think this would fix the possibly problematic uses I see in linespec.c (the one in minsym_found is maybe ok). I wanted to mention this in case the change causes other regressions in your testing. Did you audit the other symbol readers? Tom