Move declaration of lang_frame_mismatch_warn to header.
authorChristian Biesinger <cbiesinger@google.com>
Mon, 7 Oct 2019 17:55:44 +0000 (12:55 -0500)
committerChristian Biesinger <cbiesinger@google.com>
Tue, 8 Oct 2019 15:14:57 +0000 (10:14 -0500)
Also makes it localizable.

gdb/ChangeLog:

2019-10-08  Christian Biesinger  <cbiesinger@google.com>

* 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/ChangeLog
gdb/language.c
gdb/language.h
gdb/top.c

index 3912429dcf39b452e275c775102b978cd5c3a8ca..20a001e370b448ec1e1056df1d19c22acb6a1c0c 100644 (file)
@@ -1,3 +1,15 @@
+2019-10-08  Christian Biesinger  <cbiesinger@google.com>
+
+       * 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 _().
+
 2019-10-07  Christian Biesinger  <cbiesinger@google.com>
 
        * c-lang.h (vtbl_ptr_name): Declare.
index e95084f1154ef11eafe927c44b8e883fcf630c61..02c448fb1d8e8fc48d35aa6e433fbf1b1458d4dd 100644 (file)
@@ -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.");
 \f
 /* 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));
     }
 }
 
index 0088e5de2dd698ae050768f13dbf3f2bb11843fb..aa19f8ee9b4b97199eacdc38d7bbba3f69a8277f 100644 (file)
@@ -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)
index a1a08e0b99ec1b9e3a6d717a47165dd95e6b1ce0..78355a0315fb426120cb7770411cb4ab0808e56e 100644 (file)
--- 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;
        }
     }
This page took 0.033616 seconds and 4 git commands to generate.