[fpc-devel] Dwarf3 and the encoding of classes

Joost van der Sluis joost at cnoc.nl
Mon Jan 10 22:22:36 CET 2011

On Mon, 2011-01-10 at 20:43 +0000, Martin wrote:
> On 10/01/2011 20:26, Joost van der Sluis wrote:
> > On Mon, 2011-01-10 at 01:12 +0000, Martin wrote:
> >> On 03/01/2011 11:30, Joost van der Sluis wrote:
> >>> I also promised to build a Windows-gdb binary with the latest Dwarf-3
> >>> patches from the Archer-project. This can be downloaded here:
> >>>
> >>> http://www.lazarussupport.com/downloads/gdb_win32_fedora15_with_pascal_patches.zip
> >>>
> >> That one just crashed, when I tested with stabs
> > Works here. Do you have an example program?
> The latest version of my testcase.
> Running the TTEstExceptionOne with
> fpc 2.4.2 stabs
> the above gdb
> and other combinations too

I'll try. But I have a little problem with git again, so it can take a
few hours until I have the source in a valid state again.

> -------------------
> btw, does that version also include full support for all string types 
> already?

It should, yes. 

> did you see my question in the other mail? is -gw = dwarf2, or is there 
> a diff between -gw and -gw2 ?

I think not, if -gw would create dwarf-1 info, it woudn't contain
classes... So the default Dwarf format is probably -gw2.

> Is the decission on how classes are encoded (no pointer deref any 
> longer) final, or still just consideration?
> (if it is final, I need to fix, getting exception msg...
>  >> TCmdLineDebugger.SendCmdLn "x/s ^Exception($eax)^.FMessage"
> << TCmdLineDebugger.ReadLn "&"x/s ^Exception($eax)^.FMessage\n""
> << TCmdLineDebugger.ReadLn "&"A syntax error in expression, near 
> `FMessage'.\n""
> obviously the ^ has to go....

I think it will stay as it is, now. Until something new pops-up. (that
is, an implicit pointer will be added)

> Also need to find why it breaks:
>  >> TCmdLineDebugger.SendCmdLn "-data-evaluate-expression 
> ^^shortstring(^POINTER($eax)^+12)^^"
> << TCmdLineDebugger.ReadLn "^error,msg="A syntax error in expression, 
> near `shortstring(^POINTER($eax)^+12)^^'.""
>    TGDBMIDebugger.ProcessResult Error: ,msg="A syntax error in 
> expression, near `shortstring(^POINTER($eax)^+12)^^'."

I've never really understood why this is necessary?

> but the alternative seems to work:
>  >> TCmdLineDebugger.SendCmdLn "-data-evaluate-expression 
> ^char(^pointer(^POINTER($eax)^+12)^+1)"
> << TCmdLineDebugger.ReadLn "^done,value="0x410821 'Exception'""
> << TCmdLineDebugger.ReadLn "(gdb) "

We should fix fpc so that it is possible to compile the rtl in such a
way that debug-info is added for TException.


More information about the fpc-devel mailing list