[fpc-pascal] Debug information
Martin
lazarus at mfriebe.de
Tue Sep 11 17:38:44 CEST 2012
On 11/09/2012 16:07, Rainer Stratmann wrote:
>> 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.
You load the lib dynamically? e.g OpenLibrary?
If it is hardlinked (procedure ... external) then this changes the exe,
and the linker may move stuff around (including debug info, and maybe
debug info gets broken).
On some platform samrtlinking, also has a real risk of breaking debug
info...
If it is via OpenLibrary (e.g. you can control the usage via commandline
switch, and therefore truly have the same exe, then I do not know...
There may be other reasons, that I do not know of.
You can always (not sure if it works for PIE / position independent)
take the address, and have gdb check, if it can be resolved).
>> 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?
>
Missing recovery in the implementation...
Now this is from memory. double check it..... I may well remember this
wrong.
Basically, if an error happens (exception) during a trace is printed,
then this could lead to a new trace, a new error, a new trace ... a
stackoverflow.
So during a trace, the pointer to the trace prog, is set to the basic
"address only" prog.
Unfortunately there is no distinction between errors. So not finding a
line is an error (IIRC it is handled the same as if dbg info is
invalid/broken), and that is the end...
More information about the fpc-pascal
mailing list