Discussion:
debug info by FPC upsets GDB when step-over
(too old to reply)
Martin
2018-08-13 19:43:09 UTC
Permalink
Raw Message
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?

|
Loading...