[fpc-pascal] Debug information

Martin lazarus at mfriebe.de
Mon May 28 22:09:21 CEST 2012


On 28/05/2012 20:35, Rainer Stratmann wrote:
> Am Monday 28 May 2012 21:12:30 schrieb Martin:
>> On 27/05/2012 13:32, Rainer Stratmann wrote:
>>> How to get debug information?
>>>
>>> There is an error, but only adresses are shown.
>> How/ Where are the addresses shown?
> The addresses were shown in the output window (console).
> Runtime error 207 at $0808BE90
>          $0808BE90
Ok: those addresses *should* get names, if you compile with -gl  AND do 
not in any form strip (strip.exe removes the debug info) your app

An app containing debug info has a considerable bigger exe.
(can be 10 times or more as big as without)

if you make a copy of your exe, and run
   strip[.exe]  the_copy

the the copy should be much smaller
On windows strip.exe is in the fpc bin  directory

>
>> BUT only up to the very first time it does encounter an address that can
>> not be resolved. Once that has happened no further addresses are resolved.
> I do not understand exactly what that means.
>

If you get it to work, and one of the addresses is in the RTL (assuming 
your RTL has no dobug info), or in the kernel then the translation 
simply stops.
It could be that the top address is in the rtl, then you will never get 
the info


you can use gdb (assuming there is debug info / check the exe size)
    gdb your_exe

and inside gdb
   info symbol *0x0808BE90

Not all symbols may resolve though

------------------
You can (again assume debug info) run in gdb

gdb  your_exe

break  FPC_RUNERROR
r

and when stopped
bt





More information about the fpc-pascal mailing list