[fpc-devel] FPC 64bit and gdb on Linux

Jonas Maebe jonas.maebe at elis.ugent.be
Mon Oct 26 15:17:55 CET 2009


On 26 Oct 2009, at 14:57, Bruce Bauman wrote:

> Does this mean the 32-bit version of FPC generates STABS and the 64- 
> bit
> version generates DWARF?

By default, yes. You can also force the 32 bit version generate DWARF  
by using -gw2 rather than -g

> If my goal was to use gdb on a large application written in Pascal,  
> am I
> better off using the 32-bit version because the debugger support is
> better?

It depends.

Advantages of using Stabs instead of DWARF
* var parameters (although if you simply print the value of a  
reference parameter in gdb, you also get the value; it's just in the  
stack frame info that they're displayed as addresses)
* symbolic constants (i.e., not "typed constants) are supported in  
Stabs, but not in DWARF
* shortstrings are sometimes truncated to 8 characters when you use  
DWARF (but I still haven't figured out why)

Advantages of using DWARF instead of Stabs
* faster linking
* support for absolute variables (in FPC 2.3.x and later)
* support for properties that map directly to fields (in FPC 2.3.x and  
later)
* support for 64 bit systems
* will get support for dynamic arrays, ansistrings etc in the future
* will keep improving in the future, while Stabs is a dead end

> Also, I'm assuming it's the DWARF parser in gdb that needs "fixing".  
> Is
> this specific to Pascal, or is the DWARF support generally broken?

The full DWARF specs are simply not yet implemented in gdb. Just like  
in FPC, GDB development outside the interest of the main contributors  
is mainly driven by user patches. And at least C and C++ don't have  
the notion of "var" parameters.


Jonas



More information about the fpc-devel mailing list