configs: Add --wait-gdb as option to se.py
authorBoris Shingarov <shingarov@labware.com>
Mon, 30 Mar 2020 12:54:12 +0000 (08:54 -0400)
committerBoris Shingarov <shingarov@gmail.com>
Mon, 30 Mar 2020 22:12:05 +0000 (22:12 +0000)
I switch between waiting and non-waiting scenario many times per day.
The BaseCPU.wait_for_remote_gdb attribute, introduced in c2baaab0ed,
makes it much less painful by saving many recompiles.
The present commit tries to go a bit further: the se.py script is
under version control, and changing it interferes with smooth git
workflow.

Change-Id: Ie65ffc44b11d78d5e7878f81f2fcdafa143c20a8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27287
Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

configs/common/Options.py
configs/example/se.py

index b2db1ebd267fdd5d0d9c7c91b20a1bbb6f708772..6c92f36d28c87f3657e6b6086414721b873a226d 100644 (file)
@@ -403,6 +403,8 @@ def addSEOptions(parser):
                            "to be used in syscall emulation."
                            "Usage: gem5.opt [...] --redirects /dir1=/path/"
                            "to/host/dir1 --redirects /dir2=/path/to/host/dir2")
+    parser.add_option("--wait-gdb", default=False,
+                      help="Wait for remote GDB to connect.")
 
 
 
index a3cd6f14da95ce342c04a79acaf2f0e51b991b7a..200a0dee50bff47a4680eafcfdd340314967ca1f 100644 (file)
@@ -275,5 +275,9 @@ else:
     MemConfig.config_mem(options, system)
     config_filesystem(system, options)
 
+if options.wait_gdb:
+    for cpu in system.cpu:
+        cpu.wait_for_remote_gdb = True
+
 root = Root(full_system = False, system = system)
 Simulation.run(options, root, system, FutureClass)