Skip to content

Commit 2c58386

Browse files
committed
Properly display f32 values on the stack
(This assumes they are sent in decimal format see TOPLLab/WARDuino#319)
1 parent bdd2684 commit 2c58386

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/kotlin/be/ugent/topl/mio/ui/InteractiveDebugger.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,13 @@ class WatchWindow : JTable() {
772772
}
773773
val stack = snapshot.stack!!
774774
for (stackElement in stack) {
775-
tableModel.addRow(arrayOf("stack[${stackElement.idx}]", stackElement.type, stackElement.value))
775+
tableModel.addRow(arrayOf("stack[${stackElement.idx}]", stackElement.type,
776+
when(stackElement.type) {
777+
"F32" -> Float.fromBits(stackElement.value.toInt())
778+
"F64" -> Double.fromBits(stackElement.value)
779+
else -> stackElement.value
780+
})
781+
)
776782
}
777783
}
778784

0 commit comments

Comments
 (0)