[fpc-pascal] map file

Jonas Maebe jonas.maebe at elis.ugent.be
Thu Sep 24 10:47:10 CEST 2009

On 24 Sep 2009, at 10:37, Alexey Voytsehovich wrote:

>> On 24 Sep 2009, at 10:14, Alexey Voytsehovich wrote:
>>> Do not prompt way to generate map file with line numbers in source
>>> code? By analogy with Delphi. Since not get to the addresses in the
>>> Call Stack to get a line in the source code.
>> Compile your program with -gl to get line numbers next to the call
>> stack addresses.
> Not. Prohibited by the laws of the company. :(

Ok, so it is for distributed program. Compile the program with -g,  
keep the original copy for yourself and run "strip" on the copy that  
you distribute to your users. When you get a backtrace from a user,  
like this:

Runtime error 216 at $0000271C

then you can look up the addresses in gdb:

gdb my-program-compiled-with-g-and-not-stripped
(gdb) info line *0x0000271C
Line 6 of "tt.pp" starts at address 0x2714 <TEST+20> and ends at  
0x2720 <TEST+32>.


More information about the fpc-pascal mailing list