mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-30 09:42:55 +02:00
+ Check success in TGDBController.StartTrace to avoid SIGSEGV
+ Handle failure in TGDBController.LoadFile git-svn-id: trunk@29992 -
This commit is contained in:
parent
eeda87007e
commit
e4887f22b6
@ -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 }
|
||||||
|
Loading…
Reference in New Issue
Block a user