/* Support for printing C++ values for GDB, the GNU debugger.
Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
- 2000, 2001, 2002
+ 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of GDB.
#include "c-lang.h"
#include "target.h"
#include "cp-abi.h"
-
-/* Indication of presence of HP-compiled object files */
-extern int hp_som_som_object_present; /* defined in symtab.c */
-
+#include "valprint.h"
int vtblprint; /* Controls printing of vtbl's */
int objectprint; /* Controls looking up an object's derived type
fprintf_filtered (stream, "<unknown>");
return;
}
- addr = unpack_pointer (lookup_pointer_type (builtin_type_void), valaddr);
+ addr = unpack_pointer (type, valaddr);
if (METHOD_PTR_IS_VIRTUAL (addr))
{
offset = METHOD_PTR_TO_VOFFSET (addr);
if (sym == 0)
{
/* 1997-08-01 Currently unsupported with HP aCC */
- if (hp_som_som_object_present)
+ if (deprecated_hp_som_som_object_present)
{
fputs_filtered ("?? <not supported with HP aCC>", stream);
return;
check_stub_method_group (domain, i);
for (j = 0; j < len2; j++)
{
- if (strcmp (SYMBOL_NAME (sym), TYPE_FN_FIELD_PHYSNAME (f, j))
+ if (strcmp (DEPRECATED_SYMBOL_NAME (sym), TYPE_FN_FIELD_PHYSNAME (f, j))
== 0)
goto common;
}
char *demangled_name;
fprintf_filtered (stream, "&");
- fprintf_filtered (stream, kind);
+ fputs_filtered (kind, stream);
demangled_name = cplus_demangle (TYPE_FN_FIELD_PHYSNAME (f, j),
DMGL_ANSI | DMGL_PARAMS);
if (demangled_name == NULL)
fprintf_filtered (stream, "<No data fields>");
else
{
- extern int inspect_it;
-
if (dont_print_statmem == 0)
{
/* If we're at top level, carve out a completely fresh
v = value_from_pointer (lookup_pointer_type (builtin_type_unsigned_long),
*(unsigned long *) (valaddr + offset));
- val_print (VALUE_TYPE (v), VALUE_CONTENTS (v), 0, 0,
+ val_print (value_type (v), VALUE_CONTENTS (v), 0, 0,
stream, format, 0, recurse + 1, pretty);
fields_seen = 1;
{
boffset = baseclass_offset (type, i,
valaddr + offset,
- address + offset);
+ address);
skip = ((boffset == -1) || (boffset + offset) < 0) ? 1 : -1;
if (BASETYPE_VIA_VIRTUAL (type, i))
{
/* FIXME (alloca): unsafe if baseclass is really really large. */
base_valaddr = (char *) alloca (TYPE_LENGTH (baseclass));
- if (target_read_memory (address + offset + boffset, base_valaddr,
+ if (target_read_memory (address + boffset, base_valaddr,
TYPE_LENGTH (baseclass)) != 0)
skip = 1;
+ address = address + boffset;
thisoffset = 0;
boffset = 0;
thistype = baseclass;
fprintf_filtered (stream, "<invalid address>");
else
cp_print_value_fields (baseclass, thistype, base_valaddr,
- thisoffset + boffset, address, stream, format,
+ thisoffset + boffset, address + boffset,
+ stream, format,
recurse, pretty,
((struct type **)
obstack_base (&dont_print_vb_obstack)),
print it. */
int extra = 0;
int bits = 0;
- register unsigned int i;
+ unsigned int i;
unsigned len = TYPE_NFIELDS (domain);
/* @@ Make VAL into bit offset */
if (i < len)
{
char *name;
- fprintf_filtered (stream, prefix);
+ fputs_filtered (prefix, stream);
name = type_name_no_tag (domain);
if (name)
fputs_filtered (name, stream);
/* adjust by offset */
vf->aligner.contents[0] += 4 * (HP_ACC_VFUNC_START + vx);
vf = value_ind (vf); /* get the entry */
- VALUE_TYPE (vf) = VALUE_TYPE (v); /* make it a pointer */
+ vf->type = value_type (v); /* make it a pointer */
/* print out the entry */
- val_print (VALUE_TYPE (vf), VALUE_CONTENTS (vf), 0, 0,
+ val_print (value_type (vf), VALUE_CONTENTS (vf), 0, 0,
stream, format, 0, recurse + 1, pretty);
field_physname
= TYPE_FN_FIELD_PHYSNAME (TYPE_FN_FIELDLIST1 (type, fn), oi);
void
_initialize_cp_valprint (void)
{
- add_show_from_set
+ deprecated_add_show_from_set
(add_set_cmd ("static-members", class_support, var_boolean,
(char *) &static_field_print,
"Set printing of C++ static members.",
/* Turn on printing of static fields. */
static_field_print = 1;
- add_show_from_set
+ deprecated_add_show_from_set
(add_set_cmd ("vtbl", class_support, var_boolean, (char *) &vtblprint,
"Set printing of C++ virtual function tables.",
&setprintlist),
&showprintlist);
- add_show_from_set
+ deprecated_add_show_from_set
(add_set_cmd ("object", class_support, var_boolean, (char *) &objectprint,
"Set printing of object's derived type based on vtable info.",
&setprintlist),