From a2456ef50d41bb5679b1cd73372bbc1ea1c1268a Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Fri, 14 Jun 2019 16:04:57 -0700 Subject: 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. --- debug/gdbserver.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'debug/gdbserver.py') 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'): -- cgit v1.1