PR mi/9583:
* symtab.c (find_line_symtab, append_exact_match_to_sals) (expand_line_sal): Use full filename when setting breakpoints if available
This commit is contained in:
parent
de4affc9ce
commit
3ffc00b87a
|
@ -1,3 +1,10 @@
|
||||||
|
2009-11-09 Sebastien Granjoux <seb.sfo@free.fr>
|
||||||
|
|
||||||
|
PR mi/9583:
|
||||||
|
* symtab.c (find_line_symtab, append_exact_match_to_sals)
|
||||||
|
(expand_line_sal): Use full filename when setting breakpoints if
|
||||||
|
available
|
||||||
|
|
||||||
2009-11-09 Cary Coutant <ccoutant@google.com>
|
2009-11-09 Cary Coutant <ccoutant@google.com>
|
||||||
|
|
||||||
* dwarf2read.c (read_import_statement): Don't clobber original cu.
|
* dwarf2read.c (read_import_statement): Don't clobber original cu.
|
||||||
|
|
36
gdb/symtab.c
36
gdb/symtab.c
|
@ -2416,18 +2416,25 @@ find_line_symtab (struct symtab *symtab, int line, int *index, int *exact_match)
|
||||||
|
|
||||||
ALL_PSYMTABS (objfile, p)
|
ALL_PSYMTABS (objfile, p)
|
||||||
{
|
{
|
||||||
if (strcmp (symtab->filename, p->filename) != 0)
|
if (FILENAME_CMP (symtab->filename, p->filename) != 0)
|
||||||
continue;
|
continue;
|
||||||
PSYMTAB_TO_SYMTAB (p);
|
PSYMTAB_TO_SYMTAB (p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Get symbol full file name if possible. */
|
||||||
|
symtab_to_fullname (symtab);
|
||||||
|
|
||||||
ALL_SYMTABS (objfile, s)
|
ALL_SYMTABS (objfile, s)
|
||||||
{
|
{
|
||||||
struct linetable *l;
|
struct linetable *l;
|
||||||
int ind;
|
int ind;
|
||||||
|
|
||||||
if (strcmp (symtab->filename, s->filename) != 0)
|
if (FILENAME_CMP (symtab->filename, s->filename) != 0)
|
||||||
continue;
|
continue;
|
||||||
|
if (symtab->fullname != NULL
|
||||||
|
&& symtab_to_fullname (s) != NULL
|
||||||
|
&& FILENAME_CMP (symtab->fullname, s->fullname) != 0)
|
||||||
|
continue;
|
||||||
l = LINETABLE (s);
|
l = LINETABLE (s);
|
||||||
ind = find_line_common (l, line, &exact);
|
ind = find_line_common (l, line, &exact);
|
||||||
if (ind >= 0)
|
if (ind >= 0)
|
||||||
|
@ -4591,12 +4598,14 @@ append_expanded_sal (struct symtabs_and_lines *sal,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Helper to expand_line_sal below. Search in the symtabs for any
|
/* Helper to expand_line_sal below. Search in the symtabs for any
|
||||||
linetable entry that exactly matches FILENAME and LINENO and append
|
linetable entry that exactly matches FULLNAME and LINENO and append
|
||||||
them to RET. If there is at least one match, return 1; otherwise,
|
them to RET. If FULLNAME is NULL or if a symtab has no full name,
|
||||||
return 0, and return the best choice in BEST_ITEM and BEST_SYMTAB. */
|
use FILENAME and LINENO instead. If there is at least one match,
|
||||||
|
return 1; otherwise, return 0, and return the best choice in BEST_ITEM
|
||||||
|
and BEST_SYMTAB. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
append_exact_match_to_sals (char *filename, int lineno,
|
append_exact_match_to_sals (char *filename, char *fullname, int lineno,
|
||||||
struct symtabs_and_lines *ret,
|
struct symtabs_and_lines *ret,
|
||||||
struct linetable_entry **best_item,
|
struct linetable_entry **best_item,
|
||||||
struct symtab **best_symtab)
|
struct symtab **best_symtab)
|
||||||
|
@ -4612,10 +4621,14 @@ append_exact_match_to_sals (char *filename, int lineno,
|
||||||
ALL_PSPACES (pspace)
|
ALL_PSPACES (pspace)
|
||||||
ALL_PSPACE_SYMTABS (pspace, objfile, symtab)
|
ALL_PSPACE_SYMTABS (pspace, objfile, symtab)
|
||||||
{
|
{
|
||||||
if (strcmp (filename, symtab->filename) == 0)
|
if (FILENAME_CMP (filename, symtab->filename) == 0)
|
||||||
{
|
{
|
||||||
struct linetable *l;
|
struct linetable *l;
|
||||||
int len;
|
int len;
|
||||||
|
if (fullname != NULL
|
||||||
|
&& symtab_to_fullname (symtab) != NULL
|
||||||
|
&& FILENAME_CMP (fullname, symtab->fullname) != 0)
|
||||||
|
continue;
|
||||||
l = LINETABLE (symtab);
|
l = LINETABLE (symtab);
|
||||||
if (!l)
|
if (!l)
|
||||||
continue;
|
continue;
|
||||||
|
@ -4700,7 +4713,7 @@ expand_line_sal (struct symtab_and_line sal)
|
||||||
ALL_PSPACES (pspace)
|
ALL_PSPACES (pspace)
|
||||||
ALL_PSPACE_PSYMTABS (pspace, objfile, psymtab)
|
ALL_PSPACE_PSYMTABS (pspace, objfile, psymtab)
|
||||||
{
|
{
|
||||||
if (strcmp (match_filename, psymtab->filename) == 0)
|
if (FILENAME_CMP (match_filename, psymtab->filename) == 0)
|
||||||
{
|
{
|
||||||
set_current_program_space (pspace);
|
set_current_program_space (pspace);
|
||||||
|
|
||||||
|
@ -4712,10 +4725,13 @@ expand_line_sal (struct symtab_and_line sal)
|
||||||
/* Now search the symtab for exact matches and append them. If
|
/* Now search the symtab for exact matches and append them. If
|
||||||
none is found, append the best_item and all its exact
|
none is found, append the best_item and all its exact
|
||||||
matches. */
|
matches. */
|
||||||
exact = append_exact_match_to_sals (match_filename, lineno,
|
symtab_to_fullname (sal.symtab);
|
||||||
|
exact = append_exact_match_to_sals (sal.symtab->filename,
|
||||||
|
sal.symtab->fullname, lineno,
|
||||||
&ret, &best_item, &best_symtab);
|
&ret, &best_item, &best_symtab);
|
||||||
if (!exact && best_item)
|
if (!exact && best_item)
|
||||||
append_exact_match_to_sals (best_symtab->filename, best_item->line,
|
append_exact_match_to_sals (best_symtab->filename,
|
||||||
|
best_symtab->fullname, best_item->line,
|
||||||
&ret, &best_item, &best_symtab);
|
&ret, &best_item, &best_symtab);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue