From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1411 invoked by alias); 8 Feb 2010 14:16:14 -0000 Received: (qmail 1401 invoked by uid 22791); 8 Feb 2010 14:16:12 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 08 Feb 2010 14:16:07 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 9DA2CCB021D for ; Mon, 8 Feb 2010 15:16:04 +0100 (CET) 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 VL+kdH33brVW for ; Mon, 8 Feb 2010 15:16:04 +0100 (CET) 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 8B945CB0219 for ; Mon, 8 Feb 2010 15:16:04 +0100 (CET) From: Tristan Gingold Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: [RFA] Fix objfile_separate_debug_iterate Date: Mon, 08 Feb 2010 14:16:00 -0000 Message-Id: To: gdb-patches ml Mime-Version: 1.0 (Apple Message framework v1077) 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: 2010-02/txt/msg00207.txt.bz2 Hi, this patch fixes a thinko that triggers when an objfile: * has no separate objfile * has 'brother' objfiles. (This can happen currently only with Mach-O). No regressions on GNU/Linux i386. Tristan. 2010-02-08 Tristan Gingold * objfiles.c (objfile_separate_debug_iterate): Do not iterate on brothers of the parent. --- gdb/objfiles.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 0b07e37..489b812 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -392,18 +392,21 @@ objfile_separate_debug_iterate (const struct objfile = *parent, { struct objfile *res; if (res) return res; =20 - res =3D objfile->separate_debug_objfile_link; - if (res) - return res; - /* Common case where there is no separate debug objfile. */ if (objfile =3D=3D parent) return NULL; =20 + /* Return the brother if any. Note that we don't iterate on brothers of + the parents. */ + res =3D objfile->separate_debug_objfile_link; + if (res) + return res; + for (res =3D objfile->separate_debug_objfile_backlink; res !=3D parent; res =3D res->separate_debug_objfile_backlink) --=20 1.6.2