gdb: remove LA_EMIT_CHAR macro

Now that every use of the LA_EMIT_CHAR macro is within a language_defn
member function we can simply call the emitchar member function
directly instead of using the LA_EMIT_CHAR macro.

If we are ever inside a language object, for example, cplus_language,
while current_language points at something other than cplus_language
then this commit will result in a change in behaviour.  However, I
believe if we did have such a difference then this would be a bug in
GDB.  AS such I'm going to claim there _should_ be no user visible
changes from this commit.

gdb/ChangeLog:

	* c-lang.c (language_defn::printchar): Call emitchar, not
	LA_EMIT_CHAR.
	* f-lang.h (f_language::printchar): Likewise.
	* language.h (LA_EMIT_CHAR): Delete macro.
	* rust-lang.c (rust_language::printchar): Call emitchar, not
	LA_EMIT_CHAR.
This commit is contained in:
Andrew Burgess 2020-10-20 13:41:18 +01:00
parent c5ee319e6c
commit 76ca72bc5b
5 changed files with 12 additions and 5 deletions

View file

@ -1,3 +1,12 @@
2020-12-23 Andrew Burgess <andrew.burgess@embecosm.com>
* c-lang.c (language_defn::printchar): Call emitchar, not
LA_EMIT_CHAR.
* f-lang.h (f_language::printchar): Likewise.
* language.h (LA_EMIT_CHAR): Delete macro.
* rust-lang.c (rust_language::printchar): Call emitchar, not
LA_EMIT_CHAR.
2020-12-23 Andrew Burgess <andrew.burgess@embecosm.com> 2020-12-23 Andrew Burgess <andrew.burgess@embecosm.com>
* c-lang.c (c_printchar): Rename to... * c-lang.c (c_printchar): Rename to...

View file

@ -178,7 +178,7 @@ language_defn::printchar (int c, struct type *type,
} }
fputc_filtered ('\'', stream); fputc_filtered ('\'', stream);
LA_EMIT_CHAR (c, type, stream, '\''); emitchar (c, type, stream, '\'');
fputc_filtered ('\'', stream); fputc_filtered ('\'', stream);
} }

View file

@ -155,7 +155,7 @@ public:
struct ui_file *stream) const override struct ui_file *stream) const override
{ {
fputs_filtered ("'", stream); fputs_filtered ("'", stream);
LA_EMIT_CHAR (ch, chtype, stream, '\''); emitchar (ch, chtype, stream, '\'');
fputs_filtered ("'", stream); fputs_filtered ("'", stream);
} }

View file

@ -775,8 +775,6 @@ extern enum language set_language (enum language);
#define LA_PRINT_STRING(stream, elttype, string, length, encoding, force_ellipses, options) \ #define LA_PRINT_STRING(stream, elttype, string, length, encoding, force_ellipses, options) \
(current_language->printstr (stream, elttype, string, length, \ (current_language->printstr (stream, elttype, string, length, \
encoding, force_ellipses,options)) encoding, force_ellipses,options))
#define LA_EMIT_CHAR(ch, type, stream, quoter) \
(current_language->emitchar (ch, type, stream, quoter))
/* Test a character to decide whether it can be printed in literal form /* Test a character to decide whether it can be printed in literal form
or needs to be printed in another representation. For example, or needs to be printed in another representation. For example,

View file

@ -2054,7 +2054,7 @@ public:
struct ui_file *stream) const override struct ui_file *stream) const override
{ {
fputs_filtered ("'", stream); fputs_filtered ("'", stream);
LA_EMIT_CHAR (ch, chtype, stream, '\''); emitchar (ch, chtype, stream, '\'');
fputs_filtered ("'", stream); fputs_filtered ("'", stream);
} }