13 from testlib
import assertEqual
, assertNotEqual
, assertIn
, assertNotIn
14 from testlib
import assertGreater
, assertRegexpMatches
, assertLess
15 from testlib
import GdbTest
17 MSTATUS_UIE
= 0x00000001
18 MSTATUS_SIE
= 0x00000002
19 MSTATUS_HIE
= 0x00000004
20 MSTATUS_MIE
= 0x00000008
21 MSTATUS_UPIE
= 0x00000010
22 MSTATUS_SPIE
= 0x00000020
23 MSTATUS_HPIE
= 0x00000040
24 MSTATUS_MPIE
= 0x00000080
25 MSTATUS_SPP
= 0x00000100
26 MSTATUS_HPP
= 0x00000600
27 MSTATUS_MPP
= 0x00001800
28 MSTATUS_FS
= 0x00006000
29 MSTATUS_XS
= 0x00018000
30 MSTATUS_MPRV
= 0x00020000
31 MSTATUS_PUM
= 0x00040000
32 MSTATUS_MXR
= 0x00080000
33 MSTATUS_VM
= 0x1F000000
34 MSTATUS32_SD
= 0x80000000
35 MSTATUS64_SD
= 0x8000000000000000
37 # pylint: disable=abstract-method
39 def ihex_line(address
, record_type
, data
):
40 assert len(data
) < 128
41 line
= ":%02X%04X%02X" % (len(data
), address
, record_type
)
43 check
+= address
% 256
49 line
+= "%02X" % value
50 line
+= "%02X\n" % ((256-check
)%256)
54 assert line
.startswith(":")
56 data_len
= int(line
[:2], 16)
57 address
= int(line
[2:6], 16)
58 record_type
= int(line
[6:8], 16)
60 for i
in range(data_len
):
61 data
+= "%c" % int(line
[8+2*i
:10+2*i
], 16)
62 return record_type
, address
, data
64 def readable_binary_string(s
):
65 return "".join("%02x" % ord(c
) for c
in s
)
67 class SimpleRegisterTest(GdbTest
):
68 def check_reg(self
, name
):
69 a
= random
.randrange(1<<self
.target
.xlen
)
70 b
= random
.randrange(1<<self
.target
.xlen
)
71 self
.gdb
.p("$%s=0x%x" % (name
, a
))
73 assertEqual(self
.gdb
.p("$%s" % name
), a
)
74 self
.gdb
.p("$%s=0x%x" % (name
, b
))
76 assertEqual(self
.gdb
.p("$%s" % name
), b
)
80 self
.gdb
.command("p *((int*) 0x%x)=0x13" % self
.target
.ram
)
81 self
.gdb
.command("p *((int*) 0x%x)=0x13" % (self
.target
.ram
+ 4))
82 self
.gdb
.command("p *((int*) 0x%x)=0x13" % (self
.target
.ram
+ 8))
83 self
.gdb
.command("p *((int*) 0x%x)=0x13" % (self
.target
.ram
+ 12))
84 self
.gdb
.command("p *((int*) 0x%x)=0x13" % (self
.target
.ram
+ 16))
85 self
.gdb
.p("$pc=0x%x" % self
.target
.ram
)
87 class SimpleS0Test(SimpleRegisterTest
):
91 class SimpleS1Test(SimpleRegisterTest
):
95 class SimpleT0Test(SimpleRegisterTest
):
99 class SimpleT1Test(SimpleRegisterTest
):
103 class SimpleF18Test(SimpleRegisterTest
):
104 def check_reg(self
, name
):
105 self
.gdb
.p_raw("$mstatus=$mstatus | 0x00006000")
109 self
.gdb
.p_raw("$%s=%f" % (name
, a
))
111 assertLess(abs(float(self
.gdb
.p_raw("$%s" % name
)) - a
), .001)
112 self
.gdb
.p_raw("$%s=%f" % (name
, b
))
114 assertLess(abs(float(self
.gdb
.p_raw("$%s" % name
)) - b
), .001)
116 def early_applicable(self
):
117 return self
.target
.extensionSupported('F')
120 self
.check_reg("f18")
122 class SimpleMemoryTest(GdbTest
):
123 def access_test(self
, size
, data_type
):
124 assertEqual(self
.gdb
.p("sizeof(%s)" % data_type
), size
)
125 a
= 0x86753095555aaaa & ((1<<(size
*8))-1)
126 b
= 0xdeadbeef12345678 & ((1<<(size
*8))-1)
127 self
.gdb
.p("*((%s*)0x%x) = 0x%x" % (data_type
, self
.target
.ram
, a
))
128 self
.gdb
.p("*((%s*)0x%x) = 0x%x" % (data_type
, self
.target
.ram
+ size
,
130 assertEqual(self
.gdb
.p("*((%s*)0x%x)" % (data_type
, self
.target
.ram
)),
132 assertEqual(self
.gdb
.p("*((%s*)0x%x)" % (
133 data_type
, self
.target
.ram
+ size
)), b
)
135 class MemTest8(SimpleMemoryTest
):
137 self
.access_test(1, 'char')
139 class MemTest16(SimpleMemoryTest
):
141 self
.access_test(2, 'short')
143 class MemTest32(SimpleMemoryTest
):
145 self
.access_test(4, 'int')
147 class MemTest64(SimpleMemoryTest
):
149 self
.access_test(8, 'long long')
151 # FIXME: I'm not passing back invalid addresses correctly in read/write memory.
152 #class MemTestReadInvalid(SimpleMemoryTest):
154 # # This test relies on 'gdb_report_data_abort enable' being executed in
155 # # the openocd.cfg file.
157 # self.gdb.p("*((int*)0xdeadbeef)")
158 # assert False, "Read should have failed."
159 # except testlib.CannotAccess as e:
160 # assertEqual(e.address, 0xdeadbeef)
161 # self.gdb.p("*((int*)0x%x)" % self.target.ram)
163 #class MemTestWriteInvalid(SimpleMemoryTest):
165 # # This test relies on 'gdb_report_data_abort enable' being executed in
166 # # the openocd.cfg file.
168 # self.gdb.p("*((int*)0xdeadbeef)=8675309")
169 # assert False, "Write should have failed."
170 # except testlib.CannotAccess as e:
171 # assertEqual(e.address, 0xdeadbeef)
172 # self.gdb.p("*((int*)0x%x)=6874742" % self.target.ram)
174 class MemTestBlock(GdbTest
):
178 a
= tempfile
.NamedTemporaryFile(suffix
=".ihex")
180 for i
in range(length
/ line_length
):
181 line_data
= "".join(["%c" % random
.randrange(256)
182 for _
in range(line_length
)])
184 a
.write(ihex_line(i
* line_length
, 0, line_data
))
187 self
.gdb
.command("restore %s 0x%x" % (a
.name
, self
.target
.ram
))
188 for offset
in range(0, length
, 19*4) + [length
-4]:
189 value
= self
.gdb
.p("*((int*)0x%x)" % (self
.target
.ram
+ offset
))
190 written
= ord(data
[offset
]) | \
191 (ord(data
[offset
+1]) << 8) | \
192 (ord(data
[offset
+2]) << 16) | \
193 (ord(data
[offset
+3]) << 24)
194 assertEqual(value
, written
)
196 b
= tempfile
.NamedTemporaryFile(suffix
=".ihex")
197 self
.gdb
.command("dump ihex memory %s 0x%x 0x%x" % (b
.name
,
198 self
.target
.ram
, self
.target
.ram
+ length
))
200 record_type
, address
, line_data
= ihex_parse(line
)
202 assertEqual(readable_binary_string(line_data
),
203 readable_binary_string(
204 data
[address
:address
+len(line_data
)]))
206 class InstantHaltTest(GdbTest
):
208 """Assert that reset is really resetting what it should."""
209 self
.gdb
.command("monitor reset halt")
210 self
.gdb
.command("flushregs")
211 assertEqual(self
.target
.reset_vector
, self
.gdb
.p("$pc"))
212 # mcycle and minstret have no defined reset value.
213 mstatus
= self
.gdb
.p("$mstatus")
214 assertEqual(mstatus
& (MSTATUS_MIE | MSTATUS_MPRV |
217 class InstantChangePc(GdbTest
):
219 """Change the PC right as we come out of reset."""
221 self
.gdb
.command("monitor reset halt")
222 self
.gdb
.command("flushregs")
223 self
.gdb
.command("p *((int*) 0x%x)=0x13" % self
.target
.ram
)
224 self
.gdb
.command("p *((int*) 0x%x)=0x13" % (self
.target
.ram
+ 4))
225 self
.gdb
.command("p *((int*) 0x%x)=0x13" % (self
.target
.ram
+ 8))
226 self
.gdb
.p("$pc=0x%x" % self
.target
.ram
)
228 assertEqual((self
.target
.ram
+ 4), self
.gdb
.p("$pc"))
230 assertEqual((self
.target
.ram
+ 8), self
.gdb
.p("$pc"))
232 class DebugTest(GdbTest
):
233 # Include malloc so that gdb can make function calls. I suspect this malloc
234 # will silently blow through the memory set aside for it, so be careful.
235 compile_args
= ("programs/debug.c", "programs/checksum.c",
236 "programs/tiny-malloc.c", "-DDEFINE_MALLOC", "-DDEFINE_FREE")
242 def exit(self
, expected_result
=0xc86455d4):
243 output
= self
.gdb
.c()
244 assertIn("Breakpoint", output
)
245 assertIn("_exit", output
)
246 assertEqual(self
.gdb
.p("status"), expected_result
)
248 class DebugCompareSections(DebugTest
):
250 output
= self
.gdb
.command("compare-sections")
252 for line
in output
.splitlines():
253 if line
.startswith("Section"):
254 assert line
.endswith("matched.")
256 assertGreater(matched
, 1)
258 class DebugFunctionCall(DebugTest
):
260 self
.gdb
.b("main:start")
262 assertEqual(self
.gdb
.p('fib(6)'), 8)
263 assertEqual(self
.gdb
.p('fib(7)'), 13)
266 class DebugChangeString(DebugTest
):
268 text
= "This little piggy went to the market."
269 self
.gdb
.b("main:start")
271 self
.gdb
.p('fox = "%s"' % text
)
272 self
.exit(0x43b497b8)
274 class DebugTurbostep(DebugTest
):
276 """Single step a bunch of times."""
277 self
.gdb
.b("main:start")
279 self
.gdb
.command("p i=0")
285 pc
= self
.gdb
.p("$pc")
286 assertNotEqual(last_pc
, pc
)
287 if last_pc
and pc
> last_pc
and pc
- last_pc
<= 4:
292 # Some basic sanity that we're not running between breakpoints or
294 assertGreater(jumps
, 1)
295 assertGreater(advances
, 5)
297 class DebugExit(DebugTest
):
301 class DebugSymbols(DebugTest
):
305 output
= self
.gdb
.c()
306 assertIn(", main ", output
)
307 output
= self
.gdb
.c()
308 assertIn(", rot13 ", output
)
310 class DebugBreakpoint(DebugTest
):
313 # The breakpoint should be hit exactly 2 times.
315 output
= self
.gdb
.c()
317 assertIn("Breakpoint ", output
)
318 assertIn("rot13 ", output
)
321 class Hwbp1(DebugTest
):
323 if self
.target
.instruction_hardware_breakpoint_count
< 1:
324 return 'not_applicable'
326 self
.gdb
.hbreak("rot13")
327 # The breakpoint should be hit exactly 2 times.
329 output
= self
.gdb
.c()
331 assertRegexpMatches(output
, r
"[bB]reakpoint")
332 assertIn("rot13 ", output
)
335 class Hwbp2(DebugTest
):
337 if self
.target
.instruction_hardware_breakpoint_count
< 2:
338 return 'not_applicable'
340 self
.gdb
.hbreak("main")
341 self
.gdb
.hbreak("rot13")
342 # We should hit 3 breakpoints.
343 for expected
in ("main", "rot13", "rot13"):
344 output
= self
.gdb
.c()
346 assertRegexpMatches(output
, r
"[bB]reakpoint")
347 assertIn("%s " % expected
, output
)
350 class TooManyHwbp(DebugTest
):
353 self
.gdb
.hbreak("*rot13 + %d" % (i
* 4))
355 output
= self
.gdb
.c()
356 assertIn("Cannot insert hardware breakpoint", output
)
357 # Clean up, otherwise the hardware breakpoints stay set and future
359 self
.gdb
.command("D")
361 class Registers(DebugTest
):
363 # Get to a point in the code where some registers have actually been
368 # Try both forms to test gdb.
369 for cmd
in ("info all-registers", "info registers all"):
370 output
= self
.gdb
.command(cmd
)
371 for reg
in ('zero', 'ra', 'sp', 'gp', 'tp'):
372 assertIn(reg
, output
)
375 # mcpuid is one of the few registers that should have the high bit set
377 # Leave this commented out until gdb and spike agree on the encoding of
378 # mcpuid (which is going to be renamed to misa in any case).
379 #assertRegexpMatches(output, ".*mcpuid *0x80")
382 # The instret register should always be changing.
385 # instret = self.gdb.p("$instret")
386 # assertNotEqual(instret, last_instret)
387 # last_instret = instret
392 class UserInterrupt(DebugTest
):
394 """Sending gdb ^C while the program is running should cause it to
396 self
.gdb
.b("main:start")
399 self
.gdb
.c(wait
=False)
401 output
= self
.gdb
.interrupt()
402 assert "main" in output
403 assertGreater(self
.gdb
.p("j"), 10)
407 class MulticoreTest(GdbTest
):
408 compile_args
= ("programs/infinite_loop.S", )
413 self
.gdb
.b("main_end")
414 self
.gdb
.command("set non-stop on")
418 threads
= self
.gdb
.threads()
420 return 'not_applicable'
421 # Run through the entire loop.
424 self
.gdb
.p("$pc=_start")
429 for t
in self
.gdb
.threads():
430 assertIn("main", t
.frame
)
436 for t
in self
.gdb
.threads():
437 assertIn("main_end", t
.frame
)
438 # Check register values.
440 hart_id
= self
.gdb
.p("$x1")
441 assertNotIn(hart_id
, hart_ids
)
442 hart_ids
.append(hart_id
)
443 for n
in range(2, 32):
444 value
= self
.gdb
.p("$x%d" % n
)
445 assertEqual(value
, hart_ids
[-1] + n
- 1)
447 # Confirmed that we read different register values for different harts.
448 # Write a new value to x1, and run through the add sequence again.
450 # This part isn't working right, because gdb doesn't resume Thread 2
451 # when asked. I don't know the root cause for that, but up to this
452 # point the test is still useful.
456 # self.gdb.p("$x1=0x%x" % (int(t.id) + 0x800))
457 # self.gdb.p("$pc=main_post_csrr")
461 # for t in self.gdb.threads():
462 # assertIn("main_end", t.frame)
463 # # Check register values.
465 # for n in range(1, 32):
466 # value = self.gdb.p("$x%d" % n)
467 # assertEqual(value, int(t.id) + 0x800 + n - 1)
469 class StepTest(GdbTest
):
470 compile_args
= ("programs/step.S", )
478 main_address
= self
.gdb
.p("$pc")
479 if self
.target
.extensionSupported("c"):
480 sequence
= (4, 8, 0xc, 0xe, 0x14, 0x18, 0x22, 0x1c, 0x24, 0x24)
482 sequence
= (4, 8, 0xc, 0x10, 0x18, 0x1c, 0x28, 0x20, 0x2c, 0x2c)
483 for expected
in sequence
:
485 pc
= self
.gdb
.p("$pc")
486 assertEqual("%x" % (pc
- main_address
), "%x" % expected
)
488 class TriggerTest(GdbTest
):
489 compile_args
= ("programs/trigger.S", )
497 output
= self
.gdb
.c()
498 assertIn("Breakpoint", output
)
499 assertIn("_exit", output
)
501 class TriggerExecuteInstant(TriggerTest
):
502 """Test an execute breakpoint on the first instruction executed out of
505 main_address
= self
.gdb
.p("$pc")
506 self
.gdb
.command("hbreak *0x%x" % (main_address
+ 4))
508 assertEqual(self
.gdb
.p("$pc"), main_address
+4)
510 # FIXME: Triggers aren't quite working yet
511 #class TriggerLoadAddress(TriggerTest):
513 # self.gdb.command("rwatch *((&data)+1)")
514 # output = self.gdb.c()
515 # assertIn("read_loop", output)
516 # assertEqual(self.gdb.p("$a0"),
517 # self.gdb.p("(&data)+1"))
520 class TriggerLoadAddressInstant(TriggerTest
):
521 """Test a load address breakpoint on the first instruction executed out of
524 self
.gdb
.command("b just_before_read_loop")
526 read_loop
= self
.gdb
.p("&read_loop")
527 self
.gdb
.command("rwatch data")
529 # Accept hitting the breakpoint before or after the load instruction.
530 assertIn(self
.gdb
.p("$pc"), [read_loop
, read_loop
+ 4])
531 assertEqual(self
.gdb
.p("$a0"), self
.gdb
.p("&data"))
533 # FIXME: Triggers aren't quite working yet
534 #class TriggerStoreAddress(TriggerTest):
536 # self.gdb.command("watch *((&data)+3)")
537 # output = self.gdb.c()
538 # assertIn("write_loop", output)
539 # assertEqual(self.gdb.p("$a0"),
540 # self.gdb.p("(&data)+3"))
543 class TriggerStoreAddressInstant(TriggerTest
):
545 """Test a store address breakpoint on the first instruction executed out
547 self
.gdb
.command("b just_before_write_loop")
549 write_loop
= self
.gdb
.p("&write_loop")
550 self
.gdb
.command("watch data")
552 # Accept hitting the breakpoint before or after the store instruction.
553 assertIn(self
.gdb
.p("$pc"), [write_loop
, write_loop
+ 4])
554 assertEqual(self
.gdb
.p("$a0"), self
.gdb
.p("&data"))
556 class TriggerDmode(TriggerTest
):
557 def check_triggers(self
, tdata1_lsbs
, tdata2
):
558 dmode
= 1 << (self
.target
.xlen
-5)
562 if self
.target
.xlen
== 32:
564 elif self
.target
.xlen
== 64:
565 xlen_type
= 'long long'
567 raise NotImplementedError
572 tdata1
= self
.gdb
.p("((%s *)&data)[%d]" % (xlen_type
, 2*i
))
575 tdata2
= self
.gdb
.p("((%s *)&data)[%d]" % (xlen_type
, 2*i
+1))
580 assertEqual(tdata1
& 0xffff, tdata1_lsbs
)
581 assertEqual(tdata2
, tdata2
)
584 assertEqual(dmode_count
, 1)
589 self
.gdb
.command("hbreak write_load_trigger")
590 self
.gdb
.b("clear_triggers")
591 self
.gdb
.p("$pc=write_store_trigger")
592 output
= self
.gdb
.c()
593 assertIn("write_load_trigger", output
)
594 self
.check_triggers((1<<6) |
(1<<1), 0xdeadbee0)
595 output
= self
.gdb
.c()
596 assertIn("clear_triggers", output
)
597 self
.check_triggers((1<<6) |
(1<<0), 0xfeedac00)
599 class RegsTest(GdbTest
):
600 compile_args
= ("programs/regs.S", )
604 self
.gdb
.b("handle_trap")
607 class WriteGprs(RegsTest
):
609 regs
= [("x%d" % n
) for n
in range(2, 32)]
611 self
.gdb
.p("$pc=write_regs")
612 for i
, r
in enumerate(regs
):
613 self
.gdb
.p("$%s=%d" % (r
, (0xdeadbeef<<i
)+17))
614 self
.gdb
.p("$x1=data")
615 self
.gdb
.command("b all_done")
616 output
= self
.gdb
.c()
617 assertIn("Breakpoint ", output
)
619 # Just to get this data in the log.
620 self
.gdb
.command("x/30gx data")
621 self
.gdb
.command("info registers")
622 for n
in range(len(regs
)):
623 assertEqual(self
.gdb
.x("data+%d" % (8*n
), 'g'),
624 ((0xdeadbeef<<n
)+17) & ((1<<self
.target
.xlen
)-1))
626 class WriteCsrs(RegsTest
):
628 # As much a test of gdb as of the simulator.
629 self
.gdb
.p("$mscratch=0")
631 assertEqual(self
.gdb
.p("$mscratch"), 0)
632 self
.gdb
.p("$mscratch=123")
634 assertEqual(self
.gdb
.p("$mscratch"), 123)
636 self
.gdb
.p("$pc=write_regs")
637 self
.gdb
.p("$x1=data")
638 self
.gdb
.command("b all_done")
639 self
.gdb
.command("c")
641 assertEqual(123, self
.gdb
.p("$mscratch"))
642 assertEqual(123, self
.gdb
.p("$x1"))
643 assertEqual(123, self
.gdb
.p("$csr832"))
645 class DownloadTest(GdbTest
):
647 # pylint: disable=attribute-defined-outside-init
648 length
= min(2**10, self
.target
.ram_size
- 2048)
649 self
.download_c
= tempfile
.NamedTemporaryFile(prefix
="download_",
650 suffix
=".c", delete
=False)
651 self
.download_c
.write("#include <stdint.h>\n")
652 self
.download_c
.write(
653 "unsigned int crc32a(uint8_t *message, unsigned int size);\n")
654 self
.download_c
.write("uint32_t length = %d;\n" % length
)
655 self
.download_c
.write("uint8_t d[%d] = {\n" % length
)
657 assert length
% 16 == 0
658 for i
in range(length
/ 16):
659 self
.download_c
.write(" /* 0x%04x */ " % (i
* 16))
661 value
= random
.randrange(1<<8)
662 self
.download_c
.write("0x%02x, " % value
)
663 self
.crc
= binascii
.crc32("%c" % value
, self
.crc
)
664 self
.download_c
.write("\n")
665 self
.download_c
.write("};\n")
666 self
.download_c
.write("uint8_t *data = &d[0];\n")
667 self
.download_c
.write(
668 "uint32_t main() { return crc32a(data, length); }\n")
669 self
.download_c
.flush()
674 self
.binary
= self
.target
.compile(self
.download_c
.name
,
675 "programs/checksum.c")
676 self
.gdb
.command("file %s" % self
.binary
)
680 self
.gdb
.command("b _exit")
681 self
.gdb
.c(timeout
=60)
682 assertEqual(self
.gdb
.p("status"), self
.crc
)
683 os
.unlink(self
.download_c
.name
)
685 # FIXME: PRIV isn't implemented in the current OpenOCD
686 #class MprvTest(GdbTest):
687 # compile_args = ("programs/mprv.S", )
692 # """Test that the debugger can access memory when MPRV is set."""
693 # self.gdb.c(wait=False)
695 # self.gdb.interrupt()
696 # output = self.gdb.command("p/x *(int*)(((char*)&data)-0x80000000)")
697 # assertIn("0xbead", output)
699 #class PrivTest(GdbTest):
700 # compile_args = ("programs/priv.S", )
702 # # pylint: disable=attribute-defined-outside-init
705 # misa = self.target.misa
706 # self.supported = set()
708 # self.supported.add(0)
710 # self.supported.add(1)
712 # self.supported.add(2)
713 # self.supported.add(3)
715 #class PrivRw(PrivTest):
717 # """Test reading/writing priv."""
718 # for privilege in range(4):
719 # self.gdb.p("$priv=%d" % privilege)
721 # actual = self.gdb.p("$priv")
722 # assertIn(actual, self.supported)
723 # if privilege in self.supported:
724 # assertEqual(actual, privilege)
726 #class PrivChange(PrivTest):
728 # """Test that the core's privilege level actually changes."""
730 # if 0 not in self.supported:
731 # return 'not_applicable'
737 # self.gdb.p("$priv=3")
738 # main_address = self.gdb.p("$pc")
740 # assertEqual("%x" % self.gdb.p("$pc"), "%x" % (main_address+4))
743 # self.gdb.p("$priv=0")
745 # # Should have taken an exception, so be nowhere near main.
746 # pc = self.gdb.p("$pc")
747 # assertTrue(pc < main_address or pc > main_address + 0x100)
751 parser
= argparse
.ArgumentParser(
752 description
="Test that gdb can talk to a RISC-V target.",
754 Example command line from the real world:
755 Run all RegsTest cases against a physical FPGA, with custom openocd command:
756 ./gdbserver.py --freedom-e300 --server_cmd "$HOME/SiFive/openocd/src/openocd -s $HOME/SiFive/openocd/tcl -d" Simple
758 targets
.add_target_options(parser
)
760 testlib
.add_test_run_options(parser
)
762 # TODO: remove global
763 global parsed
# pylint: disable=global-statement
764 parsed
= parser
.parse_args()
765 target
= targets
.target(parsed
)
768 target
.xlen
= parsed
.xlen
770 module
= sys
.modules
[__name__
]
772 return testlib
.run_all_tests(module
, target
, parsed
)
774 # TROUBLESHOOTING TIPS
775 # If a particular test fails, run just that one test, eg.:
776 # ./gdbserver.py MprvTest.test_mprv
777 # Then inspect gdb.log and spike.log to see what happened in more detail.
779 if __name__
== '__main__':