LLDB mainline
CoreFileMemoryRanges.h
Go to the documentation of this file.
1//===-- CoreFileMemoryRanges.h ----------------------------------*- C++ -*-===//
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#include "lldb/Utility/Status.h"
12
13#include "llvm/ADT/AddressRanges.h"
14
15#ifndef LLDB_TARGET_COREFILEMEMORYRANGES_H
16#define LLDB_TARGET_COREFILEMEMORYRANGES_H
17
18namespace lldb_private {
19
21 llvm::AddressRange range; /// The address range to save into the core file.
22 uint32_t lldb_permissions; /// A bit set of lldb::Permissions bits.
23
24 bool operator==(const CoreFileMemoryRange &rhs) const {
25 return range == rhs.range && lldb_permissions == rhs.lldb_permissions;
26 }
27
28 bool operator!=(const CoreFileMemoryRange &rhs) const {
29 return !(*this == rhs);
30 }
31
32 bool operator<(const CoreFileMemoryRange &rhs) const {
33 if (range < rhs.range)
34 return true;
35 if (range == rhs.range)
37 return false;
38 }
39
40 std::string Dump() const {
42 stream << "[";
43 stream.PutHex64(range.start());
44 stream << '-';
45 stream.PutHex64(range.end());
46 stream << ")";
47 return stream.GetString().str();
48 }
49};
50
52 : public lldb_private::RangeDataVector<lldb::addr_t, lldb::addr_t,
53 CoreFileMemoryRange> {
54public:
55 /// Finalize and merge all overlapping ranges in this collection. Ranges
56 /// will be seperated based on permissions.
58};
59} // namespace lldb_private
60
61#endif // LLDB_TARGET_COREFILEMEMORYRANGES_H
Status FinalizeCoreFileSaveRanges()
Finalize and merge all overlapping ranges in this collection.
An error handling class.
Definition: Status.h:115
llvm::StringRef GetString() const
size_t PutHex64(uint64_t uvalue, lldb::ByteOrder byte_order=lldb::eByteOrderInvalid)
Definition: Stream.cpp:299
A class that represents a running process on the host machine.
bool operator==(const CoreFileMemoryRange &rhs) const
A bit set of lldb::Permissions bits.
bool operator<(const CoreFileMemoryRange &rhs) const
bool operator!=(const CoreFileMemoryRange &rhs) const
uint32_t lldb_permissions
The address range to save into the core file.