aboutsummaryrefslogtreecommitdiff
path: root/debug/gdbserver.py
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2019-06-14 16:04:57 -0700
committerGitHub <noreply@github.com>2019-06-14 16:04:57 -0700
commita2456ef50d41bb5679b1cd73372bbc1ea1c1268a (patch)
tree2626a31a98f875de99e309351cd49960015a24ec /debug/gdbserver.py
parentb7a0a80210c77c1d817243963ce35fba3ec97851 (diff)
downloadriscv-tests-a2456ef50d41bb5679b1cd73372bbc1ea1c1268a.zip
riscv-tests-a2456ef50d41bb5679b1cd73372bbc1ea1c1268a.tar.gz
riscv-tests-a2456ef50d41bb5679b1cd73372bbc1ea1c1268a.tar.bz2
Work better with mainline gdb (#192)
* Parse floats the way mainline gdb prints them. For 64-bit floats, it shows both float and double results. Now more tests pass using mainline gdb. * Disable ANSI when talking to gdb. Helps more tests pass with mainline gdb. * Parse {float=...,double=...} in "info registers" Makes tests work better with mainline gdb.
Diffstat (limited to 'debug/gdbserver.py')
-rwxr-xr-xdebug/gdbserver.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/debug/gdbserver.py b/debug/gdbserver.py
index 754c560..8c58b6b 100755
--- a/debug/gdbserver.py
+++ b/debug/gdbserver.py
@@ -123,16 +123,16 @@ class SimpleF18Test(SimpleRegisterTest):
self.gdb.stepi()
a = random.random()
b = random.random()
- self.gdb.p_raw("$%s=%f" % (name, a))
- assertLess(abs(float(self.gdb.p_raw("$%s" % alias)) - a), .001)
+ self.gdb.p_fpr("$%s=%f" % (name, a))
+ assertLess(abs((self.gdb.p_fpr("$%s" % alias)) - a), .001)
self.gdb.stepi()
- assertLess(abs(float(self.gdb.p_raw("$%s" % name)) - a), .001)
- assertLess(abs(float(self.gdb.p_raw("$%s" % alias)) - a), .001)
- self.gdb.p_raw("$%s=%f" % (alias, b))
- assertLess(abs(float(self.gdb.p_raw("$%s" % name)) - b), .001)
+ assertLess(abs((self.gdb.p_fpr("$%s" % name)) - a), .001)
+ assertLess(abs((self.gdb.p_fpr("$%s" % alias)) - a), .001)
+ self.gdb.p_fpr("$%s=%f" % (alias, b))
+ assertLess(abs((self.gdb.p_fpr("$%s" % name)) - b), .001)
self.gdb.stepi()
- assertLess(abs(float(self.gdb.p_raw("$%s" % name)) - b), .001)
- assertLess(abs(float(self.gdb.p_raw("$%s" % alias)) - b), .001)
+ assertLess(abs((self.gdb.p_fpr("$%s" % name)) - b), .001)
+ assertLess(abs((self.gdb.p_fpr("$%s" % alias)) - b), .001)
size = self.gdb.p("sizeof($%s)" % name)
if self.hart.extensionSupported('D'):