Browse Source

Remove LA_PRINT_TYPE

This removes the LA_PRINT_TYPE macro, in favor of using ordinary
method calls.
gdb-12-branch
Tom Tromey 4 years ago
parent
commit
13eb081a83
  1. 3
      gdb/guile/scm-type.c
  2. 3
      gdb/language.h
  3. 5
      gdb/python/py-type.c
  4. 18
      gdb/symmisc.c
  5. 5
      gdb/typeprint.c

3
gdb/guile/scm-type.c

@ -108,7 +108,8 @@ tyscm_type_name (struct type *type)
{
string_file stb;
LA_PRINT_TYPE (type, "", &stb, -1, 0, &type_print_raw_options);
current_language->print_type (type, "", &stb, -1, 0,
&type_print_raw_options);
return stb.release ();
}
catch (const gdb_exception &except)

3
gdb/language.h

@ -755,9 +755,6 @@ extern enum language set_language (enum language);
the current setting of working_lang, which the user sets
with the "set language" command. */
#define LA_PRINT_TYPE(type,varstring,stream,show,level,flags) \
(current_language->print_type(type,varstring,stream,show,level,flags))
#define LA_PRINT_CHAR(ch, type, stream) \
(current_language->printchar (ch, type, stream))
#define LA_PRINT_STRING(stream, elttype, string, length, encoding, force_ellipses, options) \

5
gdb/python/py-type.c

@ -1025,8 +1025,9 @@ typy_str (PyObject *self)
try
{
LA_PRINT_TYPE (type_object_to_type (self), "", &thetype, -1, 0,
&type_print_raw_options);
current_language->print_type (type_object_to_type (self), "",
&thetype, -1, 0,
&type_print_raw_options);
}
catch (const gdb_exception &except)
{

18
gdb/symmisc.c

@ -525,8 +525,8 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
{
if (symbol->type ()->name ())
{
LA_PRINT_TYPE (symbol->type (), "", outfile, 1, depth,
&type_print_raw_options);
current_language->print_type (symbol->type (), "", outfile, 1, depth,
&type_print_raw_options);
}
else
{
@ -536,8 +536,8 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
: (symbol->type ()->code () == TYPE_CODE_STRUCT
? "struct" : "union")),
symbol->linkage_name ());
LA_PRINT_TYPE (symbol->type (), "", outfile, 1, depth,
&type_print_raw_options);
current_language->print_type (symbol->type (), "", outfile, 1, depth,
&type_print_raw_options);
}
fprintf_filtered (outfile, ";\n");
}
@ -548,11 +548,11 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
if (symbol->type ())
{
/* Print details of types, except for enums where it's clutter. */
LA_PRINT_TYPE (symbol->type (), symbol->print_name (),
outfile,
symbol->type ()->code () != TYPE_CODE_ENUM,
depth,
&type_print_raw_options);
current_language->print_type (symbol->type (), symbol->print_name (),
outfile,
symbol->type ()->code () != TYPE_CODE_ENUM,
depth,
&type_print_raw_options);
fprintf_filtered (outfile, "; ");
}
else

5
gdb/typeprint.c

@ -392,7 +392,8 @@ void
type_print (struct type *type, const char *varstring, struct ui_file *stream,
int show)
{
LA_PRINT_TYPE (type, varstring, stream, show, 0, &default_ptype_flags);
current_language->print_type (type, varstring, stream, show, 0,
&default_ptype_flags);
}
/* Print TYPE to a string, returning it. The caller is responsible for
@ -578,7 +579,7 @@ whatis_exp (const char *exp, int show)
printf_filtered (" */\n");
}
LA_PRINT_TYPE (type, "", gdb_stdout, show, 0, &flags);
current_language->print_type (type, "", gdb_stdout, show, 0, &flags);
printf_filtered ("\n");
}

Loading…
Cancel
Save