From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12646 invoked by alias); 14 Aug 2017 03:41:01 -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 3584 invoked by uid 89); 14 Aug 2017 03:40:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: gproxy7-pub.mail.unifiedlayer.com Received: from gproxy7-pub.mail.unifiedlayer.com (HELO gproxy7-pub.mail.unifiedlayer.com) (70.40.196.235) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 14 Aug 2017 03:40:42 +0000 Received: from cmgw2 (unknown [10.0.90.83]) by gproxy7.mail.unifiedlayer.com (Postfix) with ESMTP id CA728215D21 for ; Sun, 13 Aug 2017 21:40:40 -0600 (MDT) Received: from box522.bluehost.com ([74.220.219.122]) by cmgw2 with id wrgd1v00V2f2jeq01rggSM; Sun, 13 Aug 2017 21:40:40 -0600 X-Authority-Analysis: v=2.2 cv=T7z8d7CQ c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=KeKAF7QvOSUA:10 a=zstS-IiYAAAA:8 a=20KFwNOVAAAA:8 a=MEBFHdB8BriuhnF178MA:9 a=4G6NA9xxw8l3yy4pmD5M:22 Received: from 75-166-24-97.hlrn.qwest.net ([75.166.24.97]:55932 helo=bapiya.Home) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1dh6F3-0025eE-Mh; Sun, 13 Aug 2017 21:40:37 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA v2 02/13] Change backtrace_command_1 calling to use flags Date: Mon, 14 Aug 2017 03:41:00 -0000 Message-Id: <20170814034030.20863-3-tom@tromey.com> In-Reply-To: <20170814034030.20863-1-tom@tromey.com> References: <20170814034030.20863-1-tom@tromey.com> X-BWhitelist: no X-Exim-ID: 1dh6F3-0025eE-Mh X-Source-Sender: 75-166-24-97.hlrn.qwest.net (bapiya.Home) [75.166.24.97]:55932 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-Local-Domain: yes X-SW-Source: 2017-08/txt/msg00273.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-08-13 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 a754b7d..bd18b53 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2017-08-13 Tom Tromey + * stack.c (backtrace_command_1): Remove "show_locals" parameter, + add "flags". + (backtrace_command): Remove "fulltrace", add "flags". + +2017-08-13 Tom Tromey + * stack.c (backtrace_command): Rewrite command line parsing. 2017-08-11 Pedro Alves diff --git a/gdb/stack.c b/gdb/stack.c index 30d16cb..be83f6d 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) @@ -1889,7 +1887,7 @@ backtrace_command (char *arg, int from_tty) if (subset_compare (this_arg.get (), "no-filters")) filters = false; else if (subset_compare (this_arg.get (), "full")) - fulltrace = true; + flags |= PRINT_LOCALS; else { /* Not a recognized argument, so stop. */ @@ -1902,8 +1900,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.4