map file

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

map file

Alexey Voytsehovich
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.

--
Best regards,
 Alexey Voytsehovich                          mailto:[hidden email]

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: map file

Jonas Maebe-2

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. There is no way to generate a map file with the line  
numbers for FPC.


Jonas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: map file

Alexey Voytsehovich
Hello Jonas,

Thursday, September 24, 2009, 11:33:29 AM, you 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. :(

> 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?

--
Best regards,
 Alexey Voytsehovich                            mailto:[hidden email]

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: map file

Joost van der Sluis
In reply to this post by Alexey Voytsehovich
On Thu, 2009-09-24 at 11:14 +0300, 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.

When you compile with debuginfo on, (-gl) then the line-numbers appear
in the backtrace. Is that enough for you?

Joost

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: map file

Jonas Maebe-2
In reply to this post by Alexey Voytsehovich

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
   $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
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: map file

Alexey Voytsehovich
Hello Jonas,

Thursday, September 24, 2009, 11:47:10 AM, you wrote:

> 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>.

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.


--
Best regards,
 Alexey Voytsehovich                            mailto:[hidden email]

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: map file

Jonas Maebe-2

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

> 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

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
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: map file

Jonas Maebe-2

On 24 Sep 2009, at 11:04, Jonas Maebe wrote:

> On 24 Sep 2009, at 10:59, Alexey Voytsehovich wrote:
>
>> gdb testexcept.exe info line *0x004015c3
>
> You should be able to do this:
>
> echo "info line *0x004015c3" > gdb.txt
> gdb -batch --command=gdb.txt

Sorry,

gdb testexcept.exe -batch --command=gdb.txt


Jonas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: map file

Alexey Voytsehovich
In reply to this post by Jonas Maebe-2
Hello Jonas,

Thursday, September 24, 2009, 12:04:20 PM, you wrote:


> On 24 Sep 2009, at 10:59, Alexey Voytsehovich wrote:

>> 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

> You should be able to do this:

> echo "info line *0x004015c3" > gdb.txt
> gdb -batch --command=gdb.txt

bigger tenx :)

--
Best regards,
 Alexey Voytsehovich                            mailto:[hidden email]

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal