summaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2004-06-22 13:48:49 -0400
committerAli Saidi <saidi@eecs.umich.edu>2004-06-22 13:48:49 -0400
commit4deb81989496b360500985377e8f8c1a2f017b27 (patch)
tree20e9a164feb1631c965999ba738999abc4b0a691 /sim
parent074969f8f16110680de05fca64a6be48aedcdfd8 (diff)
parentc1e58b6bf6b353f9355aafd8ed2cb86e6d00e32a (diff)
downloadgem5-4deb81989496b360500985377e8f8c1a2f017b27.tar.xz
pull from head before pushing linux tree
--HG-- extra : convert_revision : 345f91c5c16c69db22035dc716e82fd77041380f
Diffstat (limited to 'sim')
-rw-r--r--sim/main.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/sim/main.cc b/sim/main.cc
index f0d10a67c..54c74fd1a 100644
--- a/sim/main.cc
+++ b/sim/main.cc
@@ -90,6 +90,18 @@ exitNowHandler(int sigtype)
async_exit = true;
}
+/// Abort signal handler.
+void
+abortHandler(int sigtype)
+{
+ cerr << "Program aborted at cycle " << curTick << endl;
+
+#if TRACING_ON
+ // dump trace buffer, if there is one
+ Trace::theLog.dump(cerr);
+#endif
+}
+
/// Simulator executable name
const char *myProgName = "";
@@ -232,6 +244,7 @@ main(int argc, char **argv)
signal(SIGUSR1, dumpStatsHandler); // dump intermediate stats
signal(SIGUSR2, dumprstStatsHandler); // dump and reset stats
signal(SIGINT, exitNowHandler); // dump final stats and exit
+ signal(SIGABRT, abortHandler);
sayHello(cerr);