source.c (select_source_symtab): Rewrite to use ALL_SYMTABS.

gdb/ChangeLog:

	* source.c (select_source_symtab): Rewrite to use ALL_SYMTABS.
This commit is contained in:
Doug Evans 2014-11-10 16:49:44 -08:00
parent af3768e945
commit 712a2e6d22
2 changed files with 12 additions and 11 deletions

View File

@ -1,3 +1,7 @@
2014-11-10 Doug Evans <xdje42@gmail.com>
* source.c (select_source_symtab): Rewrite to use ALL_SYMTABS.
2014-11-10 Doug Evans <xdje42@gmail.com>
PR symtab/17564

View File

@ -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, "<<C++-namespaces>>") == 0)))
{
current_source_pspace = current_program_space;
current_source_symtab = s;
}
if (!(len > 2 && (strcmp (&name[len - 2], ".h") == 0
|| strcmp (name, "<<C++-namespaces>>") == 0)))
{
current_source_pspace = current_program_space;
current_source_symtab = s;
}
}