Browse Source

+ Check success in TGDBController.StartTrace to avoid SIGSEGV
+ Handle failure in TGDBController.LoadFile

git-svn-id: trunk@29992 -

pierre 10 years ago
parent
commit
e4887f22b6
1 changed files with 7 additions and 0 deletions
  1. 7 0
      ide/gdbmicon.pas

+ 7 - 0
ide/gdbmicon.pas

@@ -167,6 +167,8 @@ end;
 procedure TGDBController.StartTrace;
 procedure TGDBController.StartTrace;
 begin
 begin
   Command('-break-insert -t PASCALMAIN');
   Command('-break-insert -t PASCALMAIN');
+  if not GDB.ResultRecord.Success then
+    exit;
   start_break_number := GDB.ResultRecord.Parameters['bkpt'].AsTuple['number'].AsLongInt;
   start_break_number := GDB.ResultRecord.Parameters['bkpt'].AsTuple['number'].AsLongInt;
   Run;
   Run;
 end;
 end;
@@ -404,6 +406,11 @@ begin
   GDBErrorBuf.Reset;
   GDBErrorBuf.Reset;
   UnixDir(fn);
   UnixDir(fn);
   Command('-file-exec-and-symbols ' + fn);
   Command('-file-exec-and-symbols ' + fn);
+  if not GDB.ResultRecord.Success then
+    begin
+      LoadFile:=false;
+      exit;
+    end;
   { the register list may change *after* loading a file, because there }
   { the register list may change *after* loading a file, because there }
   { are gdb versions that support multiple archs, e.g. i386 and x86_64 }
   { are gdb versions that support multiple archs, e.g. i386 and x86_64 }
   UpdateRegisterNames;               { so that's why we update it here }
   UpdateRegisterNames;               { so that's why we update it here }