From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6902 invoked by alias); 15 Jun 2012 07:51:30 -0000 Received: (qmail 6889 invoked by uid 22791); 15 Jun 2012 07:51:29 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 15 Jun 2012 07:51:11 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 24C27290014 for ; Fri, 15 Jun 2012 09:51:16 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 57hGww8UCzO4 for ; Fri, 15 Jun 2012 09:51:16 +0200 (CEST) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 12799290009 for ; Fri, 15 Jun 2012 09:51:16 +0200 (CEST) From: Tristan Gingold Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: [RFA] Add set/show debug unwind command Date: Fri, 15 Jun 2012 07:51:00 -0000 Message-Id: To: "gdb-patches@sourceware.org ml" Mime-Version: 1.0 (Apple Message framework v1278) 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: 2012-06/txt/msg00501.txt.bz2 Hi, while working on the Win64 SEH unwinder (my next patch), I have found usefu= l to have a debug flag for unwinder. Tested by building gdb. Tristan. 2012-06-15 Tristan Gingold * frame-unwind.c (show_unwind_debug): New function (unwind_debug): New variable. (_initialize_frame_unwind): Add show debug unwind command. * frame-unwind.h (unwind_debug): Declare. diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c index c90144f..e6035cc 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" =20 static struct gdbarch_data *frame_unwind_data; =20 @@ -237,6 +239,17 @@ frame_unwind_got_address (struct frame_info *frame, in= t regnum, return reg_val; } =20 +/* Flag to control debugging. */ + +int unwind_debug; +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; =20 @@ -244,4 +257,14 @@ void _initialize_frame_unwind (void) { frame_unwind_data =3D gdbarch_data_register_pre_init (frame_unwind_init); + + /* Debug this files internals. */ + 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 f82d763..64405b9 100644 --- a/gdb/frame-unwind.h +++ b/gdb/frame-unwind.h @@ -217,4 +217,8 @@ struct value *frame_unwind_got_bytes (struct frame_info= *frame, int regnum, struct value *frame_unwind_got_address (struct frame_info *frame, int regn= um, CORE_ADDR addr); =20 +/* Flag to control debugging. */ + +extern int unwind_debug; + #endif