From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34639 invoked by alias); 25 Apr 2017 19:43:17 -0000 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 Received: (qmail 34270 invoked by uid 89); 25 Apr 2017 19:43:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=LOCATION X-HELO: gproxy4.mail.unifiedlayer.com Received: from gproxy4-pub.mail.unifiedlayer.com (HELO gproxy4.mail.unifiedlayer.com) (69.89.23.142) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 25 Apr 2017 19:43:11 +0000 Received: from CMOut01 (unknown [10.0.90.82]) by gproxy4.mail.unifiedlayer.com (Postfix) with ESMTP id A6CDA1763E7 for ; Tue, 25 Apr 2017 13:41:32 -0600 (MDT) Received: from box522.bluehost.com ([74.220.219.122]) by CMOut01 with id CjhV1v0062f2jeq01jhY1l; Tue, 25 Apr 2017 13:41:32 -0600 X-Authority-Analysis: v=2.2 cv=K+5SJ2eI c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=AzvcPWV-tVgA:10 a=zstS-IiYAAAA:8 a=KKAkSRfTAAAA:8 a=MEBFHdB8BriuhnF178MA:9 a=4G6NA9xxw8l3yy4pmD5M:22 a=cvBusfyB2V15izCimMoJ:22 Received: from 75-166-63-71.hlrn.qwest.net ([75.166.63.71]:40598 helo=bapiya.Home) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1d36L3-0000OG-48; Tue, 25 Apr 2017 13:41:29 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 02/10] Change backtrace_command_1 calling to use flags Date: Tue, 25 Apr 2017 19:43:00 -0000 Message-Id: <20170425194113.17862-3-tom@tromey.com> In-Reply-To: <20170425194113.17862-1-tom@tromey.com> References: <20170425194113.17862-1-tom@tromey.com> X-BWhitelist: no X-Exim-ID: 1d36L3-0000OG-48 X-Source-Sender: 75-166-63-71.hlrn.qwest.net (bapiya.Home) [75.166.63.71]:40598 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-SW-Source: 2017-04/txt/msg00680.txt.bz2 The next patch will add more flags to backtrace_command_1; and rather than add another boolean argument, this patch changes it to accept a flags value. ChangeLog 2017-04-25 Tom Tromey * stack.c (backtrace_command_1): Remove "show_locals" parameter, add "flags". (backtrace_command): Remove "fulltrace", add "flags". --- gdb/ChangeLog | 6 ++++++ gdb/stack.c | 15 ++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 48f2063..ab9b432 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2017-04-25 Tom Tromey + * stack.c (backtrace_command_1): Remove "show_locals" parameter, + add "flags". + (backtrace_command): Remove "fulltrace", add "flags". + +2017-04-25 Tom Tromey + * stack.c (backtrace_command): Rewrite command line parsing. 2017-04-25 Yao Qi diff --git a/gdb/stack.c b/gdb/stack.c index c2fc3f1..b320c93 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -1714,7 +1714,7 @@ frame_info (char *addr_exp, int from_tty) frames. */ static void -backtrace_command_1 (char *count_exp, int show_locals, int no_filters, +backtrace_command_1 (char *count_exp, int flags, int no_filters, int from_tty) { struct frame_info *fi; @@ -1795,11 +1795,9 @@ backtrace_command_1 (char *count_exp, int show_locals, int no_filters, if (! no_filters) { - int flags = PRINT_LEVEL | PRINT_FRAME_INFO | PRINT_ARGS; enum ext_lang_frame_args arg_type; - if (show_locals) - flags |= PRINT_LOCALS; + flags |= PRINT_LEVEL | PRINT_FRAME_INFO | PRINT_ARGS; if (!strcmp (print_frame_arguments, "scalars")) arg_type = CLI_SCALAR_VALUES; @@ -1827,7 +1825,7 @@ backtrace_command_1 (char *count_exp, int show_locals, int no_filters, the frame->prev field gets set to NULL in that case). */ print_frame_info (fi, 1, LOCATION, 1, 0); - if (show_locals) + if ((flags & PRINT_LOCALS) != 0) { struct frame_id frame_id = get_frame_id (fi); @@ -1868,7 +1866,7 @@ backtrace_command_1 (char *count_exp, int show_locals, int no_filters, static void backtrace_command (char *arg, int from_tty) { - bool fulltrace = false; + int flags = 0; bool filters = true; if (arg) @@ -1891,7 +1889,7 @@ backtrace_command (char *arg, int from_tty) if (subset_compare (this_arg, "no-filters")) filters = false; else if (subset_compare (this_arg, "full")) - fulltrace = true; + flags |= PRINT_LOCALS; else { /* Not a recognized argument, so stop. */ @@ -1906,8 +1904,7 @@ backtrace_command (char *arg, int from_tty) arg = NULL; } - backtrace_command_1 (arg, fulltrace /* show_locals */, - !filters /* no frame-filters */, from_tty); + backtrace_command_1 (arg, flags, !filters /* no frame-filters */, from_tty); } /* Iterate over the local variables of a block B, calling CB with -- 2.9.3