This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 5/11] Add M32R_MAX_REGISTER_SIZE
- From: Alan Hayward <Alan dot Hayward at arm dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Cc: nd <nd at arm dot com>
- Date: Tue, 4 Apr 2017 10:13:37 +0000
- Subject: [PATCH 5/11] Add M32R_MAX_REGISTER_SIZE
- Authentication-results: sourceware.org; auth=none
- Authentication-results: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com;
- Nodisclaimer: True
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Max size set to 32bits, which I determined using regformats/reg-m32r.dat
Tested on a --enable-targets=all build using make check with board files
unix and native-gdbserver.
I do not have an M32R machine to test on.
Ok to commit?
Alan.
2017-04-04 Alan Hayward <alan.hayward@arm.com>
* m32r-tdep.c (m32r_push_dummy_call): Use M32R_MAX_REGISTER_SIZE.
* m32r-tdep.h (M32R_MAX_REGISTER_SIZE): Add.
diff --git a/gdb/m32r-tdep.h b/gdb/m32r-tdep.h
index 102cccecd200b7c192ade124a2fb9d9c59bdb5dd..037fd8965a7c01bd8c3ec0d1eb4a49a70d4478e6 100644
--- a/gdb/m32r-tdep.h
+++ b/gdb/m32r-tdep.h
@@ -47,4 +47,7 @@ enum m32r_regnum
#define M32R_NUM_REGS 25
+/* Big enough to hold the size of the largest register in bytes. */
+#define M32R_MAX_REGISTER_SIZE 4
+
#endif /* m32r-tdep.h */
diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c
index 40f29d343b91f254cce2dd783553795c9c990eff..cb53a352b2d47068ad7cd5dacd3325d66bd77964 100644
--- a/gdb/m32r-tdep.c
+++ b/gdb/m32r-tdep.c
@@ -677,7 +677,7 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
enum type_code typecode;
CORE_ADDR regval;
gdb_byte *val;
- gdb_byte valbuf[MAX_REGISTER_SIZE];
+ gdb_byte valbuf[M32R_MAX_REGISTER_SIZE];
int len;
/* First force sp to a 4-byte alignment. */