+2017-09-09 Tom Tromey <tom@tromey.com>
+
+ * p-valprint.c (pascal_object_print_value): Use gdb::byte_vector.
+
2017-09-09 Tom Tromey <tom@tromey.com>
* stack.c (func_command): Use gdb::def_vector.
#include "cp-abi.h"
#include "cp-support.h"
#include "objfiles.h"
+#include "common/byte-vector.h"
\f
/* Decorations for Pascal. */
const gdb_byte *base_valaddr = NULL;
LONGEST thisoffset;
int skip = 0;
+ gdb::byte_vector buf;
if (BASETYPE_VIA_VIRTUAL (type, i))
{
if (boffset < 0 || boffset >= TYPE_LENGTH (type))
{
- gdb_byte *buf;
- struct cleanup *back_to;
+ buf.resize (TYPE_LENGTH (baseclass));
- buf = (gdb_byte *) xmalloc (TYPE_LENGTH (baseclass));
- back_to = make_cleanup (xfree, buf);
-
- base_valaddr = buf;
- if (target_read_memory (address + boffset, buf,
+ base_valaddr = buf.data ();
+ if (target_read_memory (address + boffset, buf.data (),
TYPE_LENGTH (baseclass)) != 0)
skip = 1;
address = address + boffset;
thisoffset = 0;
boffset = 0;
- do_cleanups (back_to);
}
else
base_valaddr = valaddr;