+ Check success in TGDBController.StartTrace to avoid SIGSEGV

+ Handle failure in TGDBController.LoadFile

git-svn-id: trunk@29992 -
This commit is contained in:
pierre 2015-02-24 16:22:53 +00:00
parent eeda87007e
commit e4887f22b6

View File

@ -167,6 +167,8 @@ end;
procedure TGDBController.StartTrace;
begin
Command('-break-insert -t PASCALMAIN');
if not GDB.ResultRecord.Success then
exit;
start_break_number := GDB.ResultRecord.Parameters['bkpt'].AsTuple['number'].AsLongInt;
Run;
end;
@ -404,6 +406,11 @@ begin
GDBErrorBuf.Reset;
UnixDir(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 }
{ are gdb versions that support multiple archs, e.g. i386 and x86_64 }
UpdateRegisterNames; { so that's why we update it here }