2003-07-23 Michal Ludvig <mludvig@suse.cz>
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>
Wed, 23 Jul 2003 19:24:31 +0000 (19:24 +0000)
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>
Wed, 23 Jul 2003 19:24:31 +0000 (19:24 +0000)
    Elena Zannoni  <ezannoni@redhat.com>

  * linespec.c (decode_line_2): Avoid crash if
  find_function_start_sal() returns empty record.

gdb/ChangeLog
gdb/linespec.c

index 028ae51ad8134e8915035db5f549cb4cf3c360cf..ac7e94397ea5edb3e92d12a7cdf223cc907acdc4 100644 (file)
@@ -1,3 +1,9 @@
+2003-07-23  Michal Ludvig  <mludvig@suse.cz>
+           Elena Zannoni  <ezannoni@redhat.com>
+
+       * linespec.c (decode_line_2): Avoid crash if 
+       find_function_start_sal() returns empty record.
+
 2003-07-23  Andreas Schwab  <schwab@suse.de>
 
        * ia64-tdep.c (ia64_print_insn): New function.
index b8f727453ea04a30b46a7ab394e6c69f840ad5c5..4b863ef8f745dcd656d43b1892eec25cc9a22937 100644 (file)
@@ -483,11 +483,18 @@ decode_line_2 (struct symbol *sym_arr[], int nelts, int funfirstline,
       if (sym_arr[i] && SYMBOL_CLASS (sym_arr[i]) == LOC_BLOCK)
        {
          values.sals[i] = find_function_start_sal (sym_arr[i], funfirstline);
-         printf_unfiltered ("[%d] %s at %s:%d\n",
-                            (i + 2),
-                            SYMBOL_PRINT_NAME (sym_arr[i]),
-                            values.sals[i].symtab->filename,
-                            values.sals[i].line);
+         if (values.sals[i].symtab)
+           printf_unfiltered ("[%d] %s at %s:%d\n",
+                              (i + 2),
+                              SYMBOL_PRINT_NAME (sym_arr[i]),
+                              values.sals[i].symtab->filename,
+                              values.sals[i].line);
+         else
+           printf_unfiltered ("[%d] %s at ?FILE:%d [No symtab? Probably broken debug info...]\n",
+                              (i + 2),
+                              SYMBOL_PRINT_NAME (sym_arr[i]),
+                              values.sals[i].line);
+
        }
       else
        printf_unfiltered ("?HERE\n");