Sign in Join

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

Mailing lists / fpc-devel / 2026-06

line info for try finally except -> jumping forward and backward

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

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

Martin Frb

FPC generates the nodes for try blocks with just one line info => the line of the "try" statement.
Any code generated in addition (such as for the finally, except, or end) is generated with that line number.

That includes the implicit statement in begin/end (which is why stepping fpc code jumps to begin, before exiting at end...)

I have tried to find and fix the code generating those lines. https://gitlab.com/freepascal.org/fpc/source/-/work_items/41801

Though this is a part of the compiler I have not looked at before, and I am not familiar with. Hence this will please need some review.

Doing some testing on Win-32, Win-64 (and Linux-64) has not shown any issues with the modified code.

----------
Mind that when testing, stepping on the "end;" line of a procedure still takes several steps. That needs to be worked around in the debugger. Since there is a call to a separate function (the $fin_*). The function is on the same line, but currently all stepping takes a new function as new line (even if it is not).

Reply by email