[fpc-devel] x86_64 stabs info - patch (sort of)

Pierre Free Pascal pierre at freepascal.org
Tue Oct 12 10:25:16 CEST 2010


> > Notice: This fix is absolutely necessary if you are working with
> Lazarus
> > on Win64, as Lazarus automatically sets a breakpoint in fpc_raise...
> > which then crashes gdb, which in turn crashes any running debugging
> > session - in case an exception is raised. Of course it affects also
> all
> > methods/funs that take e.g. three params that can be passed in
> regs...
> >
> > Perhaps someone with more knowledge of stabs and the x86reg.dat can
> do a
> > proper fix? TIA!
> 
> Afaik, stabs does not support x86-64 that's why it's probably never
> fixed/noticed.

  This is not true: 
I src/gdb/amd64-tdep.c you can see this (line 2419 on current CVS):
 /* The "default" register numbering scheme for AMD64 is referred to
    as the "DWARF Register Number Mapping" in the System V psABI.
    The preferred debugging format for all known AMD64 targets is
    actually DWARF2, and GCC doesn't seem to support DWARF (that is
    DWARF-1), but we provide the same mapping just in case.  This
    mapping is also used for stabs, which GCC does support.  */
 set_gdbarch_stab_reg_to_regnum (gdbarch, amd64_dwarf_reg_to_regnum);
 set_gdbarch_dwarf2_reg_to_regnum (gdbarch, amd64_dwarf_reg_to_regnum);

 
  This means that indeed stabs and dwarf register number are equal,
at least for GDB.

  The problem is that this means that we probably also need to
distinguish between stabs32 and stabs64, as we already do for dwarf32 and dwarf64...
unless we change the code that reads  x86reg.dat to use dwarf64
indexes for amd64 stabs registers.

Pierre







More information about the fpc-devel mailing list