diff options
author | Jim Blandy <jimb@codesourcery.com> | 2001-11-13 16:42:50 +0000 |
---|---|---|
committer | Jim Blandy <jimb@codesourcery.com> | 2001-11-13 16:42:50 +0000 |
commit | 648f4f79850b4207b7de4663c3954c076bfdcdac (patch) | |
tree | ad1f133954018321acf3012b7de1d12aea3932bb /gdb/symtab.c | |
parent | 0dfe746f7456c774309a6f68319d77a26af6cee4 (diff) | |
download | gdb-648f4f79850b4207b7de4663c3954c076bfdcdac.zip gdb-648f4f79850b4207b7de4663c3954c076bfdcdac.tar.gz gdb-648f4f79850b4207b7de4663c3954c076bfdcdac.tar.bz2 |
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.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r-- | gdb/symtab.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c index cd1798d..baef703 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; |