[fpc-devel] debug info by FPC upsets GDB when step-over

Martin fpc at mfriebe.de
Mon Aug 13 21:43:09 CEST 2018


I am not sure when this started. It is certainly happening with fpc 
3.0.4 and trunk.
I do not know if it worked with earlier versions, but afaik user 
complaints only started since Lazarus was released with 3.0.4

- It happens with all versions of GDB. (So it is not something that 
changed in GDB, but may still be an issue in GDB / dont know)
- It only happens with 64 bit apps (I only tested on Windows).

When stepping through code (Lazarus trunk / different code may be needed 
for other versions, but it happens fairly frequent, so any bigger 
project should do)

procedure TForm1.FormCreate(Sender: TObject);
var
   a: String;
begin
   a := 'aa';   // breakpoint on this line
   Caption := a;
   Cascade;
end;

Pressing F8 (step over) on Cascade, GDB will actually enter the 
function. GDB seems to believe that some part of the Cascade function is 
part of FormCreate.

The following appears to fix it:|
objcopy.exe -R .debug_frame  project1.exe  project1n.exe

So there is something in debug_frame that upsets gdb.

That is all I know. Any idea?

|
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20180813/856b5e18/attachment.html>


More information about the fpc-devel mailing list