From: Doug Evans Date: Tue, 11 Nov 2014 00:49:44 +0000 (-0800) Subject: source.c (select_source_symtab): Rewrite to use ALL_SYMTABS. X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=712a2e6d225f2139be6954c948d8db2787071051;p=deliverable%2Fbinutils-gdb.git source.c (select_source_symtab): Rewrite to use ALL_SYMTABS. gdb/ChangeLog: * source.c (select_source_symtab): Rewrite to use ALL_SYMTABS. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 56e43410fc..b8d011726e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2014-11-10 Doug Evans + + * source.c (select_source_symtab): Rewrite to use ALL_SYMTABS. + 2014-11-10 Doug Evans PR symtab/17564 diff --git a/gdb/source.c b/gdb/source.c index 19c2562375..1bb19c9d5f 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -291,19 +291,16 @@ select_source_symtab (struct symtab *s) current_source_line = 1; - ALL_OBJFILES (ofp) + ALL_SYMTABS (ofp, s) { - for (s = ofp->symtabs; s; s = s->next) - { - const char *name = s->filename; - int len = strlen (name); + const char *name = s->filename; + int len = strlen (name); - if (!(len > 2 && (strcmp (&name[len - 2], ".h") == 0 - || strcmp (name, "<>") == 0))) - { - current_source_pspace = current_program_space; - current_source_symtab = s; - } + if (!(len > 2 && (strcmp (&name[len - 2], ".h") == 0 + || strcmp (name, "<>") == 0))) + { + current_source_pspace = current_program_space; + current_source_symtab = s; } }