#include "c-lang.h"
#include "typeprint.h"
#include <algorithm>
+#include "cli/cli-style.h"
static struct cp_abi_ops gnu_v3_abi_ops;
If we didn't like this approach, we could instead look in the
type_info object itself to get the class name. But this way
should work just as well, and doesn't read target memory. */
- vtable_symbol_name = MSYMBOL_DEMANGLED_NAME (vtable_symbol);
+ vtable_symbol_name = vtable_symbol->demangled_name ();
if (vtable_symbol_name == NULL
|| !startswith (vtable_symbol_name, "vtable for "))
{
/* If this architecture uses function descriptors directly in the vtable,
then the address of the vtable entry is actually a "function pointer"
(i.e. points to the descriptor). We don't need to scale the index
- by the size of a function descriptor; GCC does that before outputing
+ by the size of a function descriptor; GCC does that before outputting
debug information. */
if (gdbarch_vtable_function_descriptors (gdbarch))
vfn = value_addr (vfn);
{
struct gdbarch *gdbarch = get_type_arch (type);
int size = TYPE_LENGTH (builtin_type (gdbarch)->builtin_data_ptr);
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ enum bfd_endian byte_order = type_byte_order (type);
/* FIXME drow/2006-12-24: The adjustment of "this" is currently
always zero, since the method pointer is of the correct type.
}
catch (const gdb_exception_error &ex)
{
- printf_filtered (_("<error: %s>"), ex.what ());
+ fprintf_styled (gdb_stdout, metadata_style.style (),
+ _("<error: %s>"), ex.what ());
got_error = 1;
}
#define TYPEINFO_PREFIX "typeinfo for "
#define TYPEINFO_PREFIX_LEN (sizeof (TYPEINFO_PREFIX) - 1)
- symname = MSYMBOL_DEMANGLED_NAME (typeinfo_sym.minsym);
+ symname = typeinfo_sym.minsym->demangled_name ();
if (symname == NULL || strncmp (symname, TYPEINFO_PREFIX,
TYPEINFO_PREFIX_LEN))
error (_("typeinfo symbol '%s' has unexpected name"),
- MSYMBOL_LINKAGE_NAME (typeinfo_sym.minsym));
+ typeinfo_sym.minsym->linkage_name ());
class_name = symname + TYPEINFO_PREFIX_LEN;
/* Strip off @plt and version suffixes. */
/* The symbol's demangled name should be something like "virtual
thunk to FUNCTION", where FUNCTION is the name of the function
being thunked to. */
- thunk_name = MSYMBOL_DEMANGLED_NAME (thunk_sym.minsym);
+ thunk_name = thunk_sym.minsym->demangled_name ();
if (thunk_name == NULL || strstr (thunk_name, " thunk to ") == NULL)
return 0;