Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfc] Add assert to catch get_frame_arch (NULL) calls
@ 2009-01-13 18:07 Ulrich Weigand
  2009-01-15 11:20 ` Joel Brobecker
  0 siblings, 1 reply; 3+ messages in thread
From: Ulrich Weigand @ 2009-01-13 18:07 UTC (permalink / raw)
  To: gdb-patches

Hello,

to prevent get_frame_arch (NULL) problems from being accidentally
re-introduced, this patch adds an assertion to get_frame_arch.

Tested with no regressions on powerpc-linux.

If there are no objections to this, I'm planning on committing
the patch within a couple of days ...

Bye,
Ulrich


ChangeLog:

	* frame.c (get_frame_arch): Abort if called with NULL this_frame.

Index: gdb/frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.257
diff -c -p -r1.257 frame.c
*** gdb/frame.c	3 Jan 2009 05:57:51 -0000	1.257
--- gdb/frame.c	13 Jan 2009 17:51:38 -0000
*************** safe_frame_unwind_memory (struct frame_i
*** 1795,1800 ****
--- 1795,1805 ----
  struct gdbarch *
  get_frame_arch (struct frame_info *this_frame)
  {
+   /* In the future, this function will return a per-frame
+      architecture instead of current_gdbarch.  Calling the
+      routine with a NULL value of this_frame is a bug!  */
+   gdb_assert (this_frame);
+ 
    return current_gdbarch;
  }
  
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-01-15 15:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-13 18:07 [rfc] Add assert to catch get_frame_arch (NULL) calls Ulrich Weigand
2009-01-15 11:20 ` Joel Brobecker
2009-01-15 15:41   ` Ulrich Weigand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox