Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Unified Diff: gdb/mt-tdep.c

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/msp430-tdep.c ('k') | gdb/nat/linux-nat.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/mt-tdep.c
diff --git a/gdb/mt-tdep.c b/gdb/mt-tdep.c
index ee4b6eb5d4b6b78b927663022f76dba001000995..c45d0ed87983b48c3b173329b90ddd43506d53ff 100644
--- a/gdb/mt-tdep.c
+++ b/gdb/mt-tdep.c
@@ -1,6 +1,6 @@
/* Target-dependent code for Morpho mt processor, for GDB.
- Copyright (C) 2005, 2007-2012 Free Software Foundation, Inc.
+ Copyright (C) 2005-2013 Free Software Foundation, Inc.
This file is part of GDB.
@@ -27,7 +27,7 @@
#include "dis-asm.h"
#include "arch-utils.h"
#include "gdbtypes.h"
-#include "gdb_string.h"
+#include <string.h>
#include "regcache.h"
#include "reggroups.h"
#include "gdbcore.h"
@@ -685,7 +685,7 @@ mt_registers_info (struct gdbarch *gdbarch,
buff = alloca (regsize);
bytes = alloca (regsize * sizeof (*bytes));
- frame_register_read (frame, regnum, buff);
+ deprecated_frame_register_read (frame, regnum, buff);
fputs_filtered (gdbarch_register_name
(gdbarch, regnum), file);
@@ -710,7 +710,7 @@ mt_registers_info (struct gdbarch *gdbarch,
struct value_print_options opts;
buf = alloca (register_size (gdbarch, MT_COPRO_REGNUM));
- frame_register_read (frame, MT_COPRO_REGNUM, buf);
+ deprecated_frame_register_read (frame, MT_COPRO_REGNUM, buf);
/* And print. */
regnum = MT_COPRO_PSEUDOREG_REGNUM;
fputs_filtered (gdbarch_register_name (gdbarch, regnum),
@@ -718,7 +718,7 @@ mt_registers_info (struct gdbarch *gdbarch,
print_spaces_filtered (15 - strlen (gdbarch_register_name
(gdbarch, regnum)),
file);
- get_raw_print_options (&opts);
+ get_no_prettyformat_print_options (&opts);
opts.deref_ref = 1;
val_print (register_type (gdbarch, regnum), buf,
0, 0, file, 0, NULL,
@@ -731,13 +731,13 @@ mt_registers_info (struct gdbarch *gdbarch,
gdb_byte buf[3 * sizeof (LONGEST)];
/* Get the two "real" mac registers. */
- frame_register_read (frame, MT_MAC_REGNUM, buf);
+ deprecated_frame_register_read (frame, MT_MAC_REGNUM, buf);
oldmac = extract_unsigned_integer
(buf, register_size (gdbarch, MT_MAC_REGNUM), byte_order);
if (gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_mrisc2
|| gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_ms2)
{
- frame_register_read (frame, MT_EXMAC_REGNUM, buf);
+ deprecated_frame_register_read (frame, MT_EXMAC_REGNUM, buf);
ext_mac = extract_unsigned_integer
(buf, register_size (gdbarch, MT_EXMAC_REGNUM), byte_order);
}
@@ -845,16 +845,20 @@ mt_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
for (j = nargs - 1; j >= i; j--)
{
gdb_byte *val;
+ struct cleanup *back_to;
+ const gdb_byte *contents = value_contents (args[j]);
/* Right-justify the value in an aligned-length buffer. */
typelen = TYPE_LENGTH (value_type (args[j]));
slacklen = (wordsize - (typelen % wordsize)) % wordsize;
- val = alloca (typelen + slacklen);
- memcpy (val, value_contents (args[j]), typelen);
+ val = xmalloc (typelen + slacklen);
+ back_to = make_cleanup (xfree, val);
+ memcpy (val, contents, typelen);
memset (val + typelen, 0, slacklen);
/* Now write this data to the stack. */
stack_dest -= typelen + slacklen;
write_memory (stack_dest, val, typelen + slacklen);
+ do_cleanups (back_to);
}
/* Finally, if a param needs to be split between registers and stack,
« no previous file with comments | « gdb/msp430-tdep.c ('k') | gdb/nat/linux-nat.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698