From patchwork Mon Oct 7 17:57:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Terekhov, Mikhail via Gdb-patches" X-Patchwork-Id: 34852 Received: (qmail 33864 invoked by alias); 7 Oct 2019 17:57:40 -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 33856 invoked by uid 89); 7 Oct 2019 17:57:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.4 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=dangerous, HX-HELO:sk:mail-yw, H*MI:google X-HELO: mail-yw1-f74.google.com Received: from mail-yw1-f74.google.com (HELO mail-yw1-f74.google.com) (209.85.161.74) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 07 Oct 2019 17:57:38 +0000 Received: by mail-yw1-f74.google.com with SMTP id n3so13243311ywh.11 for ; Mon, 07 Oct 2019 10:57:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc :content-transfer-encoding; bh=t1Ozy4fr6eGWGlopT6xeziHs0udYjKBVzWOqpS/2fhg=; b=Wf8HLSqqjWzkopfQIcMplKYafpPOh7HYMX3IS6FxSE7i6cjsQnqGRH2RS9C/yx2DkF qVDY9/i7JDj+l2EB6GwsrN6R+ePh359kU72ZAyInuKkJX9276cmbtFmw9SVWD1nN91lL GX5ZlzKYzfgLAjEm/VHHDKMFMN+xsFP3aynygMXq0EZZwrdbP3gQ1+HPsG5l+1QlHim6 9/GCU1lY06aWTv557XCnXusQ2VSN6w/5pp84nCp2EubjeBxphjWloy4qm01kKeW11W37 uoltNTeHZJA0aX9ft7JQxjvcd/Eg8aH/mvqSvZbzByg/9a5VIKLqp9fRrbIAwIbA8UVN mk6Q== Date: Mon, 7 Oct 2019 12:57:34 -0500 Message-Id: <20191007175734.257671-1-cbiesinger@google.com> Mime-Version: 1.0 Subject: [PATCH] Move declaration of lang_frame_mismatch_warn to header. X-Patchwork-Original-From: "Christian Biesinger via gdb-patches" From: "Terekhov, Mikhail via Gdb-patches" Reply-To: Christian Biesinger To: gdb-patches@sourceware.org Cc: Christian Biesinger X-IsSubscribed: yes gdb/ChangeLog: 2019-10-07 Christian Biesinger * language.c (lang_frame_mismatch_warn): Make const and move comment... * language.h (lang_frame_mismatch_warn): ... here. Also add declaration. * top.c (lang_frame_mismatch_warn): Remove declaration. --- gdb/language.c | 5 ++--- gdb/language.h | 5 +++++ gdb/top.c | 2 -- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gdb/language.c b/gdb/language.c index e95084f1154..2bebc05a1f3 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -112,9 +112,8 @@ static const char *language; static const char *range; static const char *case_sensitive; -/* Warning issued when current_language and the language of the current - frame do not match. */ -char lang_frame_mismatch_warn[] = +/* See language.h. */ +const char lang_frame_mismatch_warn[] = "Warning: the current language does not match this frame."; /* This page contains the functions corresponding to GDB commands diff --git a/gdb/language.h b/gdb/language.h index 0088e5de2dd..aa19f8ee9b4 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -483,6 +483,11 @@ extern const struct language_defn *current_language; extern const struct language_defn *expected_language; +/* Warning issued when current_language and the language of the current + frame do not match. */ + +extern const char lang_frame_mismatch_warn[]; + /* language_mode == language_mode_auto: current_language automatically set upon selection of scope (e.g. stack frame) diff --git a/gdb/top.c b/gdb/top.c index a1a08e0b99e..0c1a213e9d5 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -110,8 +110,6 @@ gen_ret_current_ui_field_ptr (struct ui_out *, current_uiout) int inhibit_gdbinit = 0; -extern char lang_frame_mismatch_warn[]; /* language.c */ - /* Flag for whether we want to confirm potentially dangerous operations. Default is yes. */