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

Everton Vieira tonvieira at gmail.com
Tue Feb 21 13:07:50 CET 2012


Done the test, attached project , with -gl and the BackTraceStrFunc, i got the example in the wiki, here doesn`t show  the info only the address, i`m on a mac osx lion with the svn version installed.

Em 21/02/2012, às 07:18, Sven Barth escreveu:

> 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
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20120221/4414efe8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Exception.zip
Type: application/zip
Size: 129005 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20120221/4414efe8/attachment.zip>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20120221/4414efe8/attachment-0001.html>


More information about the fpc-pascal mailing list