diff options
author | Michael Chastain <mec@google.com> | 2001-07-07 00:14:06 +0000 |
---|---|---|
committer | Michael Chastain <mec@google.com> | 2001-07-07 00:14:06 +0000 |
commit | 7f1659e652a642364c32cb968303b6807ab8494d (patch) | |
tree | 937fdd3a0ca9aa068049cc722fc7d3efbe00e105 | |
parent | 0e2bc8614062894be1e657132e9d9e5a7530120c (diff) | |
download | gdb-7f1659e652a642364c32cb968303b6807ab8494d.zip gdb-7f1659e652a642364c32cb968303b6807ab8494d.tar.gz gdb-7f1659e652a642364c32cb968303b6807ab8494d.tar.bz2 |
I'm using the obvious fix rule to commit this.
Testing: I tested on native Red Hat Linux 7 using gcc 3.0.
The "info float" command exercises print_i387_value.
2001-07-06 Michael Chastain <chastain@redhat.com>
* i387-tdep.c (print_i387_value): Fix pointer glitch.
===
Index: i387-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i387-tdep.c,v
retrieving revision 1.11
diff -c -1 -0 -p -r1.11 i387-tdep.c
*** gdb/i387-tdep.c 2001/07/04 21:14:05 1.11
--- gdb/i387-tdep.c 2001/07/06 12:47:00
*************** print_i387_value (char *raw)
*** 163,184 ****
DOUBLEST value;
int len = TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT;
char *tmp = alloca (len);
/* This code only works on targets where ... */
gdb_assert (TARGET_LONG_DOUBLE_FORMAT == &floatformat_i387_ext);
/* Take care of the padding. FP reg is 80 bits. The same value in
memory is 96 bits. */
gdb_assert (FPU_REG_RAW_SIZE < len);
! memcpy (&tmp, raw, FPU_REG_RAW_SIZE);
! memset (&tmp + FPU_REG_RAW_SIZE, 0, len - FPU_REG_RAW_SIZE);
/* Extract the value as a DOUBLEST. */
/* Use extract_floating() rather than floatformat_to_doublest().
The latter is lossy in nature. Once GDB gets a host/target
independent and non-lossy FP it will become possible to bypass
extract_floating() and call floatformat*() directly. Note also
the assumptions about TARGET_LONG_DOUBLE above. */
value = extract_floating (tmp, len);
/* We try to print 19 digits. The last digit may or may not contain
--- 163,184 ----
DOUBLEST value;
int len = TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT;
char *tmp = alloca (len);
/* This code only works on targets where ... */
gdb_assert (TARGET_LONG_DOUBLE_FORMAT == &floatformat_i387_ext);
/* Take care of the padding. FP reg is 80 bits. The same value in
memory is 96 bits. */
gdb_assert (FPU_REG_RAW_SIZE < len);
! memcpy (tmp, raw, FPU_REG_RAW_SIZE);
! memset (tmp + FPU_REG_RAW_SIZE, 0, len - FPU_REG_RAW_SIZE);
/* Extract the value as a DOUBLEST. */
/* Use extract_floating() rather than floatformat_to_doublest().
The latter is lossy in nature. Once GDB gets a host/target
independent and non-lossy FP it will become possible to bypass
extract_floating() and call floatformat*() directly. Note also
the assumptions about TARGET_LONG_DOUBLE above. */
value = extract_floating (tmp, len);
/* We try to print 19 digits. The last digit may or may not contain
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/i387-tdep.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1fb4efc..c240072 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2001-07-06 Michael Chastain <chastain@redhat.com> + + * i387-tdep.c (print_i387_value): Fix pointer glitch. + 2001-07-07 Mark Kettenis <kettenis@gnu.org> * lin-lwp.c (count_events_callback): Fix formatting. Turn check diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c index 71cb030c..66b6dc0 100644 --- a/gdb/i387-tdep.c +++ b/gdb/i387-tdep.c @@ -170,8 +170,8 @@ print_i387_value (char *raw) /* Take care of the padding. FP reg is 80 bits. The same value in memory is 96 bits. */ gdb_assert (FPU_REG_RAW_SIZE < len); - memcpy (&tmp, raw, FPU_REG_RAW_SIZE); - memset (&tmp + FPU_REG_RAW_SIZE, 0, len - FPU_REG_RAW_SIZE); + memcpy (tmp, raw, FPU_REG_RAW_SIZE); + memset (tmp + FPU_REG_RAW_SIZE, 0, len - FPU_REG_RAW_SIZE); /* Extract the value as a DOUBLEST. */ /* Use extract_floating() rather than floatformat_to_doublest(). |