From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12055 invoked by alias); 1 Jun 2011 15:37:48 -0000 Received: (qmail 12046 invoked by uid 22791); 1 Jun 2011 15:37:47 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,TW_BJ,TW_FN 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; Wed, 01 Jun 2011 15:37:18 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 5E289CB0214; Wed, 1 Jun 2011 17:37:17 +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 rSbuUYTUqrPR; Wed, 1 Jun 2011 17:37:14 +0200 (CEST) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 5C673CB01F0; Wed, 1 Jun 2011 17:37:14 +0200 (CEST) Subject: Re: [PATCH 3/4] aix: add support for dwarf2. Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Tristan Gingold In-Reply-To: Date: Wed, 01 Jun 2011 15:37:00 -0000 Cc: gdb-patches@sourceware.org Content-Transfer-Encoding: quoted-printable Message-Id: <4080FD67-AFB2-4E92-BA72-94C5AD5C209A@adacore.com> References: <1306146544-3925-1-git-send-email-gingold@adacore.com> <1306146544-3925-4-git-send-email-gingold@adacore.com> <5EE240AB-A6C1-4925-92D2-E0C0BCFCC43B@adacore.com> To: Tom Tromey 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-06/txt/msg00007.txt.bz2 On May 24, 2011, at 3:36 PM, Tom Tromey wrote: >>>>>> "Tristan" =3D=3D Tristan Gingold writes: >=20 > Tristan> + if (this_symtab_psymtab =3D=3D NULL) > Tristan> + return; >=20 > Tom> I don't understand this change. >=20 > Tristan> This is just a guard. process_linenos (called by > Tristan> aix_process_linenos) will dereference this_symtab_psymtab, > Tristan> which is set by read_xcoff_symtab. However, if the psymtab is > Tristan> built by dwarf2, the variable will never be initialized. >=20 > Tristan> Do you think the issue is somewhere else ? >=20 > It is very unclear to me whether this can be non-NULL even with DWARF. > In the DWARF case wouldn't the line information come from the DWARF line > table? In which case it seems like xcoffread.c should have a second > struct sym_fns, with a NULL entry for this method. Tom, here is my understanding of the issue. aix_process_linenos is called by end_symtab. In the case of a standard xcoff binary, a symtab is created only if debuggi= ng symbols are present and everything is consistent. In the case of an xcoff binary compiled without debug info, no symtab is cr= eated. In the case of a dwarf xcoff binary, a symtab is created (by dwarf2read), a= nd the call to aix_process_linenos crashes because of a non-consistent state within xcoffread. I am not sure that we could have = a second sym_fns, as an objfile can have both dwarf2 and stabs debug info. In fact this_symtab_psymtab is NULL with dwarf, as it is set only by read_x= coff_symtab, which is called only numsyms !=3D 0. This happens only when l= inenos are present. I fear that adding a second sym_fns will be harder to manage than the propo= sed guard. What do you think ? Tristan.