From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 94605 invoked by alias); 1 Oct 2019 13:28:27 -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 94557 invoked by uid 89); 1 Oct 2019 13:28:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mga03.intel.com Received: from mga03.intel.com (HELO mga03.intel.com) (134.134.136.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 01 Oct 2019 13:28:25 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Oct 2019 06:28:22 -0700 Received: from irsmsx109.ger.corp.intel.com ([163.33.3.23]) by fmsmga001.fm.intel.com with ESMTP; 01 Oct 2019 06:28:21 -0700 Received: from irsmsx112.ger.corp.intel.com (10.108.20.5) by IRSMSX109.ger.corp.intel.com (163.33.3.23) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 1 Oct 2019 14:28:21 +0100 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.36]) by irsmsx112.ger.corp.intel.com ([169.254.1.33]) with mapi id 14.03.0439.000; Tue, 1 Oct 2019 14:28:21 +0100 From: "Aktemur, Tankut Baris" To: Pedro Alves CC: "gdb-patches@sourceware.org" Subject: Re: [PATCH 07/23] Delete unnecessary code from kill_command Date: Tue, 01 Oct 2019 13:28:00 -0000 Message-ID: References: <20190906232807.6191-1-palves@redhat.com> <20190906232807.6191-8-palves@redhat.com> In-Reply-To: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Return-Path: tankut.ba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ct 01 13:31:33 2019 Return-Path: Delivered-To: listarch-gdb-patches@sources.redhat.com Received: (qmail 109783 invoked by alias); 1 Oct 2019 13:31:33 -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 Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 109775 invoked by uid 89); 1 Oct 2019 13:31:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.7 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.1 spammy=tasks, start-up X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 01 Oct 2019 13:31:31 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 75077117F75; Tue, 1 Oct 2019 09:31:29 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id eHQlo0LcTmtM; Tue, 1 Oct 2019 09:31:29 -0400 (EDT) Received: from murgatroyd.Home (75-166-72-156.hlrn.qwest.net [75.166.72.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 20CA0117AC8; Tue, 1 Oct 2019 09:31:29 -0400 (EDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Fix type of startup_with_shell in gdbserver Date: Tue, 01 Oct 2019 13:31:00 -0000 Message-Id: <20191001133127.4249-1-tromey@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SW-Source: 2019-10/txt/msg00010.txt.bz2 Content-length: 5761 startup_with_shell was changed to be of "bool" type, but I noticed that the definition in gdbserver disagreed. This disagreement caused some regressions on a big-endian machine. This patch removes the redundant declaration and definition of startup_with_shell and ensures that such clashes will be diagnosed. I didn't know the best place to put the declaration and definition. fork-inferior did not seem best, because it is conditionally compiled, so I chose a generic spot instead. gdb/ChangeLog 2019-10-01 Tom Tromey * gdbsupport/common-utils.c (startup_with_shell): Define. * infcmd.c (startup_with_shell): Don't define. * nat/fork-inferior.h (startup_with_shell): Don't declare. * gdbsupport/common-utils.h (startup_with_shell): Declare. * inferior.h (startup_with_shell): Don't declare. gdb/gdbserver/ChangeLog 2019-10-01 Tom Tromey * server.c (startup_with_shell): Don't define. --- gdb/ChangeLog | 8 ++++++++ gdb/gdbserver/ChangeLog | 4 ++++ gdb/gdbserver/server.c | 6 ------ gdb/gdbsupport/common-utils.c | 4 ++++ gdb/gdbsupport/common-utils.h | 20 ++++++++++++++++++++ gdb/infcmd.c | 4 ---- gdb/inferior.h | 19 ------------------- gdb/nat/fork-inferior.h | 20 -------------------- 8 files changed, 36 insertions(+), 49 deletions(-) diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index 67e8e3e54de..8ee551828dc 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -67,12 +67,6 @@ char *current_directory; static gdb_environ our_environ; -/* Start the inferior using a shell. */ - -/* We always try to start the inferior using a shell. */ - -int startup_with_shell = 1; - int server_waiting; static int extended_protocol; diff --git a/gdb/gdbsupport/common-utils.c b/gdb/gdbsupport/common-utils.c index d1059de0b33..030539fa85e 100644 --- a/gdb/gdbsupport/common-utils.c +++ b/gdb/gdbsupport/common-utils.c @@ -22,6 +22,10 @@ #include "host-defs.h" #include +/* See common-utils.h. */ + +bool startup_with_shell = true; + void * xzalloc (size_t size) { diff --git a/gdb/gdbsupport/common-utils.h b/gdb/gdbsupport/common-utils.h index a5312cb0c49..df8455fbf0b 100644 --- a/gdb/gdbsupport/common-utils.h +++ b/gdb/gdbsupport/common-utils.h @@ -188,4 +188,24 @@ in_inclusive_range (T value, T low, T high) extern ULONGEST align_up (ULONGEST v, int n); extern ULONGEST align_down (ULONGEST v, int n); +/* Whether to start up the debuggee under a shell. + + If startup-with-shell is set, GDB's "run" will attempt to start up + the debuggee under a shell. This also happens when using GDBserver + under extended remote mode. + + This is in order for argument-expansion to occur. E.g., + + (gdb) run * + + The "*" gets expanded by the shell into a list of files. + + While this is a nice feature, it may be handy to bypass the shell + in some cases. To disable this feature, do "set startup-with-shell + false". + + The catch-exec traps expected during start-up will be one more if + the target is started up with a shell. */ +extern bool startup_with_shell; + #endif /* COMMON_COMMON_UTILS_H */ diff --git a/gdb/infcmd.c b/gdb/infcmd.c index dc82ef043fe..4d42f75b63a 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -103,10 +103,6 @@ enum stop_stack_kind stop_stack_dummy; int stopped_by_random_signal; -/* See inferior.h. */ - -bool startup_with_shell = true; - /* Accessor routines. */ diff --git a/gdb/inferior.h b/gdb/inferior.h index 3a64a7cfeae..43f0417e629 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -227,25 +227,6 @@ extern struct value *get_return_value (struct value *function, extern void prepare_execution_command (struct target_ops *target, int background); -/* Whether to start up the debuggee under a shell. - - If startup-with-shell is set, GDB's "run" will attempt to start up - the debuggee under a shell. - - This is in order for argument-expansion to occur. E.g., - - (gdb) run * - - The "*" gets expanded by the shell into a list of files. - - While this is a nice feature, it may be handy to bypass the shell - in some cases. To disable this feature, do "set startup-with-shell - false". - - The catch-exec traps expected during start-up will be one more if - the target is started up with a shell. */ -extern bool startup_with_shell; - /* Nonzero if stopped due to completion of a stack dummy routine. */ extern enum stop_stack_kind stop_stack_dummy; diff --git a/gdb/nat/fork-inferior.h b/gdb/nat/fork-inferior.h index 065496c3827..0a76ff82d31 100644 --- a/gdb/nat/fork-inferior.h +++ b/gdb/nat/fork-inferior.h @@ -54,26 +54,6 @@ extern ptid_t startup_inferior (pid_t pid, int ntraps, struct target_waitstatus *mystatus, ptid_t *myptid); -/* Whether to start up the debuggee under a shell. - - If startup-with-shell is set, GDB's "run" will attempt to start up - the debuggee under a shell. This also happens when using GDBserver - under extended remote mode. - - This is in order for argument-expansion to occur. E.g., - - (gdb) run * - - The "*" gets expanded by the shell into a list of files. - - While this is a nice feature, it may be handy to bypass the shell - in some cases. To disable this feature, do "set startup-with-shell - false". - - The catch-exec traps expected during start-up will be one more if - the target is started up with a shell. */ -extern bool startup_with_shell; - /* Perform any necessary tasks before a fork/vfork takes place. ARGS is a string containing all the arguments received by the inferior. This function is mainly used by fork_inferior. */ -- 2.20.1