소스 검색

* the common code to all "-exec" gdb/mi commands moved to a single method

git-svn-id: trunk@29740 -
nickysn 10 년 전
부모
커밋
eb6c73c3df
1개의 변경된 파일15개의 추가작업 그리고 20개의 파일을 삭제
  1. 15 20
      ide/gdbmicon.pas

+ 15 - 20
ide/gdbmicon.pas

@@ -26,6 +26,8 @@ uses
 
 type
   TGDBController = object(TGDBInterface)
+  private
+    procedure RunExecCommand(const Cmd: string);
   protected
     TBreakNumber,
     start_break_number: LongInt;
@@ -121,53 +123,46 @@ begin
   Run;
 end;
 
-procedure TGDBController.Run;
+procedure TGDBController.RunExecCommand(const Cmd: string);
 begin
   UserScreen;
-  Command('-exec-run');
+  Command(Cmd);
   WaitForProgramStop;
 end;
 
+procedure TGDBController.Run;
+begin
+  RunExecCommand('-exec-run');
+end;
+
 procedure TGDBController.TraceStep;
 begin
-  UserScreen;
-  Command('-exec-step');
-  WaitForProgramStop;
+  RunExecCommand('-exec-step');
 end;
 
 procedure TGDBController.TraceNext;
 begin
-  UserScreen;
-  Command('-exec-next');
-  WaitForProgramStop;
+  RunExecCommand('-exec-next');
 end;
 
 procedure TGDBController.TraceStepI;
 begin
-  UserScreen;
-  Command('-exec-step-instruction');
-  WaitForProgramStop;
+  RunExecCommand('-exec-step-instruction');
 end;
 
 procedure TGDBController.TraceNextI;
 begin
-  UserScreen;
-  Command('-exec-next-instruction');
-  WaitForProgramStop;
+  RunExecCommand('-exec-next-instruction');
 end;
 
 procedure TGDBController.Continue;
 begin
-  UserScreen;
-  Command('-exec-continue');
-  WaitForProgramStop;
+  RunExecCommand('-exec-continue');
 end;
 
 procedure TGDBController.UntilReturn;
 begin
-  UserScreen;
-  Command('-exec-finish');
-  WaitForProgramStop;
+  RunExecCommand('-exec-finish');
 end;
 
 procedure TGDBController.SetTBreak(tbreakstring : string);