diff --git a/src/sim/debug.hh b/src/sim/debug.hh --- a/src/sim/debug.hh +++ b/src/sim/debug.hh @@ -44,6 +44,13 @@ */ void schedBreak(Tick when); +/** + * Cause the simulator to execute a breakpoint when + * the given kernel function is reached + * @param funcName the name of the kernel function at which to break + */ +void breakAtKernelFunction(const char* funcName); + /** Cause the simulator to return to python to create a checkpoint * @param when the cycle to break */ # Node ID 2fe6125cb131b47b16e4597d6a8a9946043dc2ec # Parent 20bbfe5b2b86151d293b6c42aab29d9bd20b90cf diff --git a/src/sim/debug.cc b/src/sim/debug.cc --- a/src/sim/debug.cc +++ b/src/sim/debug.cc @@ -38,6 +38,8 @@ #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; @@ -87,6 +89,14 @@ warn("need to stop all queues"); } +void +breakAtKernelFunction(const char* funcName) +{ + System* curSystem = System::systemList[0]; + curSystem->addKernelFuncEvent(funcName, + "GDB scheduled break", true); +} + /// /// Function to cause the simulator to take a checkpoint from the debugger ///