diff options
author | Yao Qi <yao.qi@linaro.org> | 2017-05-24 22:15:23 +0100 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2017-05-24 22:15:23 +0100 |
commit | d8e07dda92366be0f6fc2e7128620d3dd53494e3 (patch) | |
tree | dd00dd3da1ca544d1ab491c80d15ac57f6821a98 | |
parent | 8c8f9122ce6e6c00f72914479af57a7b87244554 (diff) | |
download | fsf-binutils-gdb-d8e07dda92366be0f6fc2e7128620d3dd53494e3.zip fsf-binutils-gdb-d8e07dda92366be0f6fc2e7128620d3dd53494e3.tar.gz fsf-binutils-gdb-d8e07dda92366be0f6fc2e7128620d3dd53494e3.tar.bz2 |
Get register contents by register_size instead of TYPE_LENGTH
We should use register_size to get register contents instead of
TYPE_LENGTH.
gdb:
2017-05-24 Yao Qi <yao.qi@linaro.org>
* i387-tdep.c (i387_register_to_value): Use register_size
instead of TYPE_LENGTH.
* m68k-tdep.c (m68k_register_to_value): Likewise.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/i387-tdep.c | 3 | ||||
-rw-r--r-- | gdb/m68k-tdep.c | 4 |
3 files changed, 11 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 29cd306..ea75f07 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2017-05-24 Yao Qi <yao.qi@linaro.org> + * i387-tdep.c (i387_register_to_value): Use register_size + instead of TYPE_LENGTH. + * m68k-tdep.c (m68k_register_to_value): Likewise. + +2017-05-24 Yao Qi <yao.qi@linaro.org> + * i387-tdep.c (i387_convert_register_p): Return false if type code isn't TYPE_CODE_FLT. diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c index 925f4e5..574914c 100644 --- a/gdb/i387-tdep.c +++ b/gdb/i387-tdep.c @@ -375,7 +375,8 @@ i387_register_to_value (struct frame_info *frame, int regnum, } /* Convert to TYPE. */ - if (!get_frame_register_bytes (frame, regnum, 0, TYPE_LENGTH (type), + if (!get_frame_register_bytes (frame, regnum, 0, + register_size (gdbarch, regnum), from, optimizedp, unavailablep)) return 0; diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index f093446..619a40b 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -201,13 +201,15 @@ m68k_register_to_value (struct frame_info *frame, int regnum, struct type *type, gdb_byte *to, int *optimizedp, int *unavailablep) { + struct gdbarch *gdbarch = get_frame_arch (frame); gdb_byte from[M68K_MAX_REGISTER_SIZE]; struct type *fpreg_type = register_type (gdbarch, M68K_FP0_REGNUM); gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT); /* Convert to TYPE. */ - if (!get_frame_register_bytes (frame, regnum, 0, TYPE_LENGTH (type), + if (!get_frame_register_bytes (frame, regnum, 0, + register_size (gdbarch, regnum), from, optimizedp, unavailablep)) return 0; |