From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14917 invoked by alias); 16 Apr 2012 21:14:05 -0000 Received: (qmail 14907 invoked by uid 22791); 16 Apr 2012 21:14:04 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 Apr 2012 21:13:49 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 62A7129004A for ; Mon, 16 Apr 2012 23:13:54 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id i9MKXWC0LcPG for ; Mon, 16 Apr 2012 23:13:54 +0200 (CEST) Received: from chinon.act-europe.fr (chinon.act-europe.fr [10.10.0.182]) by mel.act-europe.fr (Postfix) with ESMTP id 50243290025 for ; Mon, 16 Apr 2012 23:13:54 +0200 (CEST) Received: by chinon.act-europe.fr (Postfix, from userid 507) id 09C5DD98A1; Mon, 16 Apr 2012 23:13:47 +0200 (CEST) From: Joel Brobecker To: gdb-patches@sourceware.org Subject: RFC: bfd_section should not be NULL in call to prim_record_minimal_* Date: Mon, 16 Apr 2012 21:14:00 -0000 Message-Id: <1334610821-10974-1-git-send-email-brobecker@adacore.com> 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/msg00439.txt.bz2 Hello, It seems that creating breakpoints no longer works on ppc-aix: % gdb foo (gdb) b main /[...]/progspace.c:216: internal-error: set_current_program_space: Assertion `pspace != NULL' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) Patch #2 explains what is going on, but basically, xcoffread.c creates minimal symbols where the obj_section is not set. At first sight, minsyms.h seems to indicate that it is OK, if you look at prim_record_minimal_symbol_full's documentation: BFD_SECTION - the symbol's BFD section; used to find the appropriate obj_section for the minimal symbol. This can be NULL. ^^^^^^^^^^^^^^^^ But I think it is wrong, because I think a lot of places in the GDB code make the assumption that a minimal symbol's obj_section is not NULL, and the only way to set it, I think, is to have the BFD section. So, I think the function documentation should be changed to remove the permission to pass NULL, and a gdb_assert should also be added to verify that SYMBOL_OBJ_SECTION (msymbol) != NULL after the BFD section to obj_section search. In the meantime, patch #2 fixes the problem by making sure that we always pass a BFD section. I haven't tested it against the official testsuite, I will do so now, but I also wanted to start this discussion before I forget.