From patchwork Tue Jul 25 17:20:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 21762 Received: (qmail 72413 invoked by alias); 25 Jul 2017 17:22:15 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 72342 invoked by uid 89); 25 Jul 2017 17:22:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.6 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: outbound-ss-1812.hostmonster.com Received: from gproxy1-pub.mail.unifiedlayer.com (HELO outbound-ss-1812.hostmonster.com) (69.89.25.95) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 25 Jul 2017 17:22:11 +0000 Received: from CMOut01 (cmgw2 [10.0.90.82]) by gproxy1.mail.unifiedlayer.com (Postfix) with ESMTP id 52928175BDE for ; Tue, 25 Jul 2017 11:21:22 -0600 (MDT) Received: from box522.bluehost.com ([74.220.219.122]) by CMOut01 with id p5MK1v00M2f2jeq015MNdh; Tue, 25 Jul 2017 11:21:22 -0600 X-Authority-Analysis: v=2.2 cv=INByMknG c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=G3gG6ho9WtcA:10 a=zstS-IiYAAAA:8 a=q-cAd0SmRYu9YAUpz-MA:9 a=4G6NA9xxw8l3yy4pmD5M:22 Received: from 174-29-39-24.hlrn.qwest.net ([174.29.39.24]:55470 helo=bapiya.Home) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1da3WJ-0015gW-69; Tue, 25 Jul 2017 11:21:19 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA v2 16/24] Remove in_user_command Date: Tue, 25 Jul 2017 11:20:59 -0600 Message-Id: <20170725172107.9799-17-tom@tromey.com> In-Reply-To: <20170725172107.9799-1-tom@tromey.com> References: <20170725172107.9799-1-tom@tromey.com> X-BWhitelist: no X-Exim-ID: 1da3WJ-0015gW-69 X-Source-Sender: 174-29-39-24.hlrn.qwest.net (bapiya.Home) [174.29.39.24]:55470 X-Source-Auth: tom+tromey.com X-Email-Count: 17 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-Local-Domain: yes While working on the next patch in this series, I found that the global in_user_command is not used. This patch removes it. (I didn't think to check Insight until submitting this series; and it's not very convenient to do so, so if someone has it checked out and could look at it, that would be nice.) ChangeLog 2017-07-25 Tom Tromey * top.h (in_user_command): Remove. * top.c (in_user_command): Remove. * cli/cli-script.c (do_restore_user_call_depth) (execute_user_command): Update. --- gdb/ChangeLog | 7 +++++++ gdb/cli/cli-script.c | 6 ------ gdb/top.c | 4 ---- gdb/top.h | 1 - 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2737008..8564f9f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,12 @@ 2017-07-25 Tom Tromey + * top.h (in_user_command): Remove. + * top.c (in_user_command): Remove. + * cli/cli-script.c (do_restore_user_call_depth) + (execute_user_command): Update. + +2017-07-25 Tom Tromey + * valops.c (search_struct_method): Use gdb::byte_vector. * valarith.c (value_concat): Use std::vector. * target.c (memory_xfer_partial): Use gdb::byte_vector. diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index a6d5456..527540a 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -379,8 +379,6 @@ do_restore_user_call_depth (void * call_depth) int *depth = (int *) call_depth; (*depth)--; - if ((*depth) == 0) - in_user_command = 0; } @@ -411,10 +409,6 @@ execute_user_command (struct cmd_list_element *c, char *args) make_cleanup (do_restore_instream_cleanup, ui->instream); ui->instream = NULL; - /* Also set the global in_user_command, so that NULL instream is - not confused with Insight. */ - in_user_command = 1; - scoped_restore save_async = make_scoped_restore (¤t_ui->async, 0); command_nest_depth++; diff --git a/gdb/top.c b/gdb/top.c index 2504eb6..43bf0d4 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -129,10 +129,6 @@ show_confirm (struct ui_file *file, int from_tty, value); } -/* Flag to indicate whether a user defined command is currently running. */ - -int in_user_command; - /* Current working directory. */ char *current_directory; diff --git a/gdb/top.h b/gdb/top.h index 452a381..5d7cb1f 100644 --- a/gdb/top.h +++ b/gdb/top.h @@ -218,7 +218,6 @@ extern void ui_unregister_input_event_handler (struct ui *ui); /* From top.c. */ extern char *saved_command_line; -extern int in_user_command; extern int confirm; extern char gdb_dirbuf[1024]; extern int inhibit_gdbinit;