diff options
author | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2003-07-23 19:24:31 +0000 |
---|---|---|
committer | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2003-07-23 19:24:31 +0000 |
commit | 63cd419876d64ed916be1b2246505f103ce39b06 (patch) | |
tree | 88849103f84602341487ef85f08e3000d5afdf77 /gdb | |
parent | 686d097cefe09674e6dad9ccd7154f9176d067ed (diff) | |
download | gdb-63cd419876d64ed916be1b2246505f103ce39b06.zip gdb-63cd419876d64ed916be1b2246505f103ce39b06.tar.gz gdb-63cd419876d64ed916be1b2246505f103ce39b06.tar.bz2 |
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.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/linespec.c | 17 |
2 files changed, 18 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 028ae51..ac7e943 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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. diff --git a/gdb/linespec.c b/gdb/linespec.c index b8f7274..4b863ef 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -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"); |