summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Johnson <Dylan.Johnson@ARM.com>2015-10-09 14:27:09 -0500
committerDylan Johnson <Dylan.Johnson@ARM.com>2015-10-09 14:27:09 -0500
commit7624fc1fb461f1dd127763521d85f63e81617d71 (patch)
tree6f05f6cfcbeeea97ec3af35c21f04e14382b49c5
parent90c279e4b1ddb87780b667ccec6bda64e6a77b96 (diff)
downloadgem5-7624fc1fb461f1dd127763521d85f63e81617d71.tar.xz
sim: Add relative break scheduling
Add schedRelBreak() function, executable within a debugger, that sets a breakpoint by relative rather than absolute tick.
-rw-r--r--src/sim/debug.cc6
-rw-r--r--src/sim/debug.hh7
2 files changed, 13 insertions, 0 deletions
diff --git a/src/sim/debug.cc b/src/sim/debug.cc
index b3d73eff7..9fab75108 100644
--- a/src/sim/debug.cc
+++ b/src/sim/debug.cc
@@ -90,6 +90,12 @@ schedBreak(Tick when)
}
void
+schedRelBreak(Tick delta)
+{
+ schedBreak(curTick() + delta);
+}
+
+void
breakAtKernelFunction(const char* funcName)
{
System* curSystem = System::systemList[0];
diff --git a/src/sim/debug.hh b/src/sim/debug.hh
index 0d324698d..8587325e1 100644
--- a/src/sim/debug.hh
+++ b/src/sim/debug.hh
@@ -45,6 +45,13 @@
void schedBreak(Tick when);
/**
+ * Cause the simulator to execute a breakpoint
+ * relative to the current tick.
+ * @param delta the number of ticks to execute until breaking
+ */
+void schedRelBreak(Tick delta);
+
+/**
* 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