Patch from Peter Schauer:
authorJim Blandy <jimb@codesourcery.com>
Tue, 13 Nov 2001 16:42:50 +0000 (16:42 +0000)
committerJim Blandy <jimb@codesourcery.com>
Tue, 13 Nov 2001 16:42:50 +0000 (16:42 +0000)
* 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.

gdb/ChangeLog
gdb/symtab.c

index 1126b23ca96a2a0327303456c4c4c9383de00b5e..a5798021012c6f75cf47a37ddc0ac56914ed1e36 100644 (file)
@@ -1,3 +1,11 @@
+2001-11-13  Jim Blandy  <jimb@redhat.com>
+
+       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  <ac131313@redhat.com>
 
        * config/i960/tm-nindy960.h (REGISTER_CONVERTIBLE)
index cd1798d95f51e39f8397b0ad305119148e05d98b..baef7031ef39418ed5fa15316d2d05c90c145327 100644 (file)
@@ -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;