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/sim/init_signals.cc | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/sim/init_signals.cc') diff --git a/src/sim/init_signals.cc b/src/sim/init_signals.cc index 6fe196a67..81dba189b 100644 --- a/src/sim/init_signals.cc +++ b/src/sim/init_signals.cc @@ -178,9 +178,6 @@ initSignals() // ignore them signal(SIGFPE, SIG_IGN); - // We use SIGTRAP sometimes for debugging - signal(SIGTRAP, SIG_IGN); - // Dump intermediate stats installSignalHandler(SIGUSR1, dumpStatsHandler); -- cgit v1.2.3