changeset bc07f3764129 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=bc07f3764129
description:
        sim: Add ability to break at specific kernel function

        Adds a GDB callable function that sets a breakpoint at
        the beginning of a kernel function.

diffstat:

 src/sim/debug.cc |  10 ++++++++++
 src/sim/debug.hh |   7 +++++++
 2 files changed, 17 insertions(+), 0 deletions(-)

diffs (44 lines):

diff -r a37dda0f0202 -r bc07f3764129 src/sim/debug.cc
--- a/src/sim/debug.cc  Mon Oct 05 13:13:23 2015 -0500
+++ b/src/sim/debug.cc  Wed Sep 02 13:34:19 2015 -0500
@@ -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<BreakPCEvent>(funcName,
+                                                "GDB scheduled break", true);
+}
+
 ///
 /// Function to cause the simulator to take a checkpoint from the debugger
 ///
diff -r a37dda0f0202 -r bc07f3764129 src/sim/debug.hh
--- a/src/sim/debug.hh  Mon Oct 05 13:13:23 2015 -0500
+++ b/src/sim/debug.hh  Wed Sep 02 13:34:19 2015 -0500
@@ -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
  */
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to