From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4899 invoked by alias); 9 Jan 2013 10:53:23 -0000 Received: (qmail 4886 invoked by uid 22791); 9 Jan 2013 10:53:21 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_NO,RP_MATCHES_RCVD,TW_UG X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Jan 2013 10:53:16 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id A26D21C7A7C; Wed, 9 Jan 2013 05:53:15 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id W0UiEYGiBx4k; Wed, 9 Jan 2013 05:53:15 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 31E231C7853; Wed, 9 Jan 2013 05:53:15 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 8E9ECC1622; Wed, 9 Jan 2013 14:53:09 +0400 (RET) From: Joel Brobecker To: gdb-patches@sourceware.org Cc: Joel Brobecker Subject: [RFA/commit+NEWS 1/2] Add command set/show debug unwind. Date: Wed, 09 Jan 2013 10:53:00 -0000 Message-Id: <1357728781-15073-2-git-send-email-brobecker@adacore.com> In-Reply-To: <1357728781-15073-1-git-send-email-brobecker@adacore.com> References: <1357728781-15073-1-git-send-email-brobecker@adacore.com> 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: 2013-01/txt/msg00155.txt.bz2 Hello, This patch adds a new debug setting to be used by frame unwinders. It should be relatively straightforward. gdb/ChangeLog: * frame-unwind.h (unwind_debug): Declare. * frame-unwind.c: #include "command.h" and "gdbcmd.h". (unwind_debug): New global. (show_unwind_debug): New function. (_initialize_frame_unwind): Add "set/show debug unwind" commands. * NEWS: Add entry for new "set/show debug unwind" commands. gdb/doc/ChangeLog: * gdb.texinfo (Debugging Output): Document the new "set/show debug unwind" commands. Will commit in a couple of days, if no objection. --- gdb/NEWS | 4 ++++ gdb/doc/gdb.texinfo | 5 +++++ gdb/frame-unwind.c | 26 ++++++++++++++++++++++++++ gdb/frame-unwind.h | 4 ++++ 4 files changed, 39 insertions(+) diff --git a/gdb/NEWS b/gdb/NEWS index 36bbd12..3451505 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -84,6 +84,10 @@ set debug notification show debug notification Control display of debugging info for async remote notification. +set debug unwind +show debug unwind + Control display of debugging info for some unwinders. + * Removed commands ** For the Renesas Super-H architecture, the "regs" command has been removed diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index f973263..f6fb342 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -22046,6 +22046,11 @@ message. @item show debug timestamp Displays the current state of displaying timestamps with @value{GDBN} debugging info. +@item set debug unwind +@cindex unwinding debugging info +Turns on or off display debugging info from some unwinders. +@item show debug unwind +Display the current state of displaying unwind debugging info. @item set debugvarobj @cindex variable object debugging info Turns on or off display of @value{GDBN} variable object debugging diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c index b66febf..7a9f6a2 100644 --- a/gdb/frame-unwind.c +++ b/gdb/frame-unwind.c @@ -27,6 +27,8 @@ #include "exceptions.h" #include "gdb_assert.h" #include "gdb_obstack.h" +#include "command.h" +#include "gdbcmd.h" static struct gdbarch_data *frame_unwind_data; @@ -237,6 +239,20 @@ frame_unwind_got_address (struct frame_info *frame, int regnum, return reg_val; } +/* Flag to control frame-unwind debugging. */ + +int unwind_debug; + +/* Implement the "show debug unwind" command. */ + +static void +show_unwind_debug (struct ui_file *file, int from_tty, + struct cmd_list_element *c, const char *value) +{ + fprintf_filtered (file, _("unwind debugging is %s.\n"), value); +} + + /* -Wmissing-prototypes */ extern initialize_file_ftype _initialize_frame_unwind; @@ -244,4 +260,14 @@ void _initialize_frame_unwind (void) { frame_unwind_data = gdbarch_data_register_pre_init (frame_unwind_init); + + add_setshow_zinteger_cmd ("unwind", class_maintenance, &unwind_debug, + _("Set unwind debugging."), + _("Show unwind debugging."), + _("When non-zero, frame specific internal " + "debugging is enabled."), + NULL, + show_unwind_debug, + &setdebuglist, &showdebuglist); + } diff --git a/gdb/frame-unwind.h b/gdb/frame-unwind.h index 91ccf8c..0471730 100644 --- a/gdb/frame-unwind.h +++ b/gdb/frame-unwind.h @@ -30,6 +30,10 @@ struct value; #include "frame.h" /* For enum frame_type. */ +/* Flag to control frame-unwind debugging. */ + +extern int unwind_debug; + /* The following unwind functions assume a chain of frames forming the sequence: (outer) prev <-> this <-> next (inner). All the functions are called with this frame's `struct frame_info' and -- 1.7.10.4