[fpc-pascal] Debug information

Rainer Stratmann RainerStratmann at t-online.de
Tue Sep 11 17:07:30 CEST 2012


Am Tuesday 11 September 2012 14:16:35 schrieb Martin:
> On 11/09/2012 10:28, Rainer Stratmann wrote:
> > I found out that there is no line information shown (-gl) if an error
> > occurs (more or less shortly) after the program loads a dynamic library.
> >
> > This same behaviour happens with fpc version 2.4.2-0 and 2.6.0.
> >
> > If no library is loaded line information is shown.
> > The error adresses are the same in both cases.
>
> This is about debug info written by "DumpStack" or similar (written by
> the exe itself, to the console)?
>
> Or debug info shown by gdb using "bt"?
> If the first, does the latter work?

?
It is a console program with graphic output to the framebuffer.
When loading succesfully the library (which depends on the x11 library) the 
framebuffer is written to an XWindow (Linux). The software runs with a plain 
(embedded) linux and also in an XWindow environment.

I have only the information of what the exe program writes down in case of an 
error. No other debug tool is used by now. Specially when the program runs 
outside it will be not easy to use additional tools, I think.

> As from your other replies, the exception occurs in your pascal code.
> But is this code in a callback from the DLL?
(Linux Library *.so)
No.
> (This would mean that 
> stackframes of the DLL exist, and they have no line info)

> Or could for any other reason (including compiled with optimization)
> there be a stackframe (just one) that has no line info?

May be.

> IIRC the line-info on stacktraces is only displayed until the very first
> time a line without info is discovered.
> That is:
> 1) If within the current stackdump a line without info is discovered,
> then no further line will be attempted to be resolved (even if info
> could be available)

With not loading the library it shows all lines correctly.

> 2) If in a previous dump, such a line was discovered, then in any
> further dump (even though unrelated) no line info is printed.

But why are the lines not shown if there is only one line without info?

> In Lazarus the leak view, can attempt to resolve such traces. It
> requires the exact exe with debug info.



More information about the fpc-pascal mailing list