This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA] frame.c (find_frame_sal): Check return value of get_frame_function.
- From: Michael Snyder <msnyder at vmware dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Fri, 04 Mar 2011 17:31:52 -0800
- Subject: [RFA] frame.c (find_frame_sal): Check return value of get_frame_function.
The return value for get_frame_function is usually checked for null.
OK?
2011-03-04 Michael Snyder <msnyder@vmware.com>
* frame.c (find_frame_sal): Check return value of get_frame_function.
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.291
diff -u -p -r1.291 frame.c
--- frame.c 7 Jan 2011 19:36:17 -0000 1.291
+++ frame.c 5 Mar 2011 01:27:39 -0000
@@ -1892,15 +1892,16 @@ find_frame_sal (struct frame_info *frame
sym = inline_skipped_symbol (inferior_ptid);
init_sal (sal);
- if (SYMBOL_LINE (sym) != 0)
+ if (sym && SYMBOL_LINE (sym) != 0)
{
sal->symtab = SYMBOL_SYMTAB (sym);
sal->line = SYMBOL_LINE (sym);
}
else
- /* If the symbol does not have a location, we don't know where
- the call site is. Do not pretend to. This is jarring, but
- we can't do much better. */
+ /* If the symbol does not have a location (or we didn't find a
+ symbol), we don't know where the call site is. Do not
+ pretend to. This is jarring, but we can't do much
+ better. */
sal->pc = get_frame_pc (frame);
return;