LLDB mainline
StackID.h
Go to the documentation of this file.
1//===-- StackID.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
9#ifndef LLDB_TARGET_STACKID_H
10#define LLDB_TARGET_STACKID_H
11
13
14namespace lldb_private {
15
16class Process;
17
18class StackID {
19public:
20 StackID() = default;
21
22 explicit StackID(lldb::addr_t pc, lldb::addr_t cfa,
23 SymbolContextScope *symbol_scope, Process *process);
24
25 ~StackID() = default;
26
27 lldb::addr_t GetPC() const { return m_pc; }
28
32
34
36
38 m_symbol_scope = symbol_scope;
39 }
40
46
47 bool IsValid() const {
49 }
50
51 void Dump(Stream *s);
52
53protected:
54 friend class StackFrame;
55
56 void SetPC(lldb::addr_t pc, Process *process);
57 void SetCFA(lldb::addr_t cfa, Process *process);
58
59 /// The pc value for the function/symbol for this frame. This will only get
60 /// used if the symbol scope is nullptr (the code where we are stopped is not
61 /// represented by any function or symbol in any shared library).
63
64 /// The call frame address (stack pointer) value at the beginning of the
65 /// function that uniquely identifies this frame (along with m_symbol_scope
66 /// below)
68
69 /// The cfa with metadata (i.e. prior to Process::FixAddress).
71
72 /// If nullptr, there is no block or symbol for this frame. If not nullptr,
73 /// this will either be the scope for the lexical block for the frame, or the
74 /// scope for the symbol. Symbol context scopes are always be unique pointers
75 /// since the are part of the Block and Symbol objects and can easily be used
76 /// to tell if a stack ID is the same as another.
78};
79
80bool operator==(const StackID &lhs, const StackID &rhs);
81bool operator!=(const StackID &lhs, const StackID &rhs);
82
83// frame_id_1 < frame_id_2 means "frame_id_1 is YOUNGER than frame_id_2"
84bool operator<(const StackID &lhs, const StackID &rhs);
85
86} // namespace lldb_private
87
88#endif // LLDB_TARGET_STACKID_H
A plug-in interface definition class for debugging a process.
Definition Process.h:357
void Dump(Stream *s)
Definition StackID.cpp:37
lldb::addr_t m_cfa
The call frame address (stack pointer) value at the beginning of the function that uniquely identifie...
Definition StackID.h:67
lldb::addr_t GetCallFrameAddressWithoutMetadata() const
Definition StackID.h:33
void SetPC(lldb::addr_t pc, Process *process)
Definition StackID.cpp:28
bool IsValid() const
Definition StackID.h:47
SymbolContextScope * GetSymbolContextScope() const
Definition StackID.h:35
lldb::addr_t m_pc
The pc value for the function/symbol for this frame.
Definition StackID.h:62
lldb::addr_t GetPC() const
Definition StackID.h:27
lldb::addr_t m_cfa_with_metadata
The cfa with metadata (i.e. prior to Process::FixAddress).
Definition StackID.h:70
friend class StackFrame
Definition StackID.h:54
SymbolContextScope * m_symbol_scope
If nullptr, there is no block or symbol for this frame.
Definition StackID.h:77
void SetSymbolContextScope(SymbolContextScope *symbol_scope)
Definition StackID.h:37
lldb::addr_t GetCallFrameAddressWithMetadata() const
Definition StackID.h:29
void SetCFA(lldb::addr_t cfa, Process *process)
Definition StackID.cpp:32
A stream class that can stream formatted output to a file.
Definition Stream.h:28
"lldb/Symbol/SymbolContextScope.h" Inherit from this if your object is part of a symbol context and c...
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
bool operator!=(const Address &lhs, const Address &rhs)
Definition Address.cpp:1017
bool operator==(const Address &lhs, const Address &rhs)
Definition Address.cpp:1011
bool operator<(const Address &lhs, const Address &rhs)
Definition Address.cpp:980
uint64_t addr_t
Definition lldb-types.h:80