[Lazarus] Generating line info

Martin lazarus at mfriebe.de
Mon Sep 19 20:03:19 CEST 2011


On 19/09/2011 18:43, Bart wrote:
> Hi,
>
> I noticed that in the linking tab, generating line info (-gl) is now
> coupled with Generate debugging info for gdb (-g) and this defaults to
> dwarf with sets.

You can always select any debug format you want.

I had recent conversations on the fpc-devel list, and obtained the 
following info from Jonas:

Any command-line switch starting with -g always includes "-g"  the 
exception is -g-  or any -g-xxx

-gl therefore always includes, and included -g
-gl triggers the inclusion of the lineinfo unit (or infodwrf), which can 
only work with debug info (stabs or dwarf)

Also according to Jonas (and fpc.exe -h) "-g" creates the "fpc default" 
debug info, which may or may  not be stabs.

So using only -gl in old lazarus, was equal to "-g -gl" which would have 
created stabs or dwarf, depending on what fpc thought to be right.

----
This fact, that -gl includes -g is no more evident in the lazarus 
settings. And that is the only thing that changed (and it will change 
for other settings -gv -gh too)

> Now when my app raises an exception I only get stack traces in this form:
> C:\Users\Bart\LazarusProjecten\bugs\SynEdit>se
> TApplication.HandleException Stupid exception
>    Stack trace:
>    $004222D0 line 36 of main.pp
>    $004E4F03 line 2286 of include/control.inc
>    $004F960F line 62 of include/buttoncontrol.inc
>    $004F9ADF line 174 of include/buttons.inc
>
> In the past (when only using -gl in the linking tab) this looked
> something like this:
>
> C:\Users\Bart\LazarusProjecten\bugs\SynEdit>se
> TApplication.HandleException Stupid exception
>    Stack trace:
>    $004222D0 TFORM1__BUTTON1CLICK, line 36 of main.pp
>    $004E4F03 TCONTROL__CLICK, line 2286 of include/control.inc
>    $004F960F TBUTTONCONTRL__CLICK, line 62 of include/buttoncontrol.inc
>    $004F9ADF TCUSTOMBUTTON__CLICK, line 174 of include/buttons.inc
>
> This form of stacktrace makes debugging so much easier then the one I
> am getting now.
>
> How can I get my stacktraces back to the style it was before?
>

Just set the debug info to stabs, and you should be fine.

BTW => dop you now the package "leak info" ?

It creates an entry in the tool menu.
And while originally for leak traces, it works with all stacktraces. (or 
at least it works with dwarf traces,, that is what I use)

You can either load a trace from file, or paste from clipboard, then you 
can simply click the lines, and it navigates you to the right source 
file (in some cases it may not find fpc units)






More information about the Lazarus mailing list