diff options
author | Alan Hayward <alan.hayward@arm.com> | 2017-05-08 09:40:07 +0100 |
---|---|---|
committer | Alan Hayward <alan.hayward@arm.com> | 2017-05-08 09:40:07 +0100 |
commit | 313c59612298b022a408ca390bd5f73f28708015 (patch) | |
tree | 6b0c8466cf3cf62778e9ee70d7da563df122432e | |
parent | 27bfc1d1c2cbcafccddef51ef82b309ef147c4a8 (diff) | |
download | gdb-313c59612298b022a408ca390bd5f73f28708015.zip gdb-313c59612298b022a408ca390bd5f73f28708015.tar.gz gdb-313c59612298b022a408ca390bd5f73f28708015.tar.bz2 |
Remove some uses of MAX_REGISTER_SIZE from mips-tdep.c
gdb/
* mips-tdep.c (mips_o32_return_value): Remove unused buffer.
(print_gp_register_row): Use get_frame_register_value.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/mips-tdep.c | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1f3f6cb..fec0727 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2017-05-08 Alan Hayward <alan.hayward@arm.com> + * mips-tdep.c (mips_o32_return_value): Remove unused buffer. + (print_gp_register_row): Use get_frame_register_value. + +2017-05-08 Alan Hayward <alan.hayward@arm.com> + * mips-linux-tdep.c (mips_supply_gregset): Use raw_supply_zeroed. (mips_supply_fpregset): Likewise. (mips64_supply_gregset): Likewise. diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index f8e6809..2f5a90b 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -5759,7 +5759,6 @@ mips_o32_return_value (struct gdbarch *gdbarch, struct value *function, /* A struct that contains one or two floats. Each value is part in the least significant part of their floating point register.. */ - gdb_byte reg[MAX_REGISTER_SIZE]; int regnum; int field; for (field = 0, regnum = mips_regnum (gdbarch)->fp0; @@ -6474,7 +6473,8 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame, { struct gdbarch *gdbarch = get_frame_arch (frame); /* Do values for GP (int) regs. */ - gdb_byte raw_buffer[MAX_REGISTER_SIZE]; + const gdb_byte *raw_buffer; + struct value *value; int ncols = (mips_abi_regsize (gdbarch) == 8 ? 4 : 8); /* display cols per row. */ int col, byte; @@ -6533,9 +6533,12 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame, break; /* End row: large register. */ /* OK: get the data in raw format. */ - if (!deprecated_frame_register_read (frame, regnum, raw_buffer)) + value = get_frame_register_value (frame, regnum); + if (value_optimized_out (value) + || !value_entirely_available (value)) error (_("can't read register %d (%s)"), regnum, gdbarch_register_name (gdbarch, regnum)); + raw_buffer = value_contents_all (value); /* pad small registers */ for (byte = 0; byte < (mips_abi_regsize (gdbarch) |