diff --git a/Documentation/cli/starlark.md b/Documentation/cli/starlark.md index c57f7b227977ac5b1c195dacbe3758d7ababfd3c..f163eac1203c2b483972c6ab58a3f36f4ca53e6b 100644 --- a/Documentation/cli/starlark.md +++ b/Documentation/cli/starlark.md @@ -292,3 +292,18 @@ Example use (find the first element of slice 's2' with field A equal to 5): print("not found") ``` + +## Rerunning a program until it fails or hits a breakpoint + +``` +def command_flaky(args): + "Continues and restarts the target program repeatedly (re-recording it on the rr backend), until a breakpoint is hit" + count = 1 + while True: + if dlv_command("continue") == None: + break + print("restarting", count, "...") + count = count+1 + restart(Rerecord=True) + +```