aboutsummaryrefslogtreecommitdiff
path: root/gdb/objfiles.c
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2010-02-09 10:59:50 +0000
committerTristan Gingold <gingold@adacore.com>2010-02-09 10:59:50 +0000
commit399f313b12b98f268b6c95967d473dfd64c72df6 (patch)
tree99d69db7fcb4cc70408d2a65f62d2abe98314d55 /gdb/objfiles.c
parenta9f844b10796cac2bf25b92512385a09ce805c59 (diff)
downloadgdb-399f313b12b98f268b6c95967d473dfd64c72df6.zip
gdb-399f313b12b98f268b6c95967d473dfd64c72df6.tar.gz
gdb-399f313b12b98f268b6c95967d473dfd64c72df6.tar.bz2
2010-02-08 Tristan Gingold <gingold@adacore.com>
* objfiles.c (objfile_separate_debug_iterate): Do not iterate on brothers of the parent.
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r--gdb/objfiles.c11
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 any, return the first child. */
res = objfile->separate_debug_objfile;
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)