Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tristan Gingold <gingold@adacore.com>
To: gdb-patches ml <gdb-patches@sourceware.org>
Subject: [RFA] Fix objfile_separate_debug_iterate
Date: Mon, 08 Feb 2010 14:16:00 -0000	[thread overview]
Message-ID: <FE6ADCE5-D00C-4C0E-9131-E7732607DB82@adacore.com> (raw)

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  <gingold@adacore.com>

	* 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;
 
-  res = objfile->separate_debug_objfile_link;
-  if (res)
-    return res;
-
   /* Common case where there is no separate debug objfile.  */
   if (objfile == parent)
     return NULL;
 
+  /* Return the brother if any.  Note that we don't iterate on brothers of
+     the parents.  */
+  res = objfile->separate_debug_objfile_link;
+  if (res)
+    return res;
+
   for (res = objfile->separate_debug_objfile_backlink;
        res != parent;
        res = res->separate_debug_objfile_backlink)
-- 
1.6.2


             reply	other threads:[~2010-02-08 14:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-08 14:16 Tristan Gingold [this message]
2010-02-08 16:45 ` Tom Tromey
2010-02-09 11:00   ` Tristan Gingold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FE6ADCE5-D00C-4C0E-9131-E7732607DB82@adacore.com \
    --to=gingold@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox