FpDebug: Added step-over and next commands to console-example (fpd)

git-svn-id: trunk@44798 -
This commit is contained in:
joost 2014-04-23 19:55:05 +00:00
parent b9ff1d385e
commit f677379864
2 changed files with 29 additions and 8 deletions

View File

@ -284,7 +284,7 @@ begin
CallProcessLoop:=true;
end;
procedure HandleNext(AParams: String; out CallProcessLoop: boolean);
procedure HandleNextInst(AParams: String; out CallProcessLoop: boolean);
begin
CallProcessLoop:=false;
if not assigned(GController.MainProcess)
@ -296,6 +296,30 @@ begin
CallProcessLoop:=true;
end;
procedure HandleNext(AParams: String; out CallProcessLoop: boolean);
begin
CallProcessLoop:=false;
if not assigned(GController.MainProcess)
then begin
WriteLN('The process is not paused');
Exit;
end;
GController.Next;
CallProcessLoop:=true;
end;
procedure HandleStepInst(AParams: String; out CallProcessLoop: boolean);
begin
CallProcessLoop:=false;
if not assigned(GController.MainProcess)
then begin
WriteLN('The process is not paused');
Exit;
end;
GController.StepIntoInstr;
CallProcessLoop:=true;
end;
procedure HandleList(AParams: String; out CallProcessLoop: boolean);
begin
WriteLN('not implemented: list');
@ -727,7 +751,9 @@ begin
MCommands.AddCommand(['break', 'b'], @HandleBreak, 'break [-d] <adress>|<filename:line>: Set a breakpoint at <adress> or <filename:line>. -d removes');
MCommands.AddCommand(['continue', 'cont', 'c'], @HandleContinue, 'continue: Continues execution');
MCommands.AddCommand(['kill', 'k'], @HandleKill, 'kill: Stops execution of the debuggee');
MCommands.AddCommand(['next', 'n'], @HandleNext, 'next: Steps one instruction');
MCommands.AddCommand(['step-inst', 'si'], @HandleStepInst, 'step: Steps-into one instruction');
MCommands.AddCommand(['next-inst', 'ni'], @HandleNextInst, 'next: Steps-over one instruction');
MCommands.AddCommand(['next', 'n'], @HandleNext, 'next: Steps one line');
MCommands.AddCommand(['list', 'l'], @HandleList, 'list [<adress>|<location>]: Lists the source for <adress> or <location>');
MCommands.AddCommand(['memory', 'mem', 'm'], @HandleMemory, 'memory [-<size>] [<adress> <count>|<location> <count>]: Dump <count> (default: 1) from memory <adress> or <location> (default: current) of <size> (default: 4) bytes, where size is 1,2,4,8 or 16.');
MCommands.AddCommand(['writememory', 'w'], @HandleWriteMemory, 'writememory [<adress> <value>]: Write <value> (with a length of 4 bytes) into memory at address <adress>.');

View File

@ -167,15 +167,10 @@ end;
procedure TFPDLoop.GControllerHitBreakpointEvent(var continue: boolean; const Breakpoint: TDbgBreakpoint);
begin
if assigned(Breakpoint) then
if not continue then
begin
ShowCode;
ShowDisas;
continue:=false;
end
else
begin
continue:=true;
end;
end;