From patchwork Mon Oct 7 22:28:50 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: 34861 Received: (qmail 106608 invoked by alias); 7 Oct 2019 22:28:55 -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 106599 invoked by uid 89); 7 Oct 2019 22:28:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.5 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=warned X-HELO: mail-pg1-f201.google.com Received: from mail-pg1-f201.google.com (HELO mail-pg1-f201.google.com) (209.85.215.201) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 07 Oct 2019 22:28:53 +0000 Received: by mail-pg1-f201.google.com with SMTP id w13so11095904pge.15 for ; Mon, 07 Oct 2019 15:28:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc:content-transfer-encoding; bh=GL2iIH7kWOtArFU58izhIT45nn8WAuJJm6KgKTH2OmY=; b=Jx4WliJVVS2F2ZzhG4hEbpzaFDEt7vEzvxpeQLykSVxB1uXW9T3666vr28PC1THr++ 0EFXK6vwOffZJXJ7FQX9Vq1yNeMOrRfl9Nh1IZ9XFelhq7S6ouWfcrRw/MRufNZorvLz poTG2TBaaLw0C30O268yIvT2WLtn9trvZtglq55YJtP64YbmduVG3FKBroqDGU29lkjW nkEb6oekpFBdaXVbTs6m0uQE6VYppIVhRulaWXxU7U+OI9WH3T/BxJ4MZe8HP0sMO8Q8 avQlpucoLKY0OAOrPA8M++D3jgAnacgbyuEHHIK39qfzpse/AfctVI3jW2f+HLxhswU5 u51A== Date: Mon, 7 Oct 2019 17:28:50 -0500 In-Reply-To: Message-Id: <20191007222850.96797-1-cbiesinger@google.com> Mime-Version: 1.0 References: 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 Also makes it localizable. gdb/ChangeLog: 2019-10-07 Christian Biesinger * language.c (show_language_command): Pass lang_frame_mismatch_warn through _(). (lang_frame_mismatch_warn): Make const, mark with N_(), and move comment... * language.h (lang_frame_mismatch_warn): ... here. Also add declaration. * top.c (lang_frame_mismatch_warn): Remove declaration. (check_frame_language_change): Pass lang_frame_mismatch_warn through _(). --- gdb/language.c | 9 ++++----- gdb/language.h | 5 +++++ gdb/top.c | 4 +--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/gdb/language.c b/gdb/language.c index e95084f115..02c448fb1d 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -112,10 +112,9 @@ 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[] = -"Warning: the current language does not match this frame."; +/* See language.h. */ +const char lang_frame_mismatch_warn[] = +N_("Warning: the current language does not match this frame."); /* This page contains the functions corresponding to GDB commands and their helpers. */ @@ -147,7 +146,7 @@ show_language_command (struct ui_file *file, int from_tty, if (flang != language_unknown && language_mode == language_mode_manual && current_language->la_language != flang) - printf_filtered ("%s\n", lang_frame_mismatch_warn); + printf_filtered ("%s\n", _(lang_frame_mismatch_warn)); } } diff --git a/gdb/language.h b/gdb/language.h index 0088e5de2d..aa19f8ee9b 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 a1a08e0b99..78355a0315 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. */ @@ -492,7 +490,7 @@ check_frame_language_change (void) && flang != language_unknown && flang != current_language->la_language) { - printf_filtered ("%s\n", lang_frame_mismatch_warn); + printf_filtered ("%s\n", _(lang_frame_mismatch_warn)); warned = 1; } }