From 7624fc1fb461f1dd127763521d85f63e81617d71 Mon Sep 17 00:00:00 2001 From: Dylan Johnson Date: Fri, 9 Oct 2015 14:27:09 -0500 Subject: [PATCH] sim: Add relative break scheduling Add schedRelBreak() function, executable within a debugger, that sets a breakpoint by relative rather than absolute tick. --- src/sim/debug.cc | 6 ++++++ src/sim/debug.hh | 7 +++++++ 2 files changed, 13 insertions(+) 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 @@ -89,6 +89,12 @@ schedBreak(Tick when) warn("need to stop all queues"); } +void +schedRelBreak(Tick delta) +{ + schedBreak(curTick() + delta); +} + void breakAtKernelFunction(const char* funcName) { 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 @@ -44,6 +44,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 -- 2.30.2