mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-22 11:49:17 +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;
|
end;
|
||||||
|
|
||||||
procedure TGDBInterface.WaitForProgramStop;
|
procedure TGDBInterface.WaitForProgramStop;
|
||||||
|
label
|
||||||
|
Ignore;
|
||||||
var
|
var
|
||||||
StopReason: string;
|
StopReason: string;
|
||||||
Line: LongInt;
|
Line: LongInt;
|
||||||
FileName: string = '';
|
FileName: string = '';
|
||||||
LineNumber: LongInt = 0;
|
LineNumber: LongInt = 0;
|
||||||
begin
|
begin
|
||||||
|
Ignore:
|
||||||
GDB.WaitForProgramStop;
|
GDB.WaitForProgramStop;
|
||||||
if not GDB.Alive then
|
if not GDB.Alive then
|
||||||
begin
|
begin
|
||||||
@ -307,6 +310,16 @@ begin
|
|||||||
ProcessResponse;
|
ProcessResponse;
|
||||||
StopReason := GDB.ExecAsyncOutput.Parameters['reason'].AsString;
|
StopReason := GDB.ExecAsyncOutput.Parameters['reason'].AsString;
|
||||||
case StopReason of
|
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',
|
'breakpoint-hit',
|
||||||
'watchpoint-trigger',
|
'watchpoint-trigger',
|
||||||
'end-stepping-range',
|
'end-stepping-range',
|
||||||
@ -329,6 +342,18 @@ begin
|
|||||||
LineNumber := GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['line'].AsLongInt;
|
LineNumber := GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['line'].AsLongInt;
|
||||||
DoSelectSourceLine(FileName, LineNumber);
|
DoSelectSourceLine(FileName, LineNumber);
|
||||||
end;
|
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':
|
'exited':
|
||||||
begin
|
begin
|
||||||
DebuggerScreen;
|
DebuggerScreen;
|
||||||
|
Loading…
Reference in New Issue
Block a user