From: Jim Blandy Date: Tue, 13 Nov 2001 16:42:50 +0000 (+0000) Subject: Patch from Peter Schauer: X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=648f4f79850b4207b7de4663c3954c076bfdcdac;p=binutils-gdb.git Patch from Peter Schauer: * symtab.c (find_pc_sect_line): If we can't find the function containing PC, we certainly won't have line number information for that location, so return zero immediately. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1126b23ca96..a5798021012 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2001-11-13 Jim Blandy + + Patch from Peter Schauer: + + * symtab.c (find_pc_sect_line): If we can't find the function + containing PC, we certainly won't have line number information for + that location, so return zero immediately. + 2001-11-10 Andrew Cagney * config/i960/tm-nindy960.h (REGISTER_CONVERTIBLE) diff --git a/gdb/symtab.c b/gdb/symtab.c index cd1798d95f5..baef7031ef3 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -1570,6 +1570,14 @@ find_pc_sect_line (CORE_ADDR pc, struct sec *section, int notcurrent) INIT_SAL (&val); /* initialize to zeroes */ + /* Don't even think about line numbers if we can't find a function + symbol for PC. */ + if (find_pc_function (pc) == NULL) + { + val.pc = pc; + return val; + } + if (notcurrent) pc -= 1;