From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15833 invoked by alias); 18 Nov 2008 00:00:52 -0000 Received: (qmail 15643 invoked by uid 22791); 18 Nov 2008 00:00:51 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 18 Nov 2008 00:00:16 +0000 Received: from spaceape24.eur.corp.google.com (spaceape24.eur.corp.google.com [172.28.16.76]) by smtp-out.google.com with ESMTP id mAI00Dox005666 for ; Mon, 17 Nov 2008 16:00:14 -0800 Received: from localhost (ruffy.corp.google.com [172.18.118.116]) by spaceape24.eur.corp.google.com with ESMTP id mAI00Bhd018087 for ; Mon, 17 Nov 2008 16:00:12 -0800 Received: by localhost (Postfix, from userid 67641) id 4F9AB1C799B; Mon, 17 Nov 2008 16:00:11 -0800 (PST) To: gdb-patches@sourceware.org Subject: [RFA] Fix thinko in frame_debug_got_null_frame Message-Id: <20081118000011.4F9AB1C799B@localhost> Date: Tue, 18 Nov 2008 17:13:00 -0000 From: dje@google.com (Doug Evans) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-11/txt/msg00456.txt.bz2 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 * 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 * 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, ""); - fprintf_unfiltered (gdb_stdlog, ") -> // %s}\n", reason); + fprintf_unfiltered (file, ""); + fprintf_unfiltered (file, ") -> // %s}\n", reason); } }