* linespec.c (symbol_found): Restore line-based result for
non-LOC_LABEL symbols.
This commit is contained in:
parent
68187828c0
commit
628534583b
2 changed files with 20 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2011-03-25 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
|
* linespec.c (symbol_found): Restore line-based result for
|
||||||
|
non-LOC_LABEL symbols.
|
||||||
|
|
||||||
2011-03-25 Kai Tietz <ktietz@redhat.com>
|
2011-03-25 Kai Tietz <ktietz@redhat.com>
|
||||||
|
|
||||||
* tui/tui-source.c (tui_set_source_content): Use filename_cmp
|
* tui/tui-source.c (tui_set_source_content): Use filename_cmp
|
||||||
|
|
|
@ -2174,9 +2174,7 @@ symbol_found (int funfirstline, struct linespec_result *canonical, char *copy,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (funfirstline && SYMBOL_CLASS (sym) != LOC_LABEL)
|
if (SYMBOL_CLASS (sym) == LOC_LABEL && SYMBOL_VALUE_ADDRESS (sym) != 0)
|
||||||
error (_("\"%s\" is not a function"), copy);
|
|
||||||
else if (SYMBOL_VALUE_ADDRESS (sym) != 0)
|
|
||||||
{
|
{
|
||||||
/* We know its line number. */
|
/* We know its line number. */
|
||||||
values.sals = (struct symtab_and_line *)
|
values.sals = (struct symtab_and_line *)
|
||||||
|
@ -2201,6 +2199,20 @@ symbol_found (int funfirstline, struct linespec_result *canonical, char *copy,
|
||||||
|
|
||||||
return values;
|
return values;
|
||||||
}
|
}
|
||||||
|
else if (funfirstline)
|
||||||
|
error (_("\"%s\" is not a function"), copy);
|
||||||
|
else if (SYMBOL_LINE (sym) != 0)
|
||||||
|
{
|
||||||
|
/* We know its line number. */
|
||||||
|
values.sals = (struct symtab_and_line *)
|
||||||
|
xmalloc (sizeof (struct symtab_and_line));
|
||||||
|
values.nelts = 1;
|
||||||
|
memset (&values.sals[0], 0, sizeof (values.sals[0]));
|
||||||
|
values.sals[0].symtab = SYMBOL_SYMTAB (sym);
|
||||||
|
values.sals[0].line = SYMBOL_LINE (sym);
|
||||||
|
values.sals[0].pspace = SYMTAB_PSPACE (SYMBOL_SYMTAB (sym));
|
||||||
|
return values;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
/* This can happen if it is compiled with a compiler which doesn't
|
/* This can happen if it is compiled with a compiler which doesn't
|
||||||
put out line numbers for variables. */
|
put out line numbers for variables. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue