# CHECK: Program:
# CHECK-NEXT: DW_CFA_def_cfa: reg31 +0
-## FIXME Use getEHFrameSection() so that the address is decoded correctly.
# CHECK: [0x14] FDE length=16 cie=[0x0]
-# CHECK-NEXT: initial_location: 0x1c
-# CHECK-NEXT: address_range: 0x4 (end : 0x20)
+# CHECK-NEXT: initial_location: 0x0
+# CHECK-NEXT: address_range: 0x4 (end : 0x4)
# CHECK: Program:
# CHECK-NEXT: DW_CFA_nop:
# CHECK: Program:
# CHECK-NEXT: DW_CFA_def_cfa: reg13 +0
-## FIXME Use getEHFrameSection() so that the address is decoded correctly.
# CHECK: [0x14] FDE length=16 cie=[0x0]
-# CHECK-NEXT: initial_location: 0x1c
-# CHECK-NEXT: address_range: 0x4 (end : 0x20)
+# CHECK-NEXT: initial_location: 0x0
+# CHECK-NEXT: address_range: 0x4 (end : 0x4)
# CHECK: Program:
# CHECK-NEXT: DW_CFA_nop:
#include "llvm-readobj.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/BinaryFormat/Dwarf.h"
+#include "llvm/DebugInfo/DWARF/DWARFContext.h"
#include "llvm/DebugInfo/DWARF/DWARFDataExtractor.h"
#include "llvm/DebugInfo/DWARF/DWARFDebugFrame.h"
#include "llvm/Object/ELF.h"
if (!DataOrErr)
reportError(DataOrErr.takeError(), ObjF->getFileName());
- DWARFDataExtractor DE(*DataOrErr,
+ // Construct DWARFDataExtractor to handle relocations ("PC Begin" fields).
+ std::unique_ptr<DWARFContext> DICtx = DWARFContext::create(*ObjF, nullptr);
+ DWARFDataExtractor DE(DICtx->getDWARFObj(),
+ DICtx->getDWARFObj().getEHFrameSection(),
ELFT::TargetEndianness == support::endianness::little,
ELFT::Is64Bits ? 8 : 4);
DWARFDebugFrame EHFrame(Triple::ArchType(ObjF->getArch()), /*IsEH=*/true,