mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-11 20:49:14 +02:00
* fixed crash when program being debugged in gdb/mi mode receives a signal or
exits due to a signal git-svn-id: trunk@29784 -
This commit is contained in:
parent
850a321a23
commit
7d040cbe3f
@ -290,12 +290,15 @@ begin
|
||||
end;
|
||||
|
||||
procedure TGDBInterface.WaitForProgramStop;
|
||||
label
|
||||
Ignore;
|
||||
var
|
||||
StopReason: string;
|
||||
Line: LongInt;
|
||||
FileName: string = '';
|
||||
LineNumber: LongInt = 0;
|
||||
begin
|
||||
Ignore:
|
||||
GDB.WaitForProgramStop;
|
||||
if not GDB.Alive then
|
||||
begin
|
||||
@ -307,6 +310,16 @@ begin
|
||||
ProcessResponse;
|
||||
StopReason := GDB.ExecAsyncOutput.Parameters['reason'].AsString;
|
||||
case StopReason of
|
||||
'signal-received':
|
||||
begin
|
||||
{ TODO: maybe show information to the user about the signal
|
||||
we have:
|
||||
GDB.ExecAsyncOutput.Parameters['signal-name'].AsString (e.g. 'SIGTERM')
|
||||
GDB.ExecAsyncOutput.PArameters['signal-meaning'].AsString (e.g. 'Terminated')
|
||||
}
|
||||
i_gdb_command('-exec-continue');
|
||||
goto Ignore;
|
||||
end;
|
||||
'breakpoint-hit',
|
||||
'watchpoint-trigger',
|
||||
'end-stepping-range',
|
||||
@ -329,6 +342,18 @@ begin
|
||||
LineNumber := GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['line'].AsLongInt;
|
||||
DoSelectSourceLine(FileName, LineNumber);
|
||||
end;
|
||||
'exited-signalled':
|
||||
begin
|
||||
DebuggerScreen;
|
||||
current_pc := 0;
|
||||
Debuggee_started := False;
|
||||
{ TODO: maybe show information to the user about the signal
|
||||
we have:
|
||||
GDB.ExecAsyncOutput.Parameters['signal-name'].AsString (e.g. 'SIGTERM')
|
||||
GDB.ExecAsyncOutput.PArameters['signal-meaning'].AsString (e.g. 'Terminated')
|
||||
}
|
||||
DoEndSession(1);
|
||||
end;
|
||||
'exited':
|
||||
begin
|
||||
DebuggerScreen;
|
||||
|
Loading…
Reference in New Issue
Block a user