+2017-09-29 Tom Tromey <tom@tromey.com>
+
+ * xstormy16-tdep.c (xstormy16_push_dummy_call): Use
+ gdb::byte_vector.
+
2017-09-29 Tom Tromey <tom@tromey.com>
* complaints.c (vcomplaint): Use std::string.
#include "doublest.h"
#include "osabi.h"
#include "objfiles.h"
+#include "common/byte-vector.h"
enum gdb_regnum
{
wordaligned. */
for (j = nargs - 1; j >= i; j--)
{
- gdb_byte *val;
- struct cleanup *back_to;
const gdb_byte *bytes = value_contents (args[j]);
typelen = TYPE_LENGTH (value_enclosing_type (args[j]));
slacklen = typelen & 1;
- val = (gdb_byte *) xmalloc (typelen + slacklen);
- back_to = make_cleanup (xfree, val);
- memcpy (val, bytes, typelen);
- memset (val + typelen, 0, slacklen);
+ gdb::byte_vector val (typelen + slacklen);
+ memcpy (val.data (), bytes, typelen);
+ memset (val.data () + typelen, 0, slacklen);
/* Now write this data to the stack. The stack grows upwards. */
- write_memory (stack_dest, val, typelen + slacklen);
+ write_memory (stack_dest, val.data (), typelen + slacklen);
stack_dest += typelen + slacklen;
- do_cleanups (back_to);
}
store_unsigned_integer (buf, xstormy16_pc_size, byte_order, bp_addr);