aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2000-03-02 06:50:50 +0000
committerKevin Buettner <kevinb@redhat.com>2000-03-02 06:50:50 +0000
commit3db87ba3caf19203c987d1e121cfc0ba2374df27 (patch)
tree4a874d45dd514db141220c4173cf69ac4e91eef1
parent6c7e601e3ebf5781d8b834a49ae8e63824a3a142 (diff)
downloadgdb-3db87ba3caf19203c987d1e121cfc0ba2374df27.zip
gdb-3db87ba3caf19203c987d1e121cfc0ba2374df27.tar.gz
gdb-3db87ba3caf19203c987d1e121cfc0ba2374df27.tar.bz2
Fixes for extract_floating() and store_floating().
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/findvar.c21
2 files changed, 14 insertions, 13 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 930d6b1..0d84277 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2000-03-02 Kevin Buettner <kevinb@redhat.com>
+
+ * findvar.c (extract_floating, store_floating): Use target
+ floating point type sizes rather host sizes to determine
+ which conversion needs to be done.
+
2000-03-02 Nick Duffek <nsd@cygnus.com>
* uw-thread.c: Apply GNU conventions to comment formatting.
diff --git a/gdb/findvar.c b/gdb/findvar.c
index 9c8e313..98322e0 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -267,13 +267,11 @@ store_address (addr, len, val)
dirty work. */
DOUBLEST
-extract_floating (addr, len)
- PTR addr;
- int len;
+extract_floating (void *addr, int len)
{
DOUBLEST dretval;
- if (len == sizeof (float))
+ if (len * TARGET_CHAR_BIT == TARGET_FLOAT_BIT)
{
if (HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT)
{
@@ -285,7 +283,7 @@ extract_floating (addr, len)
else
floatformat_to_doublest (TARGET_FLOAT_FORMAT, addr, &dretval);
}
- else if (len == sizeof (double))
+ else if (len * TARGET_CHAR_BIT == TARGET_DOUBLE_BIT)
{
if (HOST_DOUBLE_FORMAT == TARGET_DOUBLE_FORMAT)
{
@@ -297,7 +295,7 @@ extract_floating (addr, len)
else
floatformat_to_doublest (TARGET_DOUBLE_FORMAT, addr, &dretval);
}
- else if (len == sizeof (DOUBLEST))
+ else if (len * TARGET_CHAR_BIT == TARGET_LONG_DOUBLE_BIT)
{
if (HOST_LONG_DOUBLE_FORMAT == TARGET_LONG_DOUBLE_FORMAT)
{
@@ -322,12 +320,9 @@ extract_floating (addr, len)
}
void
-store_floating (addr, len, val)
- PTR addr;
- int len;
- DOUBLEST val;
+store_floating (void *addr, int len, DOUBLEST val)
{
- if (len == sizeof (float))
+ if (len * TARGET_CHAR_BIT == TARGET_FLOAT_BIT)
{
if (HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT)
{
@@ -338,7 +333,7 @@ store_floating (addr, len, val)
else
floatformat_from_doublest (TARGET_FLOAT_FORMAT, &val, addr);
}
- else if (len == sizeof (double))
+ else if (len * TARGET_CHAR_BIT == TARGET_DOUBLE_BIT)
{
if (HOST_DOUBLE_FORMAT == TARGET_DOUBLE_FORMAT)
{
@@ -349,7 +344,7 @@ store_floating (addr, len, val)
else
floatformat_from_doublest (TARGET_DOUBLE_FORMAT, &val, addr);
}
- else if (len == sizeof (DOUBLEST))
+ else if (len * TARGET_CHAR_BIT == TARGET_LONG_DOUBLE_BIT)
{
if (HOST_LONG_DOUBLE_FORMAT == TARGET_LONG_DOUBLE_FORMAT)
memcpy (addr, &val, sizeof (val));