Remove c_printstr
authorTom Tromey <tom@tromey.com>
Sat, 12 Feb 2022 01:14:17 +0000 (18:14 -0700)
committerTom Tromey <tom@tromey.com>
Mon, 10 Oct 2022 16:43:34 +0000 (10:43 -0600)
This renames c_printstr, removing a layer of indirection.

gdb/c-lang.c
gdb/c-lang.h
gdb/language.c
gdb/rust-lang.c

index d6c56f31616aa84ce7da66c74de8dd5c2d543dc5..437f79c025a83a37929db47529e1a1f765b3918c 100644 (file)
@@ -190,10 +190,10 @@ language_defn::printchar (int c, struct type *type,
    characters, or if FORCE_ELLIPSES.  */
 
 void
-c_printstr (struct ui_file *stream, struct type *type, 
-           const gdb_byte *string, unsigned int length, 
-           const char *user_encoding, int force_ellipses,
-           const struct value_print_options *options)
+language_defn::printstr (struct ui_file *stream, struct type *type,
+                        const gdb_byte *string, unsigned int length,
+                        const char *user_encoding, int force_ellipses,
+                        const struct value_print_options *options) const
 {
   c_string_type str_type;
   const char *type_encoding;
index b26996c20b1edc4d475eaaddebf5b1d5abc26e28..93515671d803f0aff5b49e8017ff19fc459d4b67 100644 (file)
@@ -93,14 +93,6 @@ extern void c_value_print (struct value *, struct ui_file *,
 
 extern void c_printchar (int, struct type *, struct ui_file *);
 
-extern void c_printstr (struct ui_file * stream,
-                       struct type *elttype,
-                       const gdb_byte *string,
-                       unsigned int length,
-                       const char *user_encoding,
-                       int force_ellipses,
-                       const struct value_print_options *options);
-
 extern void c_language_arch_info (struct gdbarch *gdbarch,
                                  struct language_arch_info *lai);
 
index 114ee3aedd99266f221fb110340cbbbea6ff4414..076e429ff556f7ef6c5dd4641fb9dbc8c5ea6885 100644 (file)
@@ -635,18 +635,6 @@ language_defn::value_print_inner
 
 /* See language.h.  */
 
-void
-language_defn::printstr (struct ui_file *stream, struct type *elttype,
-                        const gdb_byte *string, unsigned int length,
-                        const char *encoding, int force_ellipses,
-                        const struct value_print_options *options) const
-{
-  c_printstr (stream, elttype, string, length, encoding, force_ellipses,
-             options);
-}
-
-/* See language.h.  */
-
 void
 language_defn::print_typedef (struct type *type, struct symbol *new_symbol,
                              struct ui_file *stream) const
index 5539884a98f0db2e1118d1dc14078edef24b8705..8673a9086985c0d7324374b85274fd4fcf64e989 100644 (file)
@@ -292,8 +292,9 @@ rust_language::printstr (struct ui_file *stream, struct type *type,
        {
          /* This is probably some C string, so let's let C deal with
             it.  */
-         c_printstr (stream, type, string, length, user_encoding,
-                     force_ellipses, options);
+         language_defn::printstr (stream, type, string, length,
+                                  user_encoding, force_ellipses,
+                                  options);
          return;
        }
     }