LLDB mainline
ProcessAddress.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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
9#ifndef LLDB_UTILITY_PROCESSADDRESS_H
10#define LLDB_UTILITY_PROCESSADDRESS_H
11
12#include "lldb/lldb-defines.h"
13#include "lldb/lldb-types.h"
14#include <optional>
15
16namespace lldb_private {
17
18/// An address in a process, qualified by an address space.
22 /// If this has a value, then this is a thread specific address.
23 std::optional<lldb::tid_t> m_tid;
24
25public:
26 /// Implicit so existing lldb::addr_t call sites keep working.
27 ProcessAddress(lldb::addr_t load_addr) : m_value(load_addr) {}
28
30 std::optional<lldb::tid_t> tid = std::nullopt)
31 : m_value(addr), m_addr_space(addr_space), m_tid(tid) {}
32
36
37 lldb::addr_t GetValue() const { return m_value; }
38
40
41 std::optional<lldb::tid_t> GetThreadID() const { return m_tid; }
42};
43
44} // namespace lldb_private
45
46#endif // LLDB_UTILITY_PROCESSADDRESS_H
lldb::addr_t GetValue() const
ProcessAddress(lldb::addr_t load_addr)
Implicit so existing lldb::addr_t call sites keep working.
std::optional< lldb::tid_t > GetThreadID() const
lldb::addr_space_t GetAddressSpace() const
lldb::addr_space_t m_addr_space
ProcessAddress(lldb::addr_t addr, lldb::addr_space_t addr_space, std::optional< lldb::tid_t > tid=std::nullopt)
std::optional< lldb::tid_t > m_tid
If this has a value, then this is a thread specific address.
#define LLDB_DEFAULT_ADDRESS_SPACE_ID
A class that represents a running process on the host machine.
uint64_t addr_t
Definition lldb-types.h:80
uint64_t addr_space_t
Definition lldb-types.h:81