Browse Source

* fixed Run->"Until return" in the GDB/MI debugger

git-svn-id: trunk@29717 -
nickysn 10 years ago
parent
commit
8f9c062e4d
4 changed files with 23 additions and 1 deletions
  1. 1 1
      ide/fpdebug.pas
  2. 8 0
      ide/gdbmicon.pas
  3. 7 0
      ide/gdbmiint.pas
  4. 7 0
      packages/gdbint/src/gdbcon.pp

+ 1 - 1
ide/fpdebug.pas

@@ -1014,7 +1014,7 @@ end;
 
 procedure TDebugController.UntilReturn;
 begin
-  Command('finish');
+  inherited UntilReturn;
   UpdateDebugViews;
   { We could try to get the return value !
     Not done yet }

+ 8 - 0
ide/gdbmicon.pas

@@ -47,6 +47,7 @@ type
     procedure TraceStepI;
     procedure TraceNextI;
     procedure Continue; virtual;
+    procedure UntilReturn; virtual;
     function LoadFile(var fn: string): Boolean;
     procedure SetDir(const s: string);
     procedure SetArgs(const s: string);
@@ -155,6 +156,13 @@ begin
   WaitForProgramStop;
 end;
 
+procedure TGDBController.UntilReturn;
+begin
+  UserScreen;
+  Command('-exec-finish');
+  WaitForProgramStop;
+end;
+
 function TGDBController.LoadFile(var fn: string): Boolean;
 var
   cmd: string;

+ 7 - 0
ide/gdbmiint.pas

@@ -291,6 +291,13 @@ begin
         current_pc := GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['addr'].AsPtrInt;
         DoSelectSourceLine(GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['fullname'].AsString, GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['line'].AsLongInt);
       end;
+    'function-finished':
+      begin
+        DebuggerScreen;
+        Debuggee_started := True;
+        current_pc := GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['addr'].AsPtrInt;
+        DoSelectSourceLine(GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['fullname'].AsString, GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['line'].AsLongInt);
+      end;
     'exited':
       begin
         DebuggerScreen;

+ 7 - 0
packages/gdbint/src/gdbcon.pp

@@ -47,6 +47,7 @@ type
     procedure TraceStepI;virtual;
     procedure TraceNextI;virtual;
     procedure Continue;virtual;
+    procedure UntilReturn;virtual;
     { needed for dos because newlines are only #10 (PM) }
     procedure WriteErrorBuf;
     procedure WriteOutputBuf;
@@ -295,6 +296,12 @@ begin
 end;
 
 
+procedure TGDBController.UntilReturn;
+begin
+  Command('finish');
+end;
+
+
 procedure TGDBController.ClearSymbols;
 begin
   if debuggee_started then