From 0fcdd9ba05d7bb0bf1ed2d226f7da9fa0b12f089 Mon Sep 17 00:00:00 2001 From: George Rimar Date: Thu, 27 Apr 2017 10:00:13 +0000 Subject: [PATCH] [llvm-dwarfdump] - Change format for .gdb_index dump. It is useful to output size of ranges when address ranges section of .gdb_index is dumped. It helps to compare outputs produced by different linkers, for example. In that case address ranges can look very different, when they are the same at fact. Difference comes from different low address because of different address of .text. Differential revision: https://reviews.llvm.org/D32492 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301527 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/DebugInfo/DWARF/DWARFGdbIndex.cpp | 5 +++-- test/DebugInfo/dwarfdump-dump-gdbindex.test | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/DebugInfo/DWARF/DWARFGdbIndex.cpp b/lib/DebugInfo/DWARF/DWARFGdbIndex.cpp index 76354a9b1dd..0625d01097c 100644 --- a/lib/DebugInfo/DWARF/DWARFGdbIndex.cpp +++ b/lib/DebugInfo/DWARF/DWARFGdbIndex.cpp @@ -39,8 +39,9 @@ void DWARFGdbIndex::dumpAddressArea(raw_ostream &OS) const { << '\n'; for (const AddressEntry &Addr : AddressArea) OS << format( - " Low address = 0x%llx, High address = 0x%llx, CU index = %d\n", - Addr.LowAddress, Addr.HighAddress, Addr.CuIndex); + " Low/High address = [0x%llx, 0x%llx) (Size: 0x%llx), CU id = %d\n", + Addr.LowAddress, Addr.HighAddress, Addr.HighAddress - Addr.LowAddress, + Addr.CuIndex); } void DWARFGdbIndex::dumpSymbolTable(raw_ostream &OS) const { diff --git a/test/DebugInfo/dwarfdump-dump-gdbindex.test b/test/DebugInfo/dwarfdump-dump-gdbindex.test index 7bdf6ed0c5d..6f1ef7cda3d 100644 --- a/test/DebugInfo/dwarfdump-dump-gdbindex.test +++ b/test/DebugInfo/dwarfdump-dump-gdbindex.test @@ -18,8 +18,8 @@ RUN: llvm-dwarfdump -debug-dump=gdb_index %p/Inputs/dwarfdump-gdbindex-v7.elf-x8 ; CHECK-NEXT: 1: Offset = 0x34, Length = 0x34 ; CHECK: Address area offset = 0x38, has 2 entries: -; CHECK-NEXT: Low address = 0x4000e8, High address = 0x4000f3, CU index = 0 -; CHECK-NEXT: Low address = 0x4000f3, High address = 0x4000fe, CU index = 1 +; CHECK-NEXT: Low/High address = [0x4000e8, 0x4000f3) (Size: 0xb), CU id = 0 +; CHECK-NEXT: Low/High address = [0x4000f3, 0x4000fe) (Size: 0xb), CU id = 1 ; CHECK: Symbol table offset = 0x60, size = 1024, filled slots: ; CHECK-NEXT: 489: Name offset = 0x1d, CU vector offset = 0x0