Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2013-07

problem with dwarf inn fpc trunk (DW_AT_location)

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin

fpc revision 25146 (windows 32 bit internal linker or -XE)

It seems that fpc does for some variable produce a DW_AT_location that no GDB (tested various from 6.3 to 7.5 on 32 bit win) understands. I do of course not know, if gdb is wrong, or fpc.

In Lazarus is a small app debugger\test\Gdbmi\TestApps\ArgVPrg.pas (also attached to the mail)
compiled with (using 2.6.2 and trunk)
fpc.exe -gw -oArgVPas.exe ArgVPrg.pas

then using
objdump --dwarf

2.6.2
<1><8f>: Abbrev Number: 2 (DW_TAG_variable)
<90> DW_AT_name : S
<92> DW_AT_location : 5 byte block: 3 20 90 42 0 (DW_OP_addr: 429020)
<98> DW_AT_type : <0x119>

trunk:
<1><8f>: Abbrev Number: 2 (DW_TAG_variable)
<90> DW_AT_name : S
<92> DW_AT_location : 5 byte block: 3 20 0 0 0 (DW_OP_addr: 20) <98> DW_AT_type : <0x11f>

Seems the location in trunk is relative (maybe relocatable?) But I can see no diff, in the exe
objdump.exe -a -f Arg262.exe
Arg262.exe: file format pei-i386
Arg262.exe
architecture: i386, flags 0x0000013a:
EXEC_P, HAS_DEBUG, HAS_SYMS, HAS_LOCALS, D_PAGED
start address 0x00421a50

objdump.exe -a -f Arg271.exe
Arg271.exe: file format pei-i386
Arg271.exe
architecture: i386, flags 0x0000013a:
EXEC_P, HAS_DEBUG, HAS_SYMS, HAS_LOCALS, D_PAGED
start address 0x00422d80

gdb will try to access memory at the absolute address 0x00000020 and that fails.

Further, in a big apps with several 100 variables, about 20 have this error, and the rest are handled correct by gdb.

Reply by email

Martin
to Jonas Maebe
Jonas Maebe wrote 7 lines
On 22 Jul 2013, at 21:02, Martin wrote: > fpc revision 25146 (windows 32 bit internal linker or -XE) [dwarf errors] May be related to the same change that caused http://bugs.freepascal.org/view.php?id=24722

I've seem a couple of mail and forum posts, that seem to be similar to that.

&"Dwarf Error: Could not find abbrev number 84 [in module /tmp/project1]\n"

(with different numbers), and then gdb claiming that there is no debug in my case gdb did not report any "Could not find abbrev ..." error.

Reply by email