mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 23:49:07 +02:00
* fixed crash when stepping into code where no debug information is available
(can happen when using 'step into instruction' inside the assembly window) * obtain the PC counter after a breakpoint has been hit (so that the assembly window shows the current instruction immediately after hitting a breakpoint) git-svn-id: trunk@29735 -
This commit is contained in:
parent
dc54903e01
commit
88fc22a8a3
@ -272,6 +272,8 @@ end;
|
|||||||
procedure TGDBInterface.WaitForProgramStop;
|
procedure TGDBInterface.WaitForProgramStop;
|
||||||
var
|
var
|
||||||
Line: LongInt;
|
Line: LongInt;
|
||||||
|
FileName: string = '';
|
||||||
|
LineNumber: LongInt = 0;
|
||||||
begin
|
begin
|
||||||
GDB.WaitForProgramStop;
|
GDB.WaitForProgramStop;
|
||||||
if not GDB.Alive then
|
if not GDB.Alive then
|
||||||
@ -283,26 +285,20 @@ begin
|
|||||||
end;
|
end;
|
||||||
ProcessResponse;
|
ProcessResponse;
|
||||||
case GDB.ExecAsyncOutput.Parameters['reason'].AsString of
|
case GDB.ExecAsyncOutput.Parameters['reason'].AsString of
|
||||||
'breakpoint-hit':
|
'breakpoint-hit',
|
||||||
begin
|
'end-stepping-range',
|
||||||
stop_breakpoint_number := GDB.ExecAsyncOutput.Parameters['bkptno'].AsLongInt;
|
|
||||||
DebuggerScreen;
|
|
||||||
Debuggee_started := True;
|
|
||||||
DoSelectSourceLine(GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['fullname'].AsString, GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['line'].AsLongInt);
|
|
||||||
end;
|
|
||||||
'end-stepping-range':
|
|
||||||
begin
|
|
||||||
DebuggerScreen;
|
|
||||||
Debuggee_started := True;
|
|
||||||
current_pc := GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['addr'].AsPtrInt;
|
|
||||||
DoSelectSourceLine(GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['fullname'].AsString, GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['line'].AsLongInt);
|
|
||||||
end;
|
|
||||||
'function-finished':
|
'function-finished':
|
||||||
begin
|
begin
|
||||||
|
if Assigned(GDB.ExecAsyncOutput.Parameters['bkptno']) then
|
||||||
|
stop_breakpoint_number := GDB.ExecAsyncOutput.Parameters['bkptno'].AsLongInt;
|
||||||
DebuggerScreen;
|
DebuggerScreen;
|
||||||
Debuggee_started := True;
|
Debuggee_started := True;
|
||||||
current_pc := GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['addr'].AsPtrInt;
|
current_pc := GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['addr'].AsPtrInt;
|
||||||
DoSelectSourceLine(GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['fullname'].AsString, GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['line'].AsLongInt);
|
if Assigned(GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['fullname']) then
|
||||||
|
FileName := GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['fullname'].AsString;
|
||||||
|
if Assigned(GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['line']) then
|
||||||
|
LineNumber := GDB.ExecAsyncOutput.Parameters['frame'].AsTuple['line'].AsLongInt;
|
||||||
|
DoSelectSourceLine(FileName, LineNumber);
|
||||||
end;
|
end;
|
||||||
'exited':
|
'exited':
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user