Test 'info registers all' as well as 'info all-registers'
authorTim Newsome <tim@sifive.com>
Wed, 16 Mar 2016 18:02:52 +0000 (11:02 -0700)
committerTim Newsome <tim@sifive.com>
Mon, 23 May 2016 19:12:10 +0000 (12:12 -0700)
tests/gdbserver-smoke.py

index 51e8cc95e3f42a1ebdbc12443d09491475dbe842..16af626a90722b29d662888afd69bbf2c4f20536 100755 (executable)
@@ -45,10 +45,12 @@ class DebugTest(unittest.TestCase):
         self.assertIn("Remote connection closed", output)
 
     def test_registers(self):
-        output = self.gdb.command("info all-registers")
-        self.assertNotIn("Could not", output)
-        for reg in ('zero', 'ra', 'sp', 'gp', 'tp'):
-            self.assertIn(reg, output)
+        # Try both forms to test gdb.
+        for cmd in ("info all-registers", "info registers all"):
+            output = self.gdb.command(cmd)
+            self.assertNotIn("Could not", output)
+            for reg in ('zero', 'ra', 'sp', 'gp', 'tp'):
+                self.assertIn(reg, output)
         # mcpuid is one of the few registers that should have the high bit set
         # (for rv64).
         self.assertRegexpMatches(output, ".*mcpuid *0x80")