diff --git a/lib/DebugInfo/DWARFContext.cpp b/lib/DebugInfo/DWARFContext.cpp index c87855e530b..db0d21f4112 100644 --- a/lib/DebugInfo/DWARFContext.cpp +++ b/lib/DebugInfo/DWARFContext.cpp @@ -136,8 +136,8 @@ void DWARFContext::dump(raw_ostream &OS, DIDumpType DumpType) { PubIndexEntryDescriptor desc(pubNames.getU8(&offset)); OS << format("0x%8.8x ", dieRef) << format("%-8s", dwarf::GDBIndexEntryLinkageString(desc.Linkage)) - << ' ' << dwarf::GDBIndexEntryKindString(desc.Kind) << ' ' - << pubNames.getCStr(&offset) << "\n"; + << ' ' << dwarf::GDBIndexEntryKindString(desc.Kind) << " \"" + << pubNames.getCStr(&offset) << "\"\n"; } } diff --git a/test/DebugInfo/X86/gnu-public-names.ll b/test/DebugInfo/X86/gnu-public-names.ll index 9d4e6b609ae..0dd668a0d8b 100644 --- a/test/DebugInfo/X86/gnu-public-names.ll +++ b/test/DebugInfo/X86/gnu-public-names.ll @@ -36,18 +36,40 @@ ; ASM: .byte 32 # Kind: VARIABLE, EXTERNAL -; CHECK: .debug_gnu_pubnames contents: -; CHECK-NEXT: Length: 167 -; CHECK-NEXT: Version: 2 +; CHECK: .debug_info contents: +; CHECK: 0x00000046: DW_TAG_subprogram +; CHECK-NEXT: DW_AT_MIPS_linkage_name +; CHECK-NEXT: DW_AT_name {{.*}} "member_function" +; CHECK: 0x00000058: DW_TAG_subprogram +; CHECK-NEXT: DW_AT_MIPS_linkage_name +; CHECK-NEXT: DW_AT_name {{.*}} "static_member_function" +; CHECK: 0x0000007c: DW_TAG_variable +; CHECK-NEXT: DW_AT_name {{.*}} "global_variable" +; CHECK: 0x00000094: DW_TAG_variable +; CHECK-NEXT: DW_AT_name {{.*}} "global_namespace_variable" +; CHECK: 0x000000a3: DW_TAG_subprogram +; CHECK-NEXT: DW_AT_MIPS_linkage_name +; CHECK-NEXT: DW_AT_name {{.*}} "global_namespace_function" +; CHECK: 0x000000be: DW_TAG_subprogram +; CHECK-NEXT: DW_AT_specification {{.*}}0x00000046} +; CHECK: 0x000000e8: DW_TAG_subprogram +; CHECK-NEXT: DW_AT_specification {{.*}}0x00000058} +; CHECK: 0x000000ff: DW_TAG_subprogram +; CHECK-NEXT: DW_AT_MIPS_linkage_name +; CHECK-NEXT: DW_AT_name {{.*}} "global_function" + +; CHECK-LABEL: .debug_gnu_pubnames contents: +; CHECK-NEXT: Length: 167 +; CHECK-NEXT: Version: 2 ; CHECK-NEXT: Offset in .debug_info: 0 -; CHECK-NEXT: Size: 317 +; CHECK-NEXT: Size: 317 ; CHECK-NEXT: Offset Linkage Kind Name -; CHECK-DAG: 0x00000094 EXTERNAL VARIABLE global_namespace_variable -; CHECK-DAG: 0x000000a3 EXTERNAL FUNCTION global_namespace_function -; CHECK-DAG: 0x000000e8 STATIC FUNCTION static_member_function -; CHECK-DAG: 0x0000007c EXTERNAL VARIABLE global_variable -; CHECK-DAG: 0x000000ff EXTERNAL FUNCTION global_function -; CHECK-DAG: 0x000000be STATIC FUNCTION member_function +; CHECK-DAG: 0x00000094 EXTERNAL VARIABLE "global_namespace_variable" +; CHECK-DAG: 0x000000a3 EXTERNAL FUNCTION "global_namespace_function" +; CHECK-DAG: 0x000000e8 STATIC FUNCTION "static_member_function" +; CHECK-DAG: 0x0000007c EXTERNAL VARIABLE "global_variable" +; CHECK-DAG: 0x000000ff EXTERNAL FUNCTION "global_function" +; CHECK-DAG: 0x000000be STATIC FUNCTION "member_function" %struct.C = type { i8 }