/*
- * Copyright (c) 2003 The Regents of The University of Michigan
+ * Copyright (c) 2003-2004 The Regents of The University of Michigan
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#include <string>
#include <vector>
-#include "debug.hh"
-#include "eventq.hh"
-#include "param.hh"
-#include "sim_events.hh"
+#include "sim/debug.hh"
+#include "sim/eventq.hh"
+#include "sim/param.hh"
+#include "sim/sim_events.hh"
using namespace std;
void
debug_break()
{
+#ifndef NDEBUG
kill(getpid(), SIGTRAP);
+#else
+ cprintf("debug_break suppressed, compiled with NDEBUG\n");
+#endif
}
//
// constructor: schedule at specified time
//
DebugBreakEvent::DebugBreakEvent(EventQueue *q, Tick _when)
- : Event(q)
+ : Event(q, Debug_Break_Pri)
{
- schedule(_when, -20000);
+ setFlags(AutoDelete);
+ schedule(_when);
}
//
DebugBreakEvent::process()
{
debug_break();
- delete this;
}
new DebugBreakEvent(&mainEventQueue, when);
}
-extern "C" void dump_stats()
-{
- new DumpStatsEvent();
-}
-
extern "C" void eventq_dump()
{
mainEventQueue.dump();