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

* Re: [rfc] Add assert to catch get_frame_arch (NULL) calls
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2009-01-15 11:20 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: gdb-patches

Hmpf, should have read the rest of my gdb-patches mail before answering
your previous commit - I'm just a little tied up right now, so I just
browse some emails semi-randomly when I have a few minutes of free time.

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

This would fine for me. I'm slightly concerned about the next release,
whether this might introduce an unnecessary risk or not.  But this
will depend on the amount of time that we will take before creating
the next branch.  I will add that to the list of things to reassess
before we make the next release.

-- 
Joel


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

* Re: [rfc] Add assert to catch get_frame_arch (NULL) calls
  2009-01-15 11:20 ` Joel Brobecker
@ 2009-01-15 15:41   ` Ulrich Weigand
  0 siblings, 0 replies; 3+ messages in thread
From: Ulrich Weigand @ 2009-01-15 15:41 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

Joel Brobecker wrote:

> > ChangeLog:
> > 
> > 	* frame.c (get_frame_arch): Abort if called with NULL this_frame.
> 
> This would fine for me. I'm slightly concerned about the next release,
> whether this might introduce an unnecessary risk or not.  But this
> will depend on the amount of time that we will take before creating
> the next branch.  I will add that to the list of things to reassess
> before we make the next release.

Agreed.  I've checked this in for now; we can always decide to pull
it back out on the release branch, if necessary.

Bye,
Ulrich

-- 
  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