* Steve Reinhardt
*/
-#include <Python.h>
-
#include <string>
#include <vector>
#include "base/debug.hh"
#include "sim/debug.hh"
-#include "sim/eventq.hh"
+#include "sim/eventq_impl.hh"
+#include "sim/global_event.hh"
#include "sim/sim_events.hh"
#include "sim/sim_exit.hh"
+#include "cpu/pc_event.hh"
+#include "sim/system.hh"
using namespace std;
// Debug event: place a breakpoint on the process function and
// schedule the event to break at a particular cycle
//
-struct DebugBreakEvent : public Event
+struct DebugBreakEvent : public GlobalEvent
{
- DebugBreakEvent();
+ DebugBreakEvent(Tick when);
void process(); // process event
virtual const char *description() const;
};
//
// constructor: schedule at specified time
//
-DebugBreakEvent::DebugBreakEvent()
- : Event(Debug_Break_Pri, AutoDelete)
+DebugBreakEvent::DebugBreakEvent(Tick when)
+ : GlobalEvent(when, Debug_Break_Pri, AutoDelete)
{
}
// (callable from debugger)
//
void
-schedBreakCycle(Tick when)
+schedBreak(Tick when)
{
- mainEventQueue.schedule(new DebugBreakEvent, when);
+ new DebugBreakEvent(when);
warn("need to stop all queues");
}
+void
+schedRelBreak(Tick delta)
+{
+ schedBreak(curTick() + delta);
+}
+
+void
+breakAtKernelFunction(const char* funcName)
+{
+ System* curSystem = System::systemList[0];
+ curSystem->addKernelFuncEvent<BreakPCEvent>(funcName,
+ "GDB scheduled break", true);
+}
+
///
/// Function to cause the simulator to take a checkpoint from the debugger
///
void
eventqDump()
{
- mainEventQueue.dump();
- warn("need to dump all queues");
-}
-
-void
-py_interact()
-{
- PyObject *globals;
- PyObject *locals;
-
- globals = PyEval_GetGlobals();
- Py_INCREF(globals);
- locals = PyDict_New();
- PyRun_String("import code", Py_file_input, globals, locals);
- PyRun_String("code.interact(local=globals())", Py_file_input,
- globals, locals);
- Py_DECREF(globals);
- Py_DECREF(locals);
+ for (uint32_t i = 0; i < numMainEventQueues; ++i) {
+ mainEventQueue[i]->dump();
+ }
}
int remote_gdb_base_port = 7000;