Good day.
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.
Thanks in advance.
P.S.
Sorry for my English.

Mailing lists / fpc-pascal / 2009-09
9 messages · 3 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Good day.
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.
Thanks in advance.
P.S.
Sorry for my English.
Alexey Voytsehovich wroteDo 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. There is no way to generate a map file with the line numbers for FPC.
Jonas
Hello Jonas,
Not. Prohibited by the laws of the company. :(
There is no way to generate a map file with the line numbers for FPC.
Do you plan this functional? Where can observe the development of any help?
Good day. Do not prompt way to generate map file with line numbers in source code? By…
Alexey Voytsehovich wroteDo 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.
When you compile with debuginfo on, (-gl) then the line-numbers appear in the backtrace. Is that enough for you?
Joost
Not. Prohibited by the laws of the company. :( Do you plan this functional? Where can…
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
$0000271C
$00002744
$00024720
$000026D0
$000023E0
$00001000
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>.
Jonas
Hello Jonas,
Yes, it looks like what I need. :) Another question, can I use gdb as a reference? That is, from the command line to send him a request and get an answer. To check each address automatically, but before work to run a script that will fill the necessary data file record.
if i use this
gdb testexcept.exe info line *0x004015c3
i get this
Excess command line arguments ignored. (line ...)
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-mingw32"...
\src\testexcept/info: No such file or directory.
You should be able to do this:
echo "info line *0x004015c3" > gdb.txt
gdb -batch --command=gdb.txt
gdb should then execute all commands in gdb.txt (so you can add more commands to that text file if you want), and then quit. It is possible that gdb will expect unix linebreaks instead of Dos/Windows line breaks in this command file though. In that case, you will probably have to convert the line breaks of the gdb.txt file before passing it to gdb (the easiest way to do that is probably using a self-written program, or by finding a Windows version of the dos2unix utility).
Jonas
Sorry,
gdb testexcept.exe -batch --command=gdb.txt
Jonas
You should be able to do this: echo "info line *0x004015c3" > gdb.txt gdb -batch…
Hello Jonas,
bigger tenx :)