[llvm] r218246 - [dwarfdump] Dump full filenames as DW_AT_(decl|call)_file attribute values
Frédéric Riss
friss at apple.com
Mon Sep 22 09:21:04 PDT 2014
> On 22 Sep 2014, at 17:49, Aaron Ballman <aaron at aaronballman.com <mailto:aaron at aaronballman.com>> wrote:
>
> This commit is failing tests on Windows:
> http://bb.pgr.jp/builders/ninja-clang-i686-msc17-R/builds/10591 <http://bb.pgr.jp/builders/ninja-clang-i686-msc17-R/builds/10591>
Thanks for the report. Is it normal that I didn’t get a mail from the bot notifying me of the failure?
> It seems this is another case where our path separators are getting
> mixed incorrectly. When I dump the debug info with paths, I am
> getting:
>
> DW_AT_decl_file [DW_FORM_data1] ("/work/llvm/vanilla/test/DebugInfo\test.c")
>
> I know nothing about DWARF debug info, but that's not a valid path on
> Windows, and likely isn't what you'd want on a POSIX system either.
Well, it’s true that the path isn’t correct in either system, but that what you get when you dump the debug information of a POSIX generated test on windows. This is not without precedent, at least the symboliser tests have regexs to cope with this. I’ll commit a fix for the test shortly, and try to monitor the bot.
Thanks!
Fred
> ~Aaron
>
> On Mon, Sep 22, 2014 at 8:36 AM, Frederic Riss <friss at apple.com <mailto:friss at apple.com>> wrote:
>> Author: friss
>> Date: Mon Sep 22 07:36:04 2014
>> New Revision: 218246
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=218246&view=rev <http://llvm.org/viewvc/llvm-project?rev=218246&view=rev>
>> Log:
>> [dwarfdump] Dump full filenames as DW_AT_(decl|call)_file attribute values
>>
>> Reviewers: dblaikie samsonov
>>
>> Subscribers: llvm-commits
>>
>> Differential Revision: http://reviews.llvm.org/D5192 <http://reviews.llvm.org/D5192>
>>
>> Modified:
>> llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.cpp
>> llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.h
>> llvm/trunk/test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll
>> llvm/trunk/test/DebugInfo/namespace.ll
>> llvm/trunk/test/MC/MachO/gen-dwarf.s
>>
>> Modified: llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.cpp?rev=218246&r1=218245&r2=218246&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.cpp?rev=218246&r1=218245&r2=218246&view=diff>
>> ==============================================================================
>> --- llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.cpp (original)
>> +++ llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.cpp Mon Sep 22 07:36:04 2014
>> @@ -31,7 +31,7 @@ static const DWARFUnit *findUnitAndExtra
>> return (Unit && DIE.extractFast(Unit, Offset)) ? Unit : nullptr;
>> }
>>
>> -void DWARFDebugInfoEntryMinimal::dump(raw_ostream &OS, const DWARFUnit *u,
>> +void DWARFDebugInfoEntryMinimal::dump(raw_ostream &OS, DWARFUnit *u,
>> unsigned recurseDepth,
>> unsigned indent) const {
>> DataExtractor debug_info_data = u->getDebugInfoExtractor();
>> @@ -74,7 +74,7 @@ void DWARFDebugInfoEntryMinimal::dump(ra
>> }
>>
>> void DWARFDebugInfoEntryMinimal::dumpAttribute(raw_ostream &OS,
>> - const DWARFUnit *u,
>> + DWARFUnit *u,
>> uint32_t *offset_ptr,
>> uint16_t attr, uint16_t form,
>> unsigned indent) const {
>> @@ -99,7 +99,17 @@ void DWARFDebugInfoEntryMinimal::dumpAtt
>> OS << "\t(";
>>
>> const char *Name = nullptr;
>> - if (Optional<uint64_t> Val = formValue.getAsUnsignedConstant())
>> + std::string File;
>> + if (attr == DW_AT_decl_file || attr == DW_AT_call_file) {
>> + if (const auto *LT = u->getContext().getLineTableForUnit(u))
>> + if (LT->getFileNameByIndex(
>> + formValue.getAsUnsignedConstant().getValue(),
>> + u->getCompilationDir(),
>> + DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath, File)) {
>> + File = '"' + File + '"';
>> + Name = File.c_str();
>> + }
>> + } else if (Optional<uint64_t> Val = formValue.getAsUnsignedConstant())
>> Name = AttributeValueString(attr, *Val);
>>
>> if (Name) {
>>
>> Modified: llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.h
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.h?rev=218246&r1=218245&r2=218246&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.h?rev=218246&r1=218245&r2=218246&view=diff>
>> ==============================================================================
>> --- llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.h (original)
>> +++ llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.h Mon Sep 22 07:36:04 2014
>> @@ -38,9 +38,9 @@ public:
>> DWARFDebugInfoEntryMinimal()
>> : Offset(0), SiblingIdx(0), AbbrevDecl(nullptr) {}
>>
>> - void dump(raw_ostream &OS, const DWARFUnit *u, unsigned recurseDepth,
>> + void dump(raw_ostream &OS, DWARFUnit *u, unsigned recurseDepth,
>> unsigned indent = 0) const;
>> - void dumpAttribute(raw_ostream &OS, const DWARFUnit *u, uint32_t *offset_ptr,
>> + void dumpAttribute(raw_ostream &OS, DWARFUnit *u, uint32_t *offset_ptr,
>> uint16_t attr, uint16_t form, unsigned indent = 0) const;
>>
>> /// Extracts a debug info entry, which is a child of a given unit,
>>
>> Modified: llvm/trunk/test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll?rev=218246&r1=218245&r2=218246&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll?rev=218246&r1=218245&r2=218246&view=diff>
>> ==============================================================================
>> --- llvm/trunk/test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll (original)
>> +++ llvm/trunk/test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll Mon Sep 22 07:36:04 2014
>> @@ -40,7 +40,7 @@ declare void @llvm.dbg.declare(metadata,
>> ; CHECK-NOT: DW_TAG
>> ; CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x{{[0-9a-f]*}}] = "GLB")
>> ; CHECK-NOT: DW_TAG
>> -; CHECK: DW_AT_decl_file [DW_FORM_data1] (0x01)
>> +; CHECK: DW_AT_decl_file [DW_FORM_data1] ("/work/llvm/vanilla/test/DebugInfo/test.c")
>> ; CHECK-NOT: DW_TAG
>> ; CHECK: DW_AT_decl_line [DW_FORM_data1] (1)
>>
>> @@ -48,7 +48,7 @@ declare void @llvm.dbg.declare(metadata,
>> ; CHECK-NOT: DW_TAG
>> ; CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x{{[0-9a-f]*}}] = "LOC")
>> ; CHECK-NOT: DW_TAG
>> -; CHECK: DW_AT_decl_file [DW_FORM_data1] (0x01)
>> +; CHECK: DW_AT_decl_file [DW_FORM_data1] ("/work/llvm/vanilla/test/DebugInfo/test.c")
>> ; CHECK-NOT: DW_TAG
>> ; CHECK: DW_AT_decl_line [DW_FORM_data1] (4)
>>
>>
>> Modified: llvm/trunk/test/DebugInfo/namespace.ll
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/namespace.ll?rev=218246&r1=218245&r2=218246&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/namespace.ll?rev=218246&r1=218245&r2=218246&view=diff>
>> ==============================================================================
>> --- llvm/trunk/test/DebugInfo/namespace.ll (original)
>> +++ llvm/trunk/test/DebugInfo/namespace.ll Mon Sep 22 07:36:04 2014
>> @@ -5,12 +5,12 @@
>> ; CHECK: debug_info contents
>> ; CHECK: [[NS1:0x[0-9a-f]*]]:{{ *}}DW_TAG_namespace
>> ; CHECK-NEXT: DW_AT_name{{.*}} = "A"
>> -; CHECK-NEXT: DW_AT_decl_file{{.*}}(0x0[[F1:[0-9]]])
>> +; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F1:".*debug-info-namespace.cpp"]])
>> ; CHECK-NEXT: DW_AT_decl_line{{.*}}(3)
>> ; CHECK-NOT: NULL
>> ; CHECK: [[NS2:0x[0-9a-f]*]]:{{ *}}DW_TAG_namespace
>> ; CHECK-NEXT: DW_AT_name{{.*}} = "B"
>> -; CHECK-NEXT: DW_AT_decl_file{{.*}}(0x0[[F2:[0-9]]])
>> +; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2:".*foo.cpp"]])
>> ; CHECK-NEXT: DW_AT_decl_line{{.*}}(1)
>> ; CHECK-NOT: NULL
>> ; CHECK: [[I:0x[0-9a-f]*]]:{{ *}}DW_TAG_variable
>> @@ -39,7 +39,7 @@
>> ; CHECK: DW_TAG_imported_module
>> ; This is a bug, it should be in F2 but it inherits the file from its
>> ; enclosing scope
>> -; CHECK-NEXT: DW_AT_decl_file{{.*}}(0x0[[F1]])
>> +; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F1]])
>> ; CHECK-NEXT: DW_AT_decl_line{{.*}}(8)
>> ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[NS2]]})
>> ; CHECK: NULL
>> @@ -47,7 +47,7 @@
>>
>> ; CHECK: DW_TAG_imported_module
>> ; Same bug as above, this should be F2, not F1
>> -; CHECK-NEXT: DW_AT_decl_file{{.*}}(0x0[[F1]])
>> +; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F1]])
>> ; CHECK-NEXT: DW_AT_decl_line{{.*}}(11)
>> ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[NS1]]})
>> ; CHECK-NOT: NULL
>> @@ -59,38 +59,38 @@
>> ; CHECK: DW_AT_name{{.*}}= "func"
>> ; CHECK-NOT: NULL
>> ; CHECK: DW_TAG_imported_module
>> -; CHECK-NEXT: DW_AT_decl_file{{.*}}(0x0[[F2]])
>> +; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]])
>> ; CHECK-NEXT: DW_AT_decl_line{{.*}}(18)
>> ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[NS1]]})
>> ; CHECK-NOT: NULL
>> ; CHECK: DW_TAG_imported_declaration
>> -; CHECK-NEXT: DW_AT_decl_file{{.*}}(0x0[[F2]])
>> +; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]])
>> ; CHECK-NEXT: DW_AT_decl_line{{.*}}(19)
>> ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[FOO]]})
>> ; CHECK-NOT: NULL
>> ; CHECK: DW_TAG_imported_declaration
>> -; CHECK-NEXT: DW_AT_decl_file{{.*}}(0x0[[F2]])
>> +; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]])
>> ; CHECK-NEXT: DW_AT_decl_line{{.*}}(20)
>> ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[BAR]]})
>> ; CHECK-NOT: NULL
>> ; CHECK: DW_TAG_imported_declaration
>> -; CHECK-NEXT: DW_AT_decl_file{{.*}}(0x0[[F2]])
>> +; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]])
>> ; CHECK-NEXT: DW_AT_decl_line{{.*}}(21)
>> ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[FUNC1]]})
>> ; CHECK-NOT: NULL
>> ; CHECK: DW_TAG_imported_declaration
>> -; CHECK-NEXT: DW_AT_decl_file{{.*}}(0x0[[F2]])
>> +; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]])
>> ; CHECK-NEXT: DW_AT_decl_line{{.*}}(22)
>> ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[I]]})
>> ; CHECK-NOT: NULL
>> ; CHECK: [[X:0x[0-9a-f]*]]:{{ *}}DW_TAG_imported_declaration
>> -; CHECK-NEXT: DW_AT_decl_file{{.*}}(0x0[[F2]])
>> +; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]])
>> ; CHECK-NEXT: DW_AT_decl_line{{.*}}(24)
>> ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[NS1]]})
>> ; CHECK-NEXT: DW_AT_name{{.*}}"X"
>> ; CHECK-NOT: NULL
>> ; CHECK: DW_TAG_imported_declaration
>> -; CHECK-NEXT: DW_AT_decl_file{{.*}}(0x0[[F2]])
>> +; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]])
>> ; CHECK-NEXT: DW_AT_decl_line{{.*}}(25)
>> ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[X]]})
>> ; CHECK-NEXT: DW_AT_name{{.*}}"Y"
>> @@ -98,16 +98,13 @@
>> ; CHECK: DW_TAG_lexical_block
>> ; CHECK-NOT: NULL
>> ; CHECK: DW_TAG_imported_module
>> -; CHECK-NEXT: DW_AT_decl_file{{.*}}(0x0[[F2]])
>> +; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]])
>> ; CHECK-NEXT: DW_AT_decl_line{{.*}}(15)
>> ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[NS2]]})
>> ; CHECK: NULL
>> ; CHECK: NULL
>> ; CHECK: NULL
>>
>> -; CHECK: file_names[ [[F1]]]{{.*}}debug-info-namespace.cpp
>> -; CHECK: file_names[ [[F2]]]{{.*}}foo.cpp
>> -
>> ; IR generated from clang/test/CodeGenCXX/debug-info-namespace.cpp, file paths
>> ; changed to protect the guilty. The C++ source code is:
>> ; namespace A {
>>
>> Modified: llvm/trunk/test/MC/MachO/gen-dwarf.s
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/gen-dwarf.s?rev=218246&r1=218245&r2=218246&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/gen-dwarf.s?rev=218246&r1=218245&r2=218246&view=diff>
>> ==============================================================================
>> --- llvm/trunk/test/MC/MachO/gen-dwarf.s (original)
>> +++ llvm/trunk/test/MC/MachO/gen-dwarf.s Mon Sep 22 07:36:04 2014
>> @@ -50,7 +50,7 @@ _x: .long 1
>>
>> // CHECK: DW_TAG_label [2] *
>> // CHECK: DW_AT_name [DW_FORM_string] ("bar")
>> -// CHECK: DW_AT_decl_file [DW_FORM_data4] (0x00000001)
>> +// CHECK: DW_AT_decl_file [DW_FORM_data4] ([[FILE:".*gen-dwarf.s"]])
>> // CHECK: DW_AT_decl_line [DW_FORM_data4] (5)
>> // CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
>> // CHECK: DW_AT_prototyped [DW_FORM_flag] (0x00)
>> @@ -61,7 +61,7 @@ _x: .long 1
>>
>> // CHECK: DW_TAG_label [2] *
>> // CHECK: DW_AT_name [DW_FORM_string] ("foo")
>> -// CHECK: DW_AT_decl_file [DW_FORM_data4] (0x00000001)
>> +// CHECK: DW_AT_decl_file [DW_FORM_data4] ([[FILE]])
>> // CHECK: DW_AT_decl_line [DW_FORM_data4] (9)
>> // CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000007)
>> // CHECK: DW_AT_prototyped [DW_FORM_flag] (0x00)
>> @@ -72,7 +72,7 @@ _x: .long 1
>>
>> // CHECK: DW_TAG_label [2] *
>> // CHECK: DW_AT_name [DW_FORM_string] ("baz")
>> -// CHECK: DW_AT_decl_file [DW_FORM_data4] (0x00000001)
>> +// CHECK: DW_AT_decl_file [DW_FORM_data4] ([[FILE]])
>> // CHECK: DW_AT_decl_line [DW_FORM_data4] (10)
>> // CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000007)
>> // CHECK: DW_AT_prototyped [DW_FORM_flag] (0x00)
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu <mailto:llvm-commits at cs.uiuc.edu>
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140922/d692698c/attachment.html>
More information about the llvm-commits
mailing list