Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: gdb-patches@sourceware.org
Subject: [rfc] Add assert to catch get_frame_arch (NULL) calls
Date: Tue, 13 Jan 2009 18:07:00 -0000	[thread overview]
Message-ID: <200901131806.n0DI6dYw012644@d12av02.megacenter.de.ibm.com> (raw)

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


             reply	other threads:[~2009-01-13 18:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-13 18:07 Ulrich Weigand [this message]
2009-01-15 11:20 ` Joel Brobecker
2009-01-15 15:41   ` Ulrich Weigand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200901131806.n0DI6dYw012644@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox