1 //===- DWARFDebugAranges.cpp ------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "llvm/DebugInfo/DWARF/DWARFAddressRange.h"
10 #include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
11 #include "llvm/Support/Format.h"
12 #include "llvm/Support/raw_ostream.h"
16 void DWARFAddressRange::dump(raw_ostream &OS, uint32_t AddressSize,
17 DIDumpOptions DumpOpts,
18 const DWARFObject *Obj) const {
20 OS << (DumpOpts.DisplayRawContents ? " " : "[");
21 OS << format("0x%*.*" PRIx64 ", ", AddressSize * 2, AddressSize * 2, LowPC)
22 << format("0x%*.*" PRIx64, AddressSize * 2, AddressSize * 2, HighPC);
23 OS << (DumpOpts.DisplayRawContents ? "" : ")");
26 DWARFFormValue::dumpAddressSection(*Obj, OS, DumpOpts, SectionIndex);
29 raw_ostream &llvm::operator<<(raw_ostream &OS, const DWARFAddressRange &R) {
30 R.dump(OS, /* AddressSize */ 8);