ENABLE {
FakeCirio.Cant => Fail[Rope.Concat["FakeCirio.Cant: ", message]];
Breakpoint.CantSet => Fail[Rope.Concat["Breakpoint.CantSet: ", message]];
Breakpoint.Cant => Fail[Rope.Concat["Breakpoint.Cant: ", message]];
BreakWorldArchitecture.Cant => Fail[Rope.Concat["BreakWorldArchitecture.Cant: ", message]];
Convert.Error => Fail["Illegal offset specified"];
};
IF arg #
NIL
AND CommanderOps.NextArgument[cmd] =
NIL
THEN {
toSign: INT ~ Rope.SkipTo[arg, 0, "+-"];
procName: ROPE ~ Rope.Substr[arg, 0, toSign];
offset: INT ~ IF toSign = Rope.Size[arg] THEN 0 ELSE Convert.IntFromRope[Rope.Substr[arg, toSign]];
breakpointBaseAddress: BreakWorldArchitecture.Address ~
IF Rope.Size[procName] # 0
THEN FakeCirio.GetProcAddress[
breakWorld: breakWorld, procName: procName] ELSE BreakWorldArchitecture.nullAddress;
breakpointAddress: BreakWorldArchitecture.Address ~ BreakWorldArchitecture.AddressFromDisplacement[breakpointBaseAddress, offset];
breakProcedureAddress: BreakWorldArchitecture.Address ~ FakeCirio.GetProcAddress[
breakWorld: breakWorld, procName: nameSpyTraceBreakProc];
break: Breakpoint.Break ¬ Breakpoint.SetBreakpoint[
address: breakpointAddress, clientData: NIL,
breakProc: breakProcedureAddress, breakData: 0];
breaks ¬ CONS[break, breaks];
{
address: TargetArchitecture.Address ~ Breakpoint.AddressFromBreak[break].address;
IO.PutF1[cmd.out, "Break set at pc=0%08xH\n", [cardinal[LOOPHOLE[address]]]];
RETURN;
};
};