This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
breakpoint bug with no .stabs?
- From: Don Bowman <don at sandvine dot com>
- To: gdb at sources dot redhat dot com
- Date: Sat, 2 Feb 2002 15:00:18 -0500
- Subject: breakpoint bug with no .stabs?
target is mips-wrs-vxworks. I have an image which
has some objects with -g on, and some without. I'm
using insight 5.1.1 (but I think this is a gdb specific
issue, not related to the gui).
When I place a breakpoint on a function without -g,
I get an incorrect address. After debugging, it turns
out this comes from linespec.c:1212
What's happening is that the symbol is found from the
minsyms table (mysmbol = lookup... below). Its found
correctly, and the address is right.
Then find_pc_sect_line is called, and this walks backwards
to find the source file and line. It finds some other object,
and I end up with an entirely different PC [from libsupc++],
which gets returned. The breakpoint is set there instead.
Can someone explain what's supposed to happen here? I end
up with a breakpoint on the wrong address, and then when
I run the function, it doesn't break. My vxWorks image
is built out of thousands of files, and I won't always
have -g on in each of them. Why doesn't it just return
the address from the lookup_minimal_symbol, instead
of rounding it back to the nearest file it can find?
from linespec.c:1212
msymbol = lookup_minimal_symbol (copy, NULL, NULL);
minimal_symbol_found: /* We also jump here from the case for
variables
that begin with '$' */
if (msymbol != NULL)
{
values.sals = (struct symtab_and_line *)
xmalloc (sizeof (struct symtab_and_line));
values.sals[0] = find_pc_sect_line (SYMBOL_VALUE_ADDRESS (msymbol),
(struct sec *) 0, 0);
...
}