Browse Source

* gdb/mi: fixed inserting and stopping on access and read watchpoints

git-svn-id: trunk@29786 -
nickysn 10 years ago
parent
commit
c5b9465255
2 changed files with 14 additions and 1 deletions
  1. 8 1
      ide/gdbmicon.pas
  2. 6 0
      ide/gdbmiint.pas

+ 8 - 1
ide/gdbmicon.pas

@@ -196,7 +196,14 @@ begin
       Command('-break-watch -r ' + location);
       Command('-break-watch -r ' + location);
   end;
   end;
   if GDB.ResultRecord.Success then
   if GDB.ResultRecord.Success then
-    WatchpointInsert := GDB.ResultRecord.Parameters['wpt'].AsTuple['number'].AsLongInt
+    case WatchpointType of
+      wtWrite:
+        WatchpointInsert := GDB.ResultRecord.Parameters['wpt'].AsTuple['number'].AsLongInt;
+      wtReadWrite:
+        WatchpointInsert := GDB.ResultRecord.Parameters['hw-awpt'].AsTuple['number'].AsLongInt;
+      wtRead:
+        WatchpointInsert := GDB.ResultRecord.Parameters['hw-rwpt'].AsTuple['number'].AsLongInt;
+    end
   else
   else
     WatchpointInsert := 0;
     WatchpointInsert := 0;
 end;
 end;

+ 6 - 0
ide/gdbmiint.pas

@@ -332,6 +332,8 @@ Ignore:
       end;
       end;
     'breakpoint-hit',
     'breakpoint-hit',
     'watchpoint-trigger',
     'watchpoint-trigger',
+    'access-watchpoint-trigger',
+    'read-watchpoint-trigger',
     'end-stepping-range',
     'end-stepping-range',
     'function-finished':
     'function-finished':
       begin
       begin
@@ -343,6 +345,10 @@ Ignore:
           stop_breakpoint_number := GDB.ExecAsyncOutput.Parameters['bkptno'].AsLongInt;
           stop_breakpoint_number := GDB.ExecAsyncOutput.Parameters['bkptno'].AsLongInt;
         if StopReason = 'watchpoint-trigger' then
         if StopReason = 'watchpoint-trigger' then
           stop_breakpoint_number := GDB.ExecAsyncOutput.Parameters['wpt'].AsTuple['number'].AsLongInt;
           stop_breakpoint_number := GDB.ExecAsyncOutput.Parameters['wpt'].AsTuple['number'].AsLongInt;
+        if StopReason = 'access-watchpoint-trigger' then
+          stop_breakpoint_number := GDB.ExecAsyncOutput.Parameters['hw-awpt'].AsTuple['number'].AsLongInt;
+        if StopReason = 'read-watchpoint-trigger' then
+          stop_breakpoint_number := GDB.ExecAsyncOutput.Parameters['hw-rwpt'].AsTuple['number'].AsLongInt;
 
 
         Debuggee_started := True;
         Debuggee_started := True;
         current_pc := GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['addr'].AsPtrInt;
         current_pc := GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['addr'].AsPtrInt;