Browse Source

* handle properly stopping on a watchpoint in the gdb/mi debugger

git-svn-id: trunk@29748 -
nickysn 10 years ago
parent
commit
9f31c26996
1 changed files with 7 additions and 2 deletions
  1. 7 2
      ide/gdbmiint.pas

+ 7 - 2
ide/gdbmiint.pas

@@ -280,6 +280,7 @@ end;
 
 
 procedure TGDBInterface.WaitForProgramStop;
 procedure TGDBInterface.WaitForProgramStop;
 var
 var
+  StopReason: string;
   Line: LongInt;
   Line: LongInt;
   FileName: string = '';
   FileName: string = '';
   LineNumber: LongInt = 0;
   LineNumber: LongInt = 0;
@@ -293,13 +294,17 @@ begin
     exit;
     exit;
   end;
   end;
   ProcessResponse;
   ProcessResponse;
-  case GDB.ExecAsyncOutput.Parameters['reason'].AsString of
+  StopReason := GDB.ExecAsyncOutput.Parameters['reason'].AsString;
+  case StopReason of
     'breakpoint-hit',
     'breakpoint-hit',
+    'watchpoint-trigger',
     'end-stepping-range',
     'end-stepping-range',
     'function-finished':
     'function-finished':
       begin
       begin
-        if Assigned(GDB.ExecAsyncOutput.Parameters['bkptno']) then
+        if StopReason = 'breakpoint-hit' then
           stop_breakpoint_number := GDB.ExecAsyncOutput.Parameters['bkptno'].AsLongInt;
           stop_breakpoint_number := GDB.ExecAsyncOutput.Parameters['bkptno'].AsLongInt;
+        if StopReason = 'watchpoint-trigger' then
+          stop_breakpoint_number := GDB.ExecAsyncOutput.Parameters['wpt'].AsTuple['number'].AsLongInt;
         DebuggerScreen;
         DebuggerScreen;
         Debuggee_started := True;
         Debuggee_started := True;
         current_pc := GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['addr'].AsPtrInt;
         current_pc := GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['addr'].AsPtrInt;