From 28a0e5a165842bb3e5bed144cc5b64437810e4fb Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Sun, 17 Jan 2016 18:27:46 -0800 Subject: sim: don't ignore SIG_TRAP By ignoring SIG_TRAP, using --debug-break when not connected to a debugger becomes a no-op. Apparently this was intended to be a feature, though the rationale is not clear. If we don't ignore SIG_TRAP, then using --debug-break when not connected to a debugger causes the simulation process to terminate at tick N. This is occasionally useful, e.g., if you just want to collect a trace for a specific window of execution then you can combine this with --debug-start to do exactly that. In addition to not ignoring the signal, this patch also updates the --debug-break help message and deletes a handful of unprotected calls to Debug::breakpoint() that relied on the prior behavior. --- src/python/m5/main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/python') diff --git a/src/python/m5/main.py b/src/python/m5/main.py index 09bf7e92b..4adf6e26b 100644 --- a/src/python/m5/main.py +++ b/src/python/m5/main.py @@ -94,14 +94,15 @@ def parse_options(): # Debugging options group("Debugging Options") - option("--debug-break", metavar="TIME[,TIME]", action='append', split=',', - help="Tick to create a breakpoint") + option("--debug-break", metavar="TICK[,TICK]", action='append', split=',', + help="Create breakpoint(s) at TICK(s) " \ + "(kills process if no debugger attached)") option("--debug-help", action='store_true', help="Print help on debug flags") option("--debug-flags", metavar="FLAG[,FLAG]", action='append', split=',', help="Sets the flags for debug output (-FLAG disables a flag)") - option("--debug-start", metavar="TIME", type='int', - help="Start debug output at TIME (must be in ticks)") + option("--debug-start", metavar="TICK", type='int', + help="Start debug output at TICK (must be in ticks)") option("--debug-file", metavar="FILE", default="cout", help="Sets the output file for debug [Default: %default]") option("--debug-ignore", metavar="EXPR", action='append', split=':', -- cgit v1.2.3