From patchwork Wed May 1 18:44:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 32478 Received: (qmail 49448 invoked by alias); 1 May 2019 18:44:07 -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 49418 invoked by uid 89); 1 May 2019 18:44:07 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.0 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=Declare, HContent-Transfer-Encoding:8bit 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; Wed, 01 May 2019 18:44:06 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id C143C117515; Wed, 1 May 2019 14:44:04 -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 ax+rRDsl0Fdx; Wed, 1 May 2019 14:44:04 -0400 (EDT) Received: from murgatroyd.Home (97-122-168-123.hlrn.qwest.net [97.122.168.123]) (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 6DF001173B3; Wed, 1 May 2019 14:44:04 -0400 (EDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 2/4] Move interpreter_p declaration to main.h Date: Wed, 1 May 2019 12:44:00 -0600 Message-Id: <20190501184402.4030-3-tromey@adacore.com> In-Reply-To: <20190501184402.4030-1-tromey@adacore.com> References: <20190501184402.4030-1-tromey@adacore.com> MIME-Version: 1.0 This moves the interpreter_p declaration from defs.h to main.h. I think this makes more sense, as it is defined in main.c. Also, this declaration was in the wrong place -- between a comment and the things the comment described. gdb/ChangeLog 2019-05-01 Tom Tromey * tui/tui-interp.c: Include main.h. * interps.c: Include main.h. * main.h (interpreter_p): Declare. * defs.h (interpreter_p): Don't declare. --- gdb/ChangeLog | 7 +++++++ gdb/defs.h | 3 --- gdb/interps.c | 1 + gdb/main.h | 3 +++ gdb/tui/tui-interp.c | 1 + 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gdb/defs.h b/gdb/defs.h index 673a200d5d0..5a1995b4991 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -584,9 +584,6 @@ extern int watchdog; /* Hooks for alternate command interfaces. */ -/* * The name of the interpreter if specified on the command line. */ -extern char *interpreter_p; - struct target_waitstatus; struct cmd_list_element; diff --git a/gdb/interps.c b/gdb/interps.c index b62e33339a2..dfd6eb90655 100644 --- a/gdb/interps.c +++ b/gdb/interps.c @@ -38,6 +38,7 @@ #include "completer.h" #include "top.h" /* For command_loop. */ #include "continuations.h" +#include "main.h" /* Each UI has its own independent set of interpreters. */ diff --git a/gdb/main.h b/gdb/main.h index e707bf33efb..e44779a0560 100644 --- a/gdb/main.h +++ b/gdb/main.h @@ -35,6 +35,9 @@ extern int return_child_result_value; extern int batch_silent; extern int batch_flag; +/* * The name of the interpreter if specified on the command line. */ +extern char *interpreter_p; + /* From mingw-hdep.c, used by main.c. */ /* Return argv[0] in absolute form, if possible, or ARGV0 if not. The diff --git a/gdb/tui/tui-interp.c b/gdb/tui/tui-interp.c index 14215b83dea..d1146fed0e6 100644 --- a/gdb/tui/tui-interp.c +++ b/gdb/tui/tui-interp.c @@ -34,6 +34,7 @@ #include "observable.h" #include "gdbthread.h" #include "inferior.h" +#include "main.h" /* Set to 1 when the TUI mode must be activated when we first start gdb. */