mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-28 15:18:37 +08:00
Add MN10300_MAX_REGISTER_SIZE
gdb/ * mn10300-tdep.c (MN10300_MAX_REGISTER_SIZE): Add. (mn10300_extract_return_value): Use MN10300_MAX_REGISTER_SIZE. (mn10300_push_dummy_call): Likewise.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2017-06-08 Alan Hayward <alan.hayward@arm.com>
|
||||||
|
|
||||||
|
* mn10300-tdep.c (MN10300_MAX_REGISTER_SIZE): Add.
|
||||||
|
(mn10300_extract_return_value): Use MN10300_MAX_REGISTER_SIZE.
|
||||||
|
(mn10300_push_dummy_call): Likewise.
|
||||||
|
|
||||||
2017-06-08 Alan Hayward <alan.hayward@arm.com>
|
2017-06-08 Alan Hayward <alan.hayward@arm.com>
|
||||||
|
|
||||||
* mi/mi-main.c (register_changed_p): Use value_contents_eq.
|
* mi/mi-main.c (register_changed_p): Use value_contents_eq.
|
||||||
|
@ -40,6 +40,9 @@
|
|||||||
/* The am33-2 has 64 registers. */
|
/* The am33-2 has 64 registers. */
|
||||||
#define MN10300_MAX_NUM_REGS 64
|
#define MN10300_MAX_NUM_REGS 64
|
||||||
|
|
||||||
|
/* Big enough to hold the size of the largest register in bytes. */
|
||||||
|
#define MN10300_MAX_REGISTER_SIZE 64
|
||||||
|
|
||||||
/* This structure holds the results of a prologue analysis. */
|
/* This structure holds the results of a prologue analysis. */
|
||||||
struct mn10300_prologue
|
struct mn10300_prologue
|
||||||
{
|
{
|
||||||
@ -196,7 +199,7 @@ static void
|
|||||||
mn10300_extract_return_value (struct gdbarch *gdbarch, struct type *type,
|
mn10300_extract_return_value (struct gdbarch *gdbarch, struct type *type,
|
||||||
struct regcache *regcache, void *valbuf)
|
struct regcache *regcache, void *valbuf)
|
||||||
{
|
{
|
||||||
gdb_byte buf[MAX_REGISTER_SIZE];
|
gdb_byte buf[MN10300_MAX_REGISTER_SIZE];
|
||||||
int len = TYPE_LENGTH (type);
|
int len = TYPE_LENGTH (type);
|
||||||
int reg, regsz;
|
int reg, regsz;
|
||||||
|
|
||||||
@ -206,6 +209,7 @@ mn10300_extract_return_value (struct gdbarch *gdbarch, struct type *type,
|
|||||||
reg = 0;
|
reg = 0;
|
||||||
|
|
||||||
regsz = register_size (gdbarch, reg);
|
regsz = register_size (gdbarch, reg);
|
||||||
|
gdb_assert (regsz <= MN10300_MAX_REGISTER_SIZE);
|
||||||
if (len <= regsz)
|
if (len <= regsz)
|
||||||
{
|
{
|
||||||
regcache_raw_read (regcache, reg, buf);
|
regcache_raw_read (regcache, reg, buf);
|
||||||
@ -1224,7 +1228,7 @@ mn10300_push_dummy_call (struct gdbarch *gdbarch,
|
|||||||
int stack_offset = 0;
|
int stack_offset = 0;
|
||||||
int argnum;
|
int argnum;
|
||||||
const gdb_byte *val;
|
const gdb_byte *val;
|
||||||
gdb_byte valbuf[MAX_REGISTER_SIZE];
|
gdb_byte valbuf[MN10300_MAX_REGISTER_SIZE];
|
||||||
|
|
||||||
/* This should be a nop, but align the stack just in case something
|
/* This should be a nop, but align the stack just in case something
|
||||||
went wrong. Stacks are four byte aligned on the mn10300. */
|
went wrong. Stacks are four byte aligned on the mn10300. */
|
||||||
@ -1266,6 +1270,7 @@ mn10300_push_dummy_call (struct gdbarch *gdbarch,
|
|||||||
{
|
{
|
||||||
/* Change to pointer-to-type. */
|
/* Change to pointer-to-type. */
|
||||||
arg_len = push_size;
|
arg_len = push_size;
|
||||||
|
gdb_assert (push_size <= MN10300_MAX_REGISTER_SIZE);
|
||||||
store_unsigned_integer (valbuf, push_size, byte_order,
|
store_unsigned_integer (valbuf, push_size, byte_order,
|
||||||
value_address (*args));
|
value_address (*args));
|
||||||
val = &valbuf[0];
|
val = &valbuf[0];
|
||||||
|
Reference in New Issue
Block a user