LLDB  mainline
MemoryRegionInfo.cpp
Go to the documentation of this file.
1 //===-- MemoryRegionInfo.cpp ----------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
10 
11 using namespace lldb_private;
12 
13 llvm::raw_ostream &lldb_private::operator<<(llvm::raw_ostream &OS,
14  const MemoryRegionInfo &Info) {
15  return OS << llvm::formatv("MemoryRegionInfo([{0}, {1}), {2:r}{3:w}{4:x}, "
16  "{5}, `{6}`, {7}, {8}, {9})",
17  Info.GetRange().GetRangeBase(),
18  Info.GetRange().GetRangeEnd(), Info.GetReadable(),
19  Info.GetWritable(), Info.GetExecutable(),
20  Info.GetMapped(), Info.GetName(), Info.GetFlash(),
21  Info.GetBlocksize(), Info.GetMemoryTagged());
22 }
23 
24 void llvm::format_provider<MemoryRegionInfo::OptionalBool>::format(
25  const MemoryRegionInfo::OptionalBool &B, raw_ostream &OS,
26  StringRef Options) {
27  assert(Options.size() <= 1);
28  bool Empty = Options.empty();
29  switch (B) {
31  OS << (Empty ? "no" : "-");
32  return;
34  OS << (Empty ? "yes" : Options);
35  return;
37  OS << (Empty ? "don't know" : "?");
38  return;
39  }
40 }
lldb_private::MemoryRegionInfo
Definition: MemoryRegionInfo.h:18
lldb_private::MemoryRegionInfo::OptionalBool
OptionalBool
Definition: MemoryRegionInfo.h:22
lldb_private::Options
Definition: Options.h:57
MemoryRegionInfo.h
lldb_private::MemoryRegionInfo::eYes
@ eYes
Definition: MemoryRegionInfo.h:22
lldb_private::MemoryRegionInfo::eNo
@ eNo
Definition: MemoryRegionInfo.h:22
lldb_private::MemoryRegionInfo::eDontKnow
@ eDontKnow
Definition: MemoryRegionInfo.h:22
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::operator<<
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, const MemoryRegionInfo &Info)
Definition: MemoryRegionInfo.cpp:13