Index: lib/DebugInfo/DWARF/DWARFDie.cpp =================================================================== --- lib/DebugInfo/DWARF/DWARFDie.cpp +++ lib/DebugInfo/DWARF/DWARFDie.cpp @@ -234,9 +234,17 @@ WithColor(OS, Color) << Name; else if (Attr == DW_AT_decl_line || Attr == DW_AT_call_line) OS << *formValue.getAsUnsignedConstant(); - else if (Attr == DW_AT_location || Attr == DW_AT_frame_base || - Attr == DW_AT_data_member_location || - Attr == DW_AT_GNU_call_site_value) + else if (Attr == DW_AT_high_pc && !DumpOpts.ShowForm && !DumpOpts.Verbose && + formValue.getAsUnsignedConstant()) { + // Print the actual address rather than the offset. + uint64_t LowPC, HighPC, Index; + if (Die.getLowAndHighPC(LowPC, HighPC, Index)) + OS << format("0x%016" PRIx64, HighPC); + else + formValue.dump(OS, DumpOpts); + } else if (Attr == DW_AT_location || Attr == DW_AT_frame_base || + Attr == DW_AT_data_member_location || + Attr == DW_AT_GNU_call_site_value) dumpLocation(OS, formValue, U, sizeof(BaseIndent) + Indent + 4, DumpOpts); else formValue.dump(OS, DumpOpts); Index: test/tools/dsymutil/X86/basic-lto-dw4-linking-x86.test =================================================================== --- test/tools/dsymutil/X86/basic-lto-dw4-linking-x86.test +++ test/tools/dsymutil/X86/basic-lto-dw4-linking-x86.test @@ -12,10 +12,10 @@ CHECK: DW_AT_stmt_list (0x00000000) CHECK: DW_AT_comp_dir ("/Inputs") CHECK: DW_AT_low_pc (0x0000000100000f40) -CHECK: DW_AT_high_pc (0x0000000b) +CHECK: DW_AT_high_pc (0x0000000100000f4b) CHECK: DW_TAG_subprogram CHECK: DW_AT_low_pc (0x0000000100000f40) -CHECK: DW_AT_high_pc (0x0000000b) +CHECK: DW_AT_high_pc (0x0000000100000f4b) CHECK: DW_AT_frame_base (DW_OP_reg6 RBP) CHECK: DW_AT_name ("main") CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c") @@ -50,7 +50,7 @@ CHECK: DW_AT_name ("basic2.c") CHECK: DW_AT_stmt_list (0x00000044) CHECK: DW_AT_low_pc (0x0000000100000f50) -CHECK: DW_AT_high_pc (0x00000037) +CHECK: DW_AT_high_pc (0x0000000100000f87) CHECK: DW_TAG_base_type CHECK: DW_AT_name ("int") CHECK: DW_TAG_variable @@ -66,7 +66,7 @@ CHECK: DW_AT_inline (DW_INL_inlined) CHECK: DW_TAG_subprogram CHECK: DW_AT_low_pc (0x0000000100000f50) -CHECK: DW_AT_high_pc (0x00000037) +CHECK: DW_AT_high_pc (0x0000000100000f87) CHECK: DW_AT_frame_base (DW_OP_reg6 RBP) CHECK: DW_AT_name ("foo") CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic2.c") @@ -80,7 +80,7 @@ CHECK: DW_TAG_inlined_subroutine CHECK: DW_AT_abstract_origin (cu + 0x005b "inc") CHECK: DW_AT_low_pc (0x0000000100000f61) -CHECK: DW_AT_high_pc (0x0000000f) +CHECK: DW_AT_high_pc (0x0000000100000f70) CHECK: NULL CHECK: NULL @@ -91,7 +91,7 @@ CHECK: DW_AT_name ("basic3.c") CHECK: DW_AT_stmt_list (0x0000009a) CHECK: DW_AT_low_pc (0x0000000100000f90) -CHECK: DW_AT_high_pc (0x00000024) +CHECK: DW_AT_high_pc (0x0000000100000fb4) CHECK: DW_TAG_variable CHECK: DW_AT_name ("val") CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic3.c") @@ -102,7 +102,7 @@ CHECK: DW_AT_inline (DW_INL_inlined) CHECK: DW_TAG_subprogram CHECK: DW_AT_low_pc (0x0000000100000f90) -CHECK: DW_AT_high_pc (0x00000024) +CHECK: DW_AT_high_pc (0x0000000100000fb4) CHECK: DW_AT_frame_base (DW_OP_reg6 RBP) CHECK: DW_AT_name ("bar") CHECK: DW_TAG_formal_parameter Index: test/tools/llvm-dwarfdump/X86/gnu_call_site.s =================================================================== --- test/tools/llvm-dwarfdump/X86/gnu_call_site.s +++ test/tools/llvm-dwarfdump/X86/gnu_call_site.s @@ -6,7 +6,7 @@ # CHECK-NEXT: DW_AT_name ("fn4") # CHECK-NEXT: DW_AT_linkage_name ("test") # CHECK-NEXT: DW_AT_low_pc (0x0000000000000000) -# CHECK-NEXT: DW_AT_high_pc (0x00000000) +# CHECK-NEXT: DW_AT_high_pc (0x0000000000000000) # CHECK-NEXT: DW_AT_frame_base (DW_OP_call_frame_cfa) # CHECK-NEXT: DW_AT_GNU_all_call_sites (true) Index: test/tools/llvm-dwarfdump/X86/lookup.s =================================================================== --- test/tools/llvm-dwarfdump/X86/lookup.s +++ test/tools/llvm-dwarfdump/X86/lookup.s @@ -21,16 +21,16 @@ # CHECK: DW_AT_name ("foo.c") # CHECK: DW_AT_stmt_list (0x00000000) # CHECK: DW_AT_low_pc (0x0000000000000000) -# CHECK: DW_AT_high_pc (0x00000016) +# CHECK: DW_AT_high_pc (0x0000000000000016) # CHECK: DW_TAG_subprogram # CHECK: DW_AT_low_pc (0x0000000000000000) -# CHECK: DW_AT_high_pc (0x00000016) +# CHECK: DW_AT_high_pc (0x0000000000000016) # CHECK: DW_AT_name ("foo") # LEX: DW_TAG_lexical_block # LEX: DW_AT_low_pc (0x0000000000000004) -# LEX: DW_AT_high_pc (0x00000010) +# LEX: DW_AT_high_pc (0x0000000000000014) # A: Line info: file 'foo.c', line 3, column 9, start line 1 # B: Line info: file 'foo.c', line 4, column 6, start line 1