Tell gdb what xlen is when there's no ELF file.
authorTim Newsome <tim@sifive.com>
Wed, 13 Jul 2016 17:51:05 +0000 (10:51 -0700)
committerTim Newsome <tim@sifive.com>
Tue, 19 Jul 2016 18:24:25 +0000 (11:24 -0700)
This makes several spike32 tests pass that used to fail. Ideally gdb
wouldn't need to be told, but that's a project for another day.

debug/gdbserver.py

index 0f5c28e50430b3a38257630909dc83c87e1000fd..652ad3366752ef2b2bfba8d2a84d8c92409e235c 100755 (executable)
@@ -43,6 +43,10 @@ class SimpleRegisterTest(DeleteServer):
     def setUp(self):
         self.server = target.server()
         self.gdb = testlib.Gdb()
+        # For now gdb has to be told what the architecture is when it's not
+        # given an ELF file.
+        self.gdb.command("set arch riscv:rv%d" % target.xlen)
+
         self.gdb.command("target extended-remote localhost:%d" % self.server.port)
 
         # 0x13 is nop
@@ -81,6 +85,7 @@ class SimpleMemoryTest(DeleteServer):
     def setUp(self):
         self.server = target.server()
         self.gdb = testlib.Gdb()
+        self.gdb.command("set arch riscv:rv%d" % target.xlen)
         self.gdb.command("target extended-remote localhost:%d" % self.server.port)
 
     def access_test(self, size, data_type):
@@ -134,6 +139,7 @@ class InstantHaltTest(DeleteServer):
     def setUp(self):
         self.server = target.server()
         self.gdb = testlib.Gdb()
+        self.gdb.command("set arch riscv:rv%d" % target.xlen)
         self.gdb.command("target extended-remote localhost:%d" % self.server.port)
 
     def test_instant_halt(self):