From: Elena Zannoni Date: Wed, 23 Jul 2003 19:24:31 +0000 (+0000) Subject: 2003-07-23 Michal Ludvig X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=63cd419876d64ed916be1b2246505f103ce39b06;p=binutils-gdb.git 2003-07-23 Michal Ludvig Elena Zannoni * linespec.c (decode_line_2): Avoid crash if find_function_start_sal() returns empty record. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 028ae51ad81..ac7e94397ea 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2003-07-23 Michal Ludvig + Elena Zannoni + + * linespec.c (decode_line_2): Avoid crash if + find_function_start_sal() returns empty record. + 2003-07-23 Andreas Schwab * ia64-tdep.c (ia64_print_insn): New function. diff --git a/gdb/linespec.c b/gdb/linespec.c index b8f727453ea..4b863ef8f74 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");