Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2013-08-27 15:42:24 -0400
committerEugene Tarassov2013-08-27 15:43:48 -0400
commit0cc803d790058133659f0b1f12a005481e76cafe (patch)
tree999efa66d17d7e94743236d2634e78a1e291a9b1 /plugins
parentf8dab83ea89dfa0b2ce857dcc88fbdf4348de7e0 (diff)
downloadorg.eclipse.tcf-0cc803d790058133659f0b1f12a005481e76cafe.tar.gz
org.eclipse.tcf-0cc803d790058133659f0b1f12a005481e76cafe.tar.xz
org.eclipse.tcf-0cc803d790058133659f0b1f12a005481e76cafe.zip
Bug 415949 - +/-Inf and Nan are not correctly evaluated in the registers view
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNumberFormat.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNumberFormat.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNumberFormat.java
index 69e907b5c..fbdf08bbf 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNumberFormat.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNumberFormat.java
@@ -226,7 +226,7 @@ public class TCFNumberFormat {
nan = exponent == 0x1f;
arr[0] &= 0x03;
if (exponent == 0) exponent = 1;
- else arr[0] |= 0x04;
+ else if (!nan) arr[0] |= 0x04;
exponent -= 10; // Significand
exponent -= 15; // Exponent bias
break;
@@ -237,7 +237,7 @@ public class TCFNumberFormat {
arr[0] = 0;
arr[1] &= 0x7f;
if (exponent == 0) exponent = 1;
- else arr[1] |= 0x80;
+ else if (!nan) arr[1] |= 0x80;
exponent -= 23; // Significand
exponent -= 127; // Exponent bias
break;
@@ -248,7 +248,7 @@ public class TCFNumberFormat {
arr[0] = 0;
arr[1] &= 0x0f;
if (exponent == 0) exponent = 1;
- else arr[1] |= 0x10;
+ else if (!nan) arr[1] |= 0x10;
exponent -= 52; // Significand
exponent -= 1023; // Exponent bias
break;
@@ -260,10 +260,11 @@ public class TCFNumberFormat {
arr[0] = arr[1] = 0;
if (size == 10) {
exponent -= 63; // Significand
+ if (nan) arr[2] &= 0x7f;
}
else {
if (exponent == 0) exponent = 1;
- else arr[1] = 1;
+ else if (!nan) arr[1] = 1;
exponent -= 112; // Significand
}
exponent -= 16383; // Exponent bias
@@ -273,9 +274,7 @@ public class TCFNumberFormat {
}
if (nan) {
for (int i = 0; i < arr.length; i++) {
- int n = arr[i] & 0xff;
- if (size == 10 && i == 2) n &= 0x7f;
- if (n != 0) return neg ? "-NaN" : "+NaN";
+ if (arr[i] != 0) return neg ? "-NaN" : "+NaN";
}
return neg ? "-Infinity" : "+Infinity";
}

Back to the top