[PATCH] Debug Info on Windows

David Blaikie dblaikie at gmail.com
Thu Aug 1 10:12:53 PDT 2013


On Tue, Jul 30, 2013 at 12:40 AM, Carlo Kok <ck at remobjects.com> wrote:
> Op 26-7-2013 22:39, Carlo Kok schreef:
>
>> Op 26-7-2013 21:58, David Blaikie schreef:
>>>>>
>>>>> b) Could we sink this logic down into DIELabel (or
>>>>> DIEString)::EmitValue rather than having the special case up here in
>>>>> emitDIE?
>>>>
>>>>
>>>>
>>>> DIELabel then. DIEString calls DIELabel.
>>>
>>>
>>> Great... and sorry to keep iterating like this, but looking now at the
>>> only current (committed) use of "needsDwarfSectionOffsetDirective"
>>> that's down in AsmPrinter::EmitSectionOffset, so what would happen if
>>> we pushed this one layer further down, into
>>> AsmPrinter::EmitLabelReference?
>>>
>>> - Dave
>>>
>>
>>
>> The only other thing this would affect is DW_AT_Location:
>>      case dwarf::DW_AT_location: {
>>        if (DIELabel *L = dyn_cast<DIELabel>(Values[i])) {
>>          if (Asm->MAI->doesDwarfUseRelocationsAcrossSections())
>>            Asm->EmitLabelReference(L->getValue(), 4);
>>          else
>>            Asm->EmitLabelDifference(L->getValue(),
>> DwarfDebugLocSectionSym, 4);
>>        } else {
>>          Values[i]->EmitValue(Asm, Form);
>>        }
>>        break;
>>      }
>>
>>
>> Problem is, I don't know what this would affect.
>>
>
> I can't even get one of the clang testcases to hit this. What would be the
> next step?

That's strange - I just tried this & had the following tests fail:

    LLVM :: CodeGen/Hexagon/hwloop-dbg.ll
    LLVM :: CodeGen/PowerPC/dbg.ll
    LLVM :: CodeGen/X86/2010-05-25-DotDebugLoc.ll
    LLVM :: CodeGen/X86/dbg-byval-parameter.ll
    LLVM :: DebugInfo/X86/DW_AT_location-reference.ll
    LLVM :: DebugInfo/X86/arguments.ll
    LLVM :: DebugInfo/X86/dbg_value_direct.ll
    LLVM :: DebugInfo/X86/parameters.ll
    LLVM :: DebugInfo/X86/subreg.ll
    LLVM :: DebugInfo/inlined-arguments.ll
    LLVM :: DebugInfo/two-cus-from-same-file.ll

It might be worth understanding how this code is reachable to see if
it's a case you also want to fix on Windows (in which case sinking
this down into EmitLabelReference is the right thing to do, but adding
extra tests to cover this other callsite might be valuable).

But it generally seems like the right place for this, to the best of
my limited understanding, so I'll sign off on this with or without
that extra testing.

> The last version I sent works on Windows and doesn't affect
> anything else (doesDwarfUseRelocationsAcrossSections is only set on
> Windows/COFF).
>
> --
> Carlo Kok
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list