From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@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, 07 Oct 2019 22:28:00 -0000 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. From: "Christian Biesinger via gdb-patches" Reply-To: Christian Biesinger To: gdb-patches@sourceware.org Cc: Christian Biesinger Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2019-10/txt/msg00210.txt.bz2 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; =20 -/* Warning issued when current_language and the language of the current - frame do not match. */ -char lang_frame_mismatch_warn[] =3D -"Warning: the current language does not match this frame."; +/* See language.h. */ +const char lang_frame_mismatch_warn[] =3D +N_("Warning: the current language does not match this frame."); =0C /* 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_t= ty, if (flang !=3D language_unknown && language_mode =3D=3D language_mode_manual && current_language->la_language !=3D flang) - printf_filtered ("%s\n", lang_frame_mismatch_warn); + printf_filtered ("%s\n", _(lang_frame_mismatch_warn)); } } =20 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; =20 extern const struct language_defn *expected_language; =20 +/* Warning issued when current_language and the language of the current + frame do not match. */ + +extern const char lang_frame_mismatch_warn[]; + /* language_mode =3D=3D=20 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) =20 int inhibit_gdbinit =3D 0; =20 -extern char lang_frame_mismatch_warn[]; /* language.c */ - /* Flag for whether we want to confirm potentially dangerous operations. Default is yes. */ =20 @@ -492,7 +490,7 @@ check_frame_language_change (void) && flang !=3D language_unknown && flang !=3D current_language->la_language) { - printf_filtered ("%s\n", lang_frame_mismatch_warn); + printf_filtered ("%s\n", _(lang_frame_mismatch_warn)); warned =3D 1; } } --=20 2.23.0.581.g78d2f28ef7-goog