From: dje@google.com (Doug Evans)
To: gdb-patches@sourceware.org
Subject: [RFA] Fix thinko in frame_debug_got_null_frame
Date: Tue, 18 Nov 2008 17:13:00 -0000 [thread overview]
Message-ID: <20081118000011.4F9AB1C799B@localhost> (raw)
All uses of frame_debug in frame.c output to gdb_stdlog,
so I don't see that there's any real point in having
frame_debug_got_null_frame take a file arg.
Still, maybe there's a reason for keeping the `file' arg.
Which patch do you prefer? I like the first patch, deleting `file'.
2008-11-17 Doug Evans <dje@google.com>
* frame.c (frame_debug_got_null_frame): Remove file arg.
All callers updated.
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.255
diff -u -p -r1.255 frame.c
--- frame.c 24 Sep 2008 12:59:49 -0000 1.255
+++ frame.c 17 Nov 2008 23:55:42 -0000
@@ -1392,8 +1392,7 @@ get_prev_frame_1 (struct frame_info *thi
/* Debug routine to print a NULL frame being returned. */
static void
-frame_debug_got_null_frame (struct ui_file *file,
- struct frame_info *this_frame,
+frame_debug_got_null_frame (struct frame_info *this_frame,
const char *reason)
{
if (frame_debug)
@@ -1482,7 +1481,7 @@ get_prev_frame (struct frame_info *this_
Per the above, this code shouldn't even be called with a NULL
THIS_FRAME. */
- frame_debug_got_null_frame (gdb_stdlog, this_frame, "this_frame NULL");
+ frame_debug_got_null_frame (this_frame, "this_frame NULL");
return current_frame;
}
@@ -1510,7 +1509,7 @@ get_prev_frame (struct frame_info *this_
user later decides to enable unwinds past main(), that will
automatically happen. */
{
- frame_debug_got_null_frame (gdb_stdlog, this_frame, "inside main func");
+ frame_debug_got_null_frame (this_frame, "inside main func");
return NULL;
}
@@ -1521,8 +1520,7 @@ get_prev_frame (struct frame_info *this_
frame. */
if (this_frame->level + 2 > backtrace_limit)
{
- frame_debug_got_null_frame (gdb_stdlog, this_frame,
- "backtrace limit exceeded");
+ frame_debug_got_null_frame (this_frame, "backtrace limit exceeded");
return NULL;
}
@@ -1552,7 +1550,7 @@ get_prev_frame (struct frame_info *this_
&& get_frame_type (this_frame) != DUMMY_FRAME && this_frame->level >= 0
&& inside_entry_func (this_frame))
{
- frame_debug_got_null_frame (gdb_stdlog, this_frame, "inside entry func");
+ frame_debug_got_null_frame (this_frame, "inside entry func");
return NULL;
}
@@ -1564,7 +1562,7 @@ get_prev_frame (struct frame_info *this_
&& get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME
&& get_frame_pc (this_frame) == 0)
{
- frame_debug_got_null_frame (gdb_stdlog, this_frame, "zero PC");
+ frame_debug_got_null_frame (this_frame, "zero PC");
return NULL;
}
--- or ...
2008-11-17 Doug Evans <dje@google.com>
* frame.c (frame_debug_got_null_frame): Use `file' arg, not gdb_stdlog.
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.255
diff -u -p -u -p -r1.255 frame.c
--- frame.c 24 Sep 2008 12:59:49 -0000 1.255
+++ frame.c 17 Nov 2008 23:39:47 -0000
@@ -1398,12 +1399,12 @@ frame_debug_got_null_frame (struct ui_fi
{
if (frame_debug)
{
- fprintf_unfiltered (gdb_stdlog, "{ get_prev_frame (this_frame=");
+ fprintf_unfiltered (file, "{ get_prev_frame (this_frame=");
if (this_frame != NULL)
- fprintf_unfiltered (gdb_stdlog, "%d", this_frame->level);
+ fprintf_unfiltered (file, "%d", this_frame->level);
else
- fprintf_unfiltered (gdb_stdlog, "<NULL>");
- fprintf_unfiltered (gdb_stdlog, ") -> // %s}\n", reason);
+ fprintf_unfiltered (file, "<NULL>");
+ fprintf_unfiltered (file, ") -> // %s}\n", reason);
}
}
next reply other threads:[~2008-11-18 0:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-18 17:13 Doug Evans [this message]
2008-11-18 18:54 ` Daniel Jacobowitz
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=20081118000011.4F9AB1C799B@localhost \
--to=dje@google.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