[fpc-devel] dwarf line info and try finally

Martin Frb lazarus at mfriebe.de
Sun Apr 20 20:06:04 CEST 2014

I added some code to the debugger, to allow stepping from a risen 
exception, to a finally or except block.
And also to step correctly from the end of finally (reraise) to the next 

However, the compiler does not add lineinfo for the finally 
(FPC_POPADDRSTACK) or the end (reraise) statement.

This means:
1) When stepping into an finaly/except block (the IDE does this by 
breaking in FPC_POPADDRSTACK and step out one) then the execution point 
is still in the last statement before the finally/except. This is 
because fpc added the FPC_POPADDRSTACK to the last statement in the try 

2) If stepping ove the last command in a try/finally (entered as result 
of an exception) then the ReRaise is part of the last statement. 
Stepping over the last statement, will trigger the Reraise (and go to 
the next finally/except)

Both are cosmetic, and the 2nd can even be seen as correct (though 
probably not expected by many users).
Therefore would it be possible/acceptable to generate line info for the 
except/finally/end ?

Or point 1 might also be solvable by starting the line info of the first 
command in the try/finally before the FPC_POPADDRSTACK

Any ideas?

Also any ideas, if there is a way to identify implicit finally? 
Currently one has to step through all of them.

More information about the fpc-devel mailing list