Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2018-03

Why debugger does not "step in"?

7 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Gennady Agranov

Hi,

I use FPC 3.0.4 / Lazarus 1.8.2

I am seeing the same behavior when I debug the program using Lazarus IDE under Win64 and Linux64

When I want to "step in" into my own function/procedure - GDB simply steps over...

If I set a breakpoint inside the function/procedure I want to "step in" and "run" - it would stop at this breakpoint.

I have all debug options enabled...

It is hard to debug if you can't "step in".

Do I miss some settings?

Thanks,

Gennady

Reply by email

Martin Frb
to Gennady Agranov
Gennady Agranov wrote 12 lines
Hi, I use FPC 3.0.4 / Lazarus 1.8.2 I am seeing the same behavior when I debug the program using Lazarus IDE under Win64 and Linux64 When I want to "step in" into my own function/procedure - GDB simply steps over... If I set a breakpoint inside the function/procedure I want to "step in" and "run" - it would stop at this breakpoint.

It isn't a method of an "interface"? interfaces indeed have this issue.

But if it is a normal procedure, then this is odd.  A few things you can try:

- On Windows, use an external linker (option -Xe)
- Try stabs vs Dwarf (Project Options > Debugging)
- Do NOT use smart linking
- Do NOT use any optimization -O...
- Try a diff version of gdb
- Try an older fpc (but keep all else the same). So you know if it is an issue with current fpc.

I also found a bug report https://bugs.freepascal.org/view.php?id=31599 that may or may not be related.

Someone recently reported they had the opposite problem, where the debugger would step in, when they actually stepped over. Not sure if related.

Reply by email

Gennady Agranov
to Martin Frb
>> It isn't a method of an "interface"? interfaces indeed have this

issue.

It is the case - thanks!

Is it "nothing can be done about it" case?

Is there an already submitted bug?

Thanks,
Gennady

Martin Frb wrote 37 lines
On 24/03/18 02:24, Gennady Agranov wrote: > Hi, > > I use FPC 3.0.4 / Lazarus 1.8.2 > > I am seeing the same behavior when I debug the program using Lazarus > IDE under Win64 and Linux64 > > When I want to "step in" into my own function/procedure - GDB simply > steps over... > > If I set a breakpoint inside the function/procedure I want to "step > in" and "run" - it would stop at this breakpoint. It isn't a method of an "interface"? interfaces indeed have this issue. But if it is a normal procedure, then this is odd.  A few things you can try: - On Windows, use an external linker (option -Xe) - Try stabs vs Dwarf (Project Options > Debugging) - Do NOT use smart linking - Do NOT use any optimization -O... - Try a diff version of gdb - Try an older fpc (but keep all else the same). So you know if it is an issue with current fpc. I also found a bug report https://bugs.freepascal.org/view.php?id=31599 that may or may not be related. Someone recently reported they had the opposite problem, where the debugger would step in, when they actually stepped over. Not sure if related. _______________________________________________ fpc-devel maillist  -  http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Martin Frb
to Gennady Agranov
Gennady Agranov wrote 8 lines
>>> It isn't a method of an "interface"? interfaces indeed have this issue. It is the case - thanks! Is it "nothing can be done about it" case? Is there an already submitted bug?

Not sure if there is a bug report. I am not even sure if this is:
- an issue in gdb
- an issue with the debug info generated by fpc

From very far memory.... fpc generates some kind of "jump table" (actually it may be a bit more than a jump table) for each class that implements an interface.
Calling a method of an interface first calls the code in that table, and then goes to the actual method.
gdb somehow thinks that the code in the table can not be stepped, and skips the entire call.

Maybe fpc could add debug info, not sure what is available in each of the stabs/dwarf2/3 standards that could be used to tell gdb.

Btw, have you tried dwarf 3? I never tested, so maybe.... / But be aware, dwarf3 has other instabilities (gdb crashes)

Reply by email

Jonas Maebe
to Martin Frb
Martin Frb wrote 13 lines
On 24/03/18 17:58, Gennady Agranov wrote: > >>> It isn't a method of an "interface"? interfaces indeed have this > issue. > > It is the case - thanks! > > Is it "nothing can be done about it" case? > > Is there an already submitted bug? Not sure if there is a bug report. I am not even sure if this is: - an issue in gdb - an issue with the debug info generated by fpc

https://bugs.freepascal.org/view.php?id=14399

Jonas

Reply by email