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

Tong Shen endlessroad at google.com
Tue Aug 12 17:12:48 PDT 2014


I found
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.td?view=markup#l111
>From line 41 of the same file:
41 // Dwarf numbering is different for 32-bit and 64-bit, and there are
42 // variations by target as well. Currently the first entry is for X86-64,
43 // second - for EH on X86-32/Darwin and third is 'generic' one
(X86-32/Linux
44 // and debug information on X86-32/Darwin)

And this link refers to the same issue:
https://groups.google.com/forum/#!topic/google-breakpad-dev/jhmD18lyKB0

It seems like it's not GCC & DWARF; it's Darwin & Linux...

So for linux, {gcc, dwarf}_{...}_i386 can be merged into one; nothing else
uses them.
For OSX, register number will be fetched elsewhere anyway.


On Tue, Aug 12, 2014 at 5:08 PM, Todd Fiala <tfiala at google.com> wrote:

> Ok caught Jason's response after writing that last one.
>
> What state do you see this in, Jason?
>
> -Todd
>
> On Aug 12, 2014, at 5:05 PM, Todd Fiala <tfiala at google.com> wrote:
>
> Yep, will do later tonight.
>
> -Todd
>
> On Aug 12, 2014, at 4:32 PM, Tong Shen <endlessroad at google.com> wrote:
>
> Got it. So much magic going on there.
>
> +Todd Can you check this in? Thanks!
>
>
> On Tue, Aug 12, 2014 at 4:23 PM, Jason Molenda <jmolenda at apple.com> wrote:
>
>>
>> > On Aug 12, 2014, at 4:20 PM, Tong Shen <endlessroad at google.com> wrote:
>> >
>> > There's this line in your dwarfdump output:
>> > DW_CFA_def_cfa (5 (esp), 4)
>> > DW_CFA_offset (8 (eip), -4)
>> >
>> > On Ubuntu 14.04, objdump -W outputs this:
>> > DW_CFA_def_cfa: r4 (esp) ofs 4
>> > DW_CFA_offset: r8 (eip) at cfa-4
>> >
>> > I believe this is the cause. On OSX, esp=5; on linux, esp=4
>>
>>
>> Yeah, I was starting to get that impression too.  I thought the old
>> esp/ebp mixup was across all the gcc platforms - but who knows.  Feel free
>> to fix the RegisterContext_x86 enum definitions for esp/ebp - on Mac OS X
>> we'll still be using the debugserver-provided register definitions.  (and
>> we don't use eh_frame very often on Mac OS X - we primarily use a local
>> compact unwind format that I haven't written an importer for yet)
>>
>> Normally this kind of thing would be defined in the processor ABI
>> document -- but I've never been able to find a document like that for IA-32.
>>
>
>
>
> --
> Best Regards, Tong Shen
>
> <1.patch>
>
>


-- 
Best Regards, Tong Shen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20140812/518d2fbc/attachment.html>


More information about the lldb-commits mailing list