[fpc-pascal] Re: Logging full runtime-error/exception backtrace

Sven Barth pascaldragon at googlemail.com
Tue Feb 21 10:18:21 CET 2012


Am 20.02.2012 23:37 schrieb "leledumbo" <leledumbo_cool at yahoo.co.id>:
>
> > The resolution of file and address can only be done if your code is a)
> compiled with debug info and b) some code is available that can
> translate the debug info to the output. The first is done by "-g", while
> the second is done by adding the "l" option. The latter adds the unit
> lineinfo or lnfodwrf depending on the debug format used by the compiler.
>
> I'm aware of a) and my thought for b) is that BackTraceStrFunc would do
it.
> But I got the same thing happened with Everton, the function doesn't
> translate debug info so all I get is simply addresses, without line
> information.

The BackTraceStrFunc by default points to SysBackTraceStr which just
converts addresses to strings. If you use "-gl" then one of the two
lineinfo units is included depending on the chosen format of the debug
info. This units in turn set BackTraceStrFunc to their own function, so
that line and file info is now part of the returned string. So the savest
way to ensure that BackTraceStrFunc returns more than just the address us
to use "-gl".

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20120221/bd6225d8/attachment.html>


More information about the fpc-pascal mailing list