add option to qemu to break at known alternate address
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 8 Jul 2020 16:18:29 +0000 (17:18 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 8 Jul 2020 16:18:29 +0000 (17:18 +0100)
src/soc/simulator/qemu.py

index b39ada05d07d1bb4879ec3f93bbdba9b400e1c79..d1045f15e54bf6aef5c14e289485a241f2a972a6 100644 (file)
@@ -96,7 +96,7 @@ class QemuController:
         self.qemu_popen.stdin.close()
 
 
-def run_program(program, initial_mem=None):
+def run_program(program, initial_mem=None, extra_break_addr=None):
     q = QemuController(program.binfile.name)
     q.connect()
     # Run to the start of the program
@@ -114,6 +114,9 @@ def run_program(program, initial_mem=None):
     q.break_address(0x20000000 + program.size())
     # or to trap
     q.break_address(0x700)
+    # or to alternative (absolute) address)
+    if extra_break_addr:
+        q.break_address(extra_break_addr)
     q.gdb_continue()
     return q