dwarf2 unwinding for i386

Andrew Cagney ac131313@cygnus.com
Mon Jun 24 09:29:00 GMT 2002


> On Mon, Jun 24, 2002 at 03:39:30PM +0200, Michal Ludvig wrote:
> 
>> Hi all,
>> what do you think about adding dwarf2 unwinding (dwarf2cfi.c) to i386 
>> target? On x86-64 we are already using it for some time now and it seems 
>> to be quite stable. GCC folks are about to switch omit-frame-pointer on 
>> by default for i386 in a near future, but are waiting (as I understand 
>> it) for GDB to implement dwarf2 unwinding, so that the resulting code 
>> could be debugged. Can we make at least a testing branch with this 
>> support? Opinions? MarkK?
> 
> 
> If we do this, IMHO, we should support it for all architectures and not
> for just x86-64 and i386.  Everyone wins.

The theory is that it should be added here:

/* Using the PC, select a mechanism for unwinding a frame returning
    the previous frame.  The register unwind function should, on
    demand, initialize the ->context object.  */

static void
set_unwind_by_pc (CORE_ADDR pc, CORE_ADDR fp,
                   frame_register_unwind_ftype **unwind)
{
   if (!USE_GENERIC_DUMMY_FRAMES)
     /* Still need to set this to something.  The ``info frame'' code
        calls this function to find out where the saved registers are.
        Hopefully this is robust enough to stop any core dumps and
        return vaguely correct values..  */
     *unwind = frame_saved_regs_register_unwind;
   else if (PC_IN_CALL_DUMMY (pc, fp, fp))
     *unwind = generic_call_dummy_register_unwind;
   else
     *unwind = frame_saved_regs_register_unwind;
}

The i386 doesn't use generic dummy frames and targets need switch to 
generic_unwind_get_saved_register though :-(

Andrew




More information about the Gdb mailing list