From: Tom Tromey Date: Sat, 22 Jan 2022 23:32:48 +0000 (-0700) Subject: Remove LA_PRINT_STRING X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=660da3c14b3b1815d6b3f1849a7225a10d819042;p=binutils-gdb.git Remove LA_PRINT_STRING This removes the LA_PRINT_STRING macro, in favor of using ordinary method calls. --- diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index 047e5687b0a..0d30700c06d 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -277,7 +277,7 @@ c_value_print_array (struct value *val, ++temp_len) ; - /* Force LA_PRINT_STRING to print ellipses if + /* Force printstr to print ellipses if we've printed the maximum characters and the next character is not \000. */ if (temp_len == options->print_max && temp_len < len) @@ -292,8 +292,8 @@ c_value_print_array (struct value *val, len = temp_len; } - LA_PRINT_STRING (stream, unresolved_elttype, valaddr, len, - NULL, force_ellipses, options); + current_language->printstr (stream, unresolved_elttype, valaddr, len, + NULL, force_ellipses, options); } else { diff --git a/gdb/language.h b/gdb/language.h index 4eb414bbe12..f2885000259 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -750,15 +750,6 @@ extern void language_info (); extern enum language set_language (enum language); -/* This page contains functions that return things that are - specific to languages. Each of these functions is based on - the current setting of working_lang, which the user sets - with the "set language" command. */ - -#define LA_PRINT_STRING(stream, elttype, string, length, encoding, force_ellipses, options) \ - (current_language->printstr (stream, elttype, string, length, \ - encoding, force_ellipses,options)) - /* Test a character to decide whether it can be printed in literal form or needs to be printed in another representation. For example, in C the literal form of the character with octal value 141 is 'a' diff --git a/gdb/valprint.c b/gdb/valprint.c index 07bc324be5d..d6ec64845f4 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -2767,10 +2767,9 @@ val_print_string (struct type *elttype, const char *encoding, But if we fetch something and then get an error, print the string and then the error message. */ if (err == 0 || bytes_read > 0) - { - LA_PRINT_STRING (stream, elttype, buffer.get (), bytes_read / width, - encoding, force_ellipsis, options); - } + current_language->printstr (stream, elttype, buffer.get (), + bytes_read / width, + encoding, force_ellipsis, options); if (err != 0) { diff --git a/gdb/varobj.c b/gdb/varobj.c index 80216a455e8..5617131da20 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -2232,8 +2232,8 @@ varobj_value_get_print_value (struct value *value, /* If the THEVALUE has contents, it is a regular string. */ if (!thevalue.empty ()) - LA_PRINT_STRING (&stb, type, (gdb_byte *) thevalue.c_str (), - len, encoding.get (), 0, &opts); + current_language->printstr (&stb, type, (gdb_byte *) thevalue.c_str (), + len, encoding.get (), 0, &opts); else if (string_print) /* Otherwise, if string_print is set, and it is not a regular string, it is a lazy string. */