changeset 4fe5f7f5094c in /z/repo/m5 details: http://repo.m5sim.org/m5?cmd=changeset;node=4fe5f7f5094c description: Debug: Add a function to cause the simulator to create a checkpoint from GDB.
diffstat: src/sim/debug.cc | 12 ++++++++++++ src/sim/debug.hh | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+), 0 deletions(-) diffs (59 lines): diff -r bfaab04cb292 -r 4fe5f7f5094c src/sim/debug.cc --- a/src/sim/debug.cc Wed May 04 20:38:27 2011 -0500 +++ b/src/sim/debug.cc Wed May 04 20:38:27 2011 -0500 @@ -38,6 +38,7 @@ #include "sim/debug.hh" #include "sim/eventq.hh" #include "sim/sim_events.hh" +#include "sim/sim_exit.hh" using namespace std; @@ -88,6 +89,17 @@ warn("need to stop all queues"); } +/// +/// Function to cause the simulator to take a checkpoint from the debugger +/// +void +takeCheckpoint(Tick when) +{ + if (!when) + when = curTick() + 1; + exitSimLoop("checkpoint", 0, when, 0); +} + void eventqDump() { diff -r bfaab04cb292 -r 4fe5f7f5094c src/sim/debug.hh --- a/src/sim/debug.hh Wed May 04 20:38:27 2011 -0500 +++ b/src/sim/debug.hh Wed May 04 20:38:27 2011 -0500 @@ -33,8 +33,26 @@ #include "base/types.hh" +/** @file This file provides the definitions for some useful debugging + * functions. These are intended to be called from a debugger such as + * gdb. + */ + + +/** Cause the simulator to execute a breakpoint + * @param when the cycle to break + */ void schedBreakCycle(Tick when); +/** Cause the simulator to return to python to create a checkpoint + * @param when the cycle to break + */ +void takeCheckpoint(Tick when); + +/** Dump all the events currently on the event queue + */ +void eventqDump(); + int getRemoteGDBPort(); // Remote gdb base port. 0 disables remote gdb. void setRemoteGDBPort(int port); _______________________________________________ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev