From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16760 invoked by alias); 23 Mar 2018 20:55:18 -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 16636 invoked by uid 89); 23 Mar 2018 20:55:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: gateway21.websitewelcome.com Received: from gateway21.websitewelcome.com (HELO gateway21.websitewelcome.com) (192.185.45.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 23 Mar 2018 20:55:17 +0000 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway21.websitewelcome.com (Postfix) with ESMTP id B2574400E9F32 for ; Fri, 23 Mar 2018 15:55:15 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id zTiVeDJ4J7OvozTiVeYW6k; Fri, 23 Mar 2018 15:55:15 -0500 Received: from 174-29-60-18.hlrn.qwest.net ([174.29.60.18]:33476 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1ezTiV-001cSz-Fz; Fri, 23 Mar 2018 15:55:15 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA v3 02/13] Change backtrace_command_1 calling to use flags Date: Fri, 23 Mar 2018 20:55:00 -0000 Message-Id: <20180323205512.14434-3-tom@tromey.com> In-Reply-To: <20180323205512.14434-1-tom@tromey.com> References: <20180323205512.14434-1-tom@tromey.com> X-BWhitelist: no X-Source-L: No X-Exim-ID: 1ezTiV-001cSz-Fz X-Source-Sender: 174-29-60-18.hlrn.qwest.net (bapiya.Home) [174.29.60.18]:33476 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-SW-Source: 2018-03/txt/msg00457.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. gdb/ChangeLog 2018-03-23 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 | 17 +++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/gdb/stack.c b/gdb/stack.c index 13af6594a9..76695ff7e6 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -1692,8 +1692,8 @@ info_frame_command (const char *addr_exp, int from_tty) frames. */ static void -backtrace_command_1 (const char *count_exp, int show_locals, int no_filters, - int from_tty) +backtrace_command_1 (const char *count_exp, frame_filter_flags flags, + int no_filters, int from_tty) { struct frame_info *fi; int count; @@ -1775,11 +1775,9 @@ backtrace_command_1 (const char *count_exp, int show_locals, int no_filters, if (! no_filters) { - frame_filter_flags 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 (from_tty) flags |= PRINT_MORE_FRAMES; @@ -1809,7 +1807,7 @@ backtrace_command_1 (const 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); @@ -1850,8 +1848,8 @@ backtrace_command_1 (const char *count_exp, int show_locals, int no_filters, static void backtrace_command (const char *arg, int from_tty) { - bool fulltrace = false; bool filters = true; + frame_filter_flags flags = 0; if (arg) { @@ -1868,7 +1866,7 @@ backtrace_command (const char *arg, int from_tty) if (subset_compare (this_arg.c_str (), "no-filters")) filters = false; else if (subset_compare (this_arg.c_str (), "full")) - fulltrace = true; + flags |= PRINT_LOCALS; else { /* Not a recognized argument, so stop. */ @@ -1881,8 +1879,7 @@ backtrace_command (const 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.13.6