static struct obstack dont_print_statmem_obstack;
static struct obstack dont_print_stat_array_obstack;
static struct obstack dont_print_statmem_obstack;
static struct obstack dont_print_stat_array_obstack;
static void cp_print_static_field (struct type *, struct value *,
struct ui_file *, int,
const struct value_print_options *);
static void cp_print_value (struct type *, struct type *,
static void cp_print_static_field (struct type *, struct value *,
struct ui_file *, int,
const struct value_print_options *);
static void cp_print_value (struct type *, struct type *,
const struct value_print_options *,
struct type **);
/* GCC versions after 2.4.5 use this. */
const struct value_print_options *,
struct type **);
/* GCC versions after 2.4.5 use this. */
const struct value_print_options *options,
struct type **dont_print_vb,
int dont_print_statmem)
const struct value_print_options *options,
struct type **dont_print_vb,
int dont_print_statmem)
offset, address, stream,
recurse + 1, val, options,
dont_print_vb);
offset, address, stream,
recurse + 1, val, options,
dont_print_vb);
vptr_fieldno = get_vptr_fieldno (type, &vptr_basetype);
for (i = n_baseclasses; i < len; i++)
{
vptr_fieldno = get_vptr_fieldno (type, &vptr_basetype);
for (i = n_baseclasses; i < len; i++)
{
/* If requested, skip printing of static fields. */
if (!options->static_field_print
&& field_is_static (&TYPE_FIELD (type, i)))
/* If requested, skip printing of static fields. */
if (!options->static_field_print
&& field_is_static (&TYPE_FIELD (type, i)))
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
fputs_filtered ("members of ", stream);
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
fputs_filtered ("members of ", stream);
offset + TYPE_FIELD_BITPOS (type, i) / 8,
address,
stream, recurse + 1, val, &opts,
offset + TYPE_FIELD_BITPOS (type, i) / 8,
address,
stream, recurse + 1, val, &opts,
if (obstack_final_size > statmem_obstack_initial_size)
{
/* In effect, a pop of the printed-statics stack. */
if (obstack_final_size > statmem_obstack_initial_size)
{
/* In effect, a pop of the printed-statics stack. */
-
- void *free_to_ptr =
- (char *) obstack_next_free (&dont_print_statmem_obstack) -
- (obstack_final_size - statmem_obstack_initial_size);
-
- obstack_free (&dont_print_statmem_obstack,
- free_to_ptr);
+ size_t shrink_bytes
+ = statmem_obstack_initial_size - obstack_final_size;
+ obstack_blank_fast (&dont_print_statmem_obstack, shrink_bytes);
const gdb_byte *valaddr, LONGEST offset,
CORE_ADDR address,
struct ui_file *stream, int recurse,
const gdb_byte *valaddr, LONGEST offset,
CORE_ADDR address,
struct ui_file *stream, int recurse,
const struct value_print_options *options,
struct type **dont_print_vb,
int dont_print_statmem)
const struct value_print_options *options,
struct type **dont_print_vb,
int dont_print_statmem)
- cp_print_value_fields (type, real_type, valaddr, offset,
+ cp_print_value_fields (type, real_type, offset,
address, stream, recurse, val, options,
dont_print_vb, dont_print_statmem);
}
address, stream, recurse, val, options,
dont_print_vb, dont_print_statmem);
}
const struct value_print_options *options,
struct type **dont_print_vb)
{
const struct value_print_options *options,
struct type **dont_print_vb)
{
int skip = 0;
struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
const char *basename = TYPE_NAME (baseclass);
int skip = 0;
struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
const char *basename = TYPE_NAME (baseclass);
- gdb_byte *buf;
- struct cleanup *back_to;
-
- buf = (gdb_byte *) xmalloc (TYPE_LENGTH (baseclass));
- back_to = make_cleanup (xfree, buf);
+ gdb::byte_vector buf (TYPE_LENGTH (baseclass));
TYPE_LENGTH (baseclass)) != 0)
skip = 1;
base_val = value_from_contents_and_address (baseclass,
TYPE_LENGTH (baseclass)) != 0)
skip = 1;
base_val = value_from_contents_and_address (baseclass,
- cp_print_value_fields (baseclass, thistype, base_valaddr,
+ cp_print_value_fields (baseclass, thistype,
thisoffset + boffset,
value_address (base_val),
stream, recurse, base_val, options,
thisoffset + boffset,
value_address (base_val),
stream, recurse, base_val, options,
addr = value_address (val);
obstack_grow (&dont_print_statmem_obstack, (char *) &addr,
sizeof (CORE_ADDR));
addr = value_address (val);
obstack_grow (&dont_print_statmem_obstack, (char *) &addr,
sizeof (CORE_ADDR));