[Lldb-commits] [PATCH] Register Number in DWARFCallFrameInfo.cpp

Jason Molenda jmolenda at apple.com
Tue Aug 12 15:23:43 PDT 2014


Hi Tong, sorry for not replying earlier.

I don't understand why the current code is wrong.

        eRegisterKindGCC = 0,    // the register numbers seen in eh_frame
        eRegisterKindDWARF,      // the register numbers seen DWARF

and

        SectionSP sect = sl->FindSectionByType (eSectionTypeEHFrame, true);
        if (sect.get())
        {
            m_eh_frame = new DWARFCallFrameInfo(m_object_file, sect, eRegisterKindGCC, true);
        }

We create a DWARFCallFrameInfo object to read the eh_frame information and we tell it that the register kind to use for the reg numbers is eRegisterKindGCC - aka the eh_frame register numbering domain.

This all looks correct to me, and designed specifically to handle the case of that ancient gcc register numbering bug in the eh_frame section for i386.

We never read the actual DWARF debug_frame (today) because I've never seen a case where it had more information than the eh_frame unwind info.



> On Aug 12, 2014, at 1:36 PM, Tong Shen <endlessroad at google.com> wrote:
> 
> Aha, got it.
> Patch confirmed and attached.
> 
> 
> On Tue, Aug 12, 2014 at 12:51 PM, Ed Maste <emaste at freebsd.org> wrote:
> On 12 August 2014 15:43, Todd Fiala <tfiala at google.com> wrote:
> >
> > Hey Tong,
> >
> > Ah interesting.  The register infos in lldb have a vector of different register numbers (I think we call them "register kinds") based on the type of encoding you're using.  Let's have a look at that to see if we can adjust the code to query for the right register kind.  We'll look at this today!
> 
> There was a thread on this topic on this list a while back, and I
> think the two register sets in question here are DWARF and GCC, which
> are identical in all cases except that i386 swaps esp and ebp between
> the two.  This is all the legacy of an ancient GCC bug.  So I think
> you're right Todd, just picking the other set should solve this.
> 
> 
> 
> -- 
> Best Regards, Tong Shen
> <fix_register_kind.patch>_______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits




More information about the lldb-commits mailing list