LLDB  mainline
StackFrame.h
Go to the documentation of this file.
1 //===-- StackFrame.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_STACKFRAME_H
10 #define LLDB_TARGET_STACKFRAME_H
11 
12 #include <memory>
13 #include <mutex>
14 
15 #include "lldb/Utility/Flags.h"
16 
20 #include "lldb/Target/StackID.h"
21 #include "lldb/Utility/Scalar.h"
22 #include "lldb/Utility/Status.h"
24 #include "lldb/Utility/UserID.h"
25 
26 namespace lldb_private {
27 
28 /// \class StackFrame StackFrame.h "lldb/Target/StackFrame.h"
29 ///
30 /// This base class provides an interface to stack frames.
31 ///
32 /// StackFrames may have a Canonical Frame Address (CFA) or not.
33 /// A frame may have a plain pc value or it may indicate a specific point in
34 /// the debug session so the correct section load list is used for
35 /// symbolication.
36 ///
37 /// Local variables may be available, or not. A register context may be
38 /// available, or not.
39 
41  public std::enable_shared_from_this<StackFrame> {
42 public:
50  };
51 
52  enum class Kind {
53  /// A regular stack frame with access to registers and local variables.
54  Regular,
55 
56  /// A historical stack frame -- possibly without CFA or registers or
57  /// local variables.
58  History,
59 
60  /// An artificial stack frame (e.g. a synthesized result of inferring
61  /// missing tail call frames from a backtrace) with limited support for
62  /// local variables.
64  };
65 
66  /// Construct a StackFrame object without supplying a RegisterContextSP.
67  ///
68  /// This is the one constructor that doesn't take a RegisterContext
69  /// parameter. This ctor may be called when creating a history StackFrame;
70  /// these are used if we've collected a stack trace of pc addresses at some
71  /// point in the past. We may only have pc values. We may have a CFA,
72  /// or more likely, we won't.
73  ///
74  /// \param [in] thread_sp
75  /// The Thread that this frame belongs to.
76  ///
77  /// \param [in] frame_idx
78  /// This StackFrame's frame index number in the Thread. If inlined stack
79  /// frames are being created, this may differ from the concrete_frame_idx
80  /// which is the frame index without any inlined stack frames.
81  ///
82  /// \param [in] concrete_frame_idx
83  /// The StackFrame's frame index number in the Thread without any inlined
84  /// stack frames being included in the index.
85  ///
86  /// \param [in] cfa
87  /// The Canonical Frame Address (this terminology from DWARF) for this
88  /// stack frame. The CFA for a stack frame does not change over the
89  /// span of the stack frame's existence. It is often the value of the
90  /// caller's stack pointer before the call instruction into this frame's
91  /// function. It is usually not the same as the frame pointer register's
92  /// value.
93  ///
94  /// \param [in] cfa_is_valid
95  /// A history stack frame may not have a CFA value collected. We want to
96  /// distinguish between "no CFA available" and a CFA of
97  /// LLDB_INVALID_ADDRESS.
98  ///
99  /// \param [in] pc
100  /// The current pc value of this stack frame.
101  ///
102  /// \param [in] sc_ptr
103  /// Optionally seed the StackFrame with the SymbolContext information that
104  /// has
105  /// already been discovered.
106  StackFrame(const lldb::ThreadSP &thread_sp, lldb::user_id_t frame_idx,
107  lldb::user_id_t concrete_frame_idx, lldb::addr_t cfa,
108  bool cfa_is_valid, lldb::addr_t pc, Kind frame_kind,
109  bool behaves_like_zeroth_frame, const SymbolContext *sc_ptr);
110 
111  StackFrame(const lldb::ThreadSP &thread_sp, lldb::user_id_t frame_idx,
112  lldb::user_id_t concrete_frame_idx,
113  const lldb::RegisterContextSP &reg_context_sp, lldb::addr_t cfa,
114  lldb::addr_t pc, bool behaves_like_zeroth_frame,
115  const SymbolContext *sc_ptr);
116 
117  StackFrame(const lldb::ThreadSP &thread_sp, lldb::user_id_t frame_idx,
118  lldb::user_id_t concrete_frame_idx,
119  const lldb::RegisterContextSP &reg_context_sp, lldb::addr_t cfa,
120  const Address &pc, bool behaves_like_zeroth_frame,
121  const SymbolContext *sc_ptr);
122 
123  ~StackFrame() override;
124 
125  lldb::ThreadSP GetThread() const { return m_thread_wp.lock(); }
126 
127  StackID &GetStackID();
128 
129  /// Get an Address for the current pc value in this StackFrame.
130  ///
131  /// May not be the same as the actual PC value for inlined stack frames.
132  ///
133  /// \return
134  /// The Address object set to the current PC value.
135  const Address &GetFrameCodeAddress();
136 
137  /// Get the current code Address suitable for symbolication,
138  /// may not be the same as GetFrameCodeAddress().
139  ///
140  /// For a frame in the middle of the stack, the return-pc is the
141  /// current code address, but for symbolication purposes the
142  /// return address after a noreturn call may point to the next
143  /// function, a DWARF location list entry that is a completely
144  /// different code path, or the wrong source line.
145  ///
146  /// The address returned should be used for symbolication (source line,
147  /// block, function, DWARF location entry selection) but should NOT
148  /// be shown to the user. It may not point to an actual instruction
149  /// boundary.
150  ///
151  /// \return
152  /// The Address object set to the current PC value.
154 
155  /// Change the pc value for a given thread.
156  ///
157  /// Change the current pc value for the frame on this thread.
158  ///
159  /// \param[in] pc
160  /// The load address that the pc will be set to.
161  ///
162  /// \return
163  /// true if the pc was changed. false if this failed -- possibly
164  /// because this frame is not a live StackFrame.
165  bool ChangePC(lldb::addr_t pc);
166 
167  /// Provide a SymbolContext for this StackFrame's current pc value.
168  ///
169  /// The StackFrame maintains this SymbolContext and adds additional
170  /// information to it on an as-needed basis. This helps to avoid different
171  /// functions looking up symbolic information for a given pc value multiple
172  /// times.
173  ///
174  /// \param [in] resolve_scope
175  /// Flags from the SymbolContextItem enumerated type which specify what
176  /// type of symbol context is needed by this caller.
177  ///
178  /// \return
179  /// A SymbolContext reference which includes the types of information
180  /// requested by resolve_scope, if they are available.
181  const SymbolContext &GetSymbolContext(lldb::SymbolContextItem resolve_scope);
182 
183  /// Return the Canonical Frame Address (DWARF term) for this frame.
184  ///
185  /// The CFA is typically the value of the stack pointer register before the
186  /// call invocation is made. It will not change during the lifetime of a
187  /// stack frame. It is often not the same thing as the frame pointer
188  /// register value.
189  ///
190  /// Live StackFrames will always have a CFA but other types of frames may
191  /// not be able to supply one.
192  ///
193  /// \param [out] value
194  /// The address of the CFA for this frame, if available.
195  ///
196  /// \param [out] error_ptr
197  /// If there is an error determining the CFA address, this may contain a
198  /// string explaining the failure.
199  ///
200  /// \return
201  /// Returns true if the CFA value was successfully set in value. Some
202  /// frames may be unable to provide this value; they will return false.
203  bool GetFrameBaseValue(Scalar &value, Status *error_ptr);
204 
205  /// Get the DWARFExpressionList corresponding to the Canonical Frame Address.
206  ///
207  /// Often a register (bp), but sometimes a register + offset.
208  ///
209  /// \param [out] error_ptr
210  /// If there is an error determining the CFA address, this may contain a
211  /// string explaining the failure.
212  ///
213  /// \return
214  /// Returns the corresponding DWARF expression, or NULL.
216 
217  /// Get the current lexical scope block for this StackFrame, if possible.
218  ///
219  /// If debug information is available for this stack frame, return a pointer
220  /// to the innermost lexical Block that the frame is currently executing.
221  ///
222  /// \return
223  /// A pointer to the current Block. nullptr is returned if this can
224  /// not be provided.
225  Block *GetFrameBlock();
226 
227  /// Get the RegisterContext for this frame, if possible.
228  ///
229  /// Returns a shared pointer to the RegisterContext for this stack frame.
230  /// Only a live StackFrame object will be able to return a RegisterContext -
231  /// callers must be prepared for an empty shared pointer being returned.
232  ///
233  /// Even a live StackFrame RegisterContext may not be able to provide all
234  /// registers. Only the currently executing frame (frame 0) can reliably
235  /// provide every register in the register context.
236  ///
237  /// \return
238  /// The RegisterContext shared point for this frame.
239  lldb::RegisterContextSP GetRegisterContext();
240 
241  const lldb::RegisterContextSP &GetRegisterContextSP() const {
242  return m_reg_context_sp;
243  }
244 
245  /// Retrieve the list of variables that are in scope at this StackFrame's
246  /// pc.
247  ///
248  /// A frame that is not live may return an empty VariableList for a given
249  /// pc value even though variables would be available at this point if it
250  /// were a live stack frame.
251  ///
252  /// \param[in] get_file_globals
253  /// Whether to also retrieve compilation-unit scoped variables
254  /// that are visible to the entire compilation unit (e.g. file
255  /// static in C, globals that are homed in this CU).
256  ///
257  /// \param [out] error_ptr
258  /// If there is an error in the debug information that prevents variables
259  /// from being fetched. \see SymbolFile::GetFrameVariableError() for full
260  /// details.
261  ///
262  /// \return
263  /// A pointer to a list of variables.
264  VariableList *GetVariableList(bool get_file_globals, Status *error_ptr);
265 
266  /// Retrieve the list of variables that are in scope at this StackFrame's
267  /// pc.
268  ///
269  /// A frame that is not live may return an empty VariableListSP for a
270  /// given pc value even though variables would be available at this point if
271  /// it were a live stack frame.
272  ///
273  /// \param[in] get_file_globals
274  /// Whether to also retrieve compilation-unit scoped variables
275  /// that are visible to the entire compilation unit (e.g. file
276  /// static in C, globals that are homed in this CU).
277  ///
278  /// \return
279  /// A pointer to a list of variables.
280  lldb::VariableListSP
281  GetInScopeVariableList(bool get_file_globals,
282  bool must_have_valid_location = false);
283 
284  /// Create a ValueObject for a variable name / pathname, possibly including
285  /// simple dereference/child selection syntax.
286  ///
287  /// \param[in] var_expr
288  /// The string specifying a variable to base the VariableObject off
289  /// of.
290  ///
291  /// \param[in] use_dynamic
292  /// Whether the correct dynamic type of an object pointer should be
293  /// determined before creating the object, or if the static type is
294  /// sufficient. One of the DynamicValueType enumerated values.
295  ///
296  /// \param[in] options
297  /// An unsigned integer of flags, values from
298  /// StackFrame::ExpressionPathOption
299  /// enum.
300  /// \param[in] var_sp
301  /// A VariableSP that will be set to the variable described in the
302  /// var_expr path.
303  ///
304  /// \param[in] error
305  /// Record any errors encountered while evaluating var_expr.
306  ///
307  /// \return
308  /// A shared pointer to the ValueObject described by var_expr.
309  lldb::ValueObjectSP GetValueForVariableExpressionPath(
310  llvm::StringRef var_expr, lldb::DynamicValueType use_dynamic,
311  uint32_t options, lldb::VariableSP &var_sp, Status &error);
312 
313  /// Determine whether this StackFrame has debug information available or not.
314  ///
315  /// \return
316  /// true if debug information is available for this frame (function,
317  /// compilation unit, block, etc.)
318  bool HasDebugInformation();
319 
320  /// Return the disassembly for the instructions of this StackFrame's
321  /// function as a single C string.
322  ///
323  /// \return
324  /// C string with the assembly instructions for this function.
325  const char *Disassemble();
326 
327  /// Print a description for this frame using the frame-format formatter
328  /// settings.
329  ///
330  /// \param [in] strm
331  /// The Stream to print the description to.
332  ///
333  /// \param [in] show_unique
334  /// Whether to print the function arguments or not for backtrace unique.
335  ///
336  /// \param [in] frame_marker
337  /// Optional string that will be prepended to the frame output description.
338  void DumpUsingSettingsFormat(Stream *strm, bool show_unique = false,
339  const char *frame_marker = nullptr);
340 
341  /// Print a description for this frame using a default format.
342  ///
343  /// \param [in] strm
344  /// The Stream to print the description to.
345  ///
346  /// \param [in] show_frame_index
347  /// Whether to print the frame number or not.
348  ///
349  /// \param [in] show_fullpaths
350  /// Whether to print the full source paths or just the file base name.
351  void Dump(Stream *strm, bool show_frame_index, bool show_fullpaths);
352 
353  /// Print a description of this stack frame and/or the source
354  /// context/assembly for this stack frame.
355  ///
356  /// \param[in] strm
357  /// The Stream to send the output to.
358  ///
359  /// \param[in] show_frame_info
360  /// If true, print the frame info by calling DumpUsingSettingsFormat().
361  ///
362  /// \param[in] show_source
363  /// If true, print source or disassembly as per the user's settings.
364  ///
365  /// \param[in] show_unique
366  /// If true, print using backtrace unique style, without function
367  /// arguments as per the user's settings.
368  ///
369  /// \param[in] frame_marker
370  /// Passed to DumpUsingSettingsFormat() for the frame info printing.
371  ///
372  /// \return
373  /// Returns true if successful.
374  bool GetStatus(Stream &strm, bool show_frame_info, bool show_source,
375  bool show_unique = false, const char *frame_marker = nullptr);
376 
377  /// Query whether this frame is a concrete frame on the call stack, or if it
378  /// is an inlined frame derived from the debug information and presented by
379  /// the debugger.
380  ///
381  /// \return
382  /// true if this is an inlined frame.
383  bool IsInlined();
384 
385  /// Query whether this frame is part of a historical backtrace.
386  bool IsHistorical() const;
387 
388  /// Query whether this frame is artificial (e.g a synthesized result of
389  /// inferring missing tail call frames from a backtrace). Artificial frames
390  /// may have limited support for inspecting variables.
391  bool IsArtificial() const;
392 
393  /// Query this frame to find what frame it is in this Thread's
394  /// StackFrameList.
395  ///
396  /// \return
397  /// StackFrame index 0 indicates the currently-executing function. Inline
398  /// frames are included in this frame index count.
399  uint32_t GetFrameIndex() const;
400 
401  /// Set this frame's synthetic frame index.
402  void SetFrameIndex(uint32_t index) { m_frame_index = index; }
403 
404  /// Query this frame to find what frame it is in this Thread's
405  /// StackFrameList, not counting inlined frames.
406  ///
407  /// \return
408  /// StackFrame index 0 indicates the currently-executing function. Inline
409  /// frames are not included in this frame index count; their concrete
410  /// frame index will be the same as the concrete frame that they are
411  /// derived from.
413 
414  /// Create a ValueObject for a given Variable in this StackFrame.
415  ///
416  /// \param [in] variable_sp
417  /// The Variable to base this ValueObject on
418  ///
419  /// \param [in] use_dynamic
420  /// Whether the correct dynamic type of the variable should be
421  /// determined before creating the ValueObject, or if the static type
422  /// is sufficient. One of the DynamicValueType enumerated values.
423  ///
424  /// \return
425  /// A ValueObject for this variable.
426  lldb::ValueObjectSP
427  GetValueObjectForFrameVariable(const lldb::VariableSP &variable_sp,
428  lldb::DynamicValueType use_dynamic);
429 
430  /// Query this frame to determine what the default language should be when
431  /// parsing expressions given the execution context.
432  ///
433  /// \return
434  /// The language of the frame if known, else lldb::eLanguageTypeUnknown.
436 
437  // similar to GetLanguage(), but is allowed to take a potentially incorrect
438  // guess if exact information is not available
440 
441  /// Attempt to econstruct the ValueObject for a given raw address touched by
442  /// the current instruction. The ExpressionPath should indicate how to get
443  /// to this value using "frame variable."
444  ///
445  /// \param [in] addr
446  /// The raw address.
447  ///
448  /// \return
449  /// The ValueObject if found. If valid, it has a valid ExpressionPath.
450  lldb::ValueObjectSP GuessValueForAddress(lldb::addr_t addr);
451 
452  /// Attempt to reconstruct the ValueObject for the address contained in a
453  /// given register plus an offset. The ExpressionPath should indicate how
454  /// to get to this value using "frame variable."
455  ///
456  /// \param [in] reg
457  /// The name of the register.
458  ///
459  /// \param [in] offset
460  /// The offset from the register. Particularly important for sp...
461  ///
462  /// \return
463  /// The ValueObject if found. If valid, it has a valid ExpressionPath.
464  lldb::ValueObjectSP GuessValueForRegisterAndOffset(ConstString reg,
465  int64_t offset);
466 
467  /// Attempt to reconstruct the ValueObject for a variable with a given \a name
468  /// from within the current StackFrame, within the current block. The search
469  /// for the variable starts in the deepest block corresponding to the current
470  /// PC in the stack frame and traverse through all parent blocks stopping at
471  /// inlined function boundaries.
472  ///
473  /// \param [in] name
474  /// The name of the variable.
475  ///
476  /// \return
477  /// The ValueObject if found.
478  lldb::ValueObjectSP FindVariable(ConstString name);
479 
480  // lldb::ExecutionContextScope pure virtual functions
481  lldb::TargetSP CalculateTarget() override;
482 
483  lldb::ProcessSP CalculateProcess() override;
484 
485  lldb::ThreadSP CalculateThread() override;
486 
487  lldb::StackFrameSP CalculateStackFrame() override;
488 
489  void CalculateExecutionContext(ExecutionContext &exe_ctx) override;
490 
491  lldb::RecognizedStackFrameSP GetRecognizedFrame();
492 
493 protected:
494  friend class StackFrameList;
495 
496  void SetSymbolContextScope(SymbolContextScope *symbol_scope);
497 
499 
501 
502  bool HasCachedData() const;
503 
504 private:
505  // For StackFrame only
506  lldb::ThreadWP m_thread_wp;
509  lldb::RegisterContextSP m_reg_context_sp;
511  Address m_frame_code_addr; // The frame code address (might not be the same as
512  // the actual PC for inlined frames) as a
513  // section/offset address
518  bool m_cfa_is_valid; // Does this frame have a CFA? Different from CFA ==
519  // LLDB_INVALID_ADDRESS
521 
522  // Whether this frame behaves like the zeroth frame, in the sense
523  // that its pc value might not immediately follow a call (and thus might
524  // be the first address of its function). True for actual frame zero as
525  // well as any other frame with the same trait.
527  lldb::VariableListSP m_variable_list_sp;
529  // variable in
530  // m_variable_list_sp
531  lldb::RecognizedStackFrameSP m_recognized_frame_sp;
533  std::recursive_mutex m_mutex;
534 
535  StackFrame(const StackFrame &) = delete;
536  const StackFrame &operator=(const StackFrame &) = delete;
537 };
538 
539 } // namespace lldb_private
540 
541 #endif // LLDB_TARGET_STACKFRAME_H
lldb_private::StackFrame::CalculateTarget
lldb::TargetSP CalculateTarget() override
Definition: StackFrame.cpp:1759
lldb_private::ValueObjectList
A collection of ValueObject values that.
Definition: ValueObjectList.h:23
lldb_private::StackFrame::m_thread_wp
lldb::ThreadWP m_thread_wp
Definition: StackFrame.h:506
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
Scalar.h
lldb_private::StackFrame::m_sc
SymbolContext m_sc
Definition: StackFrame.h:514
lldb_private::StackFrame::~StackFrame
~StackFrame() override
lldb_private::StackFrame::m_stack_frame_kind
Kind m_stack_frame_kind
Definition: StackFrame.h:520
lldb_private::StackFrame::HasCachedData
bool HasCachedData() const
Definition: StackFrame.cpp:1878
lldb_private::StackFrame::GetVariableList
VariableList * GetVariableList(bool get_file_globals, Status *error_ptr)
Retrieve the list of variables that are in scope at this StackFrame's pc.
Definition: StackFrame.cpp:424
lldb_private::StackFrame::m_flags
Flags m_flags
Definition: StackFrame.h:515
lldb_private::StackFrame::SetFrameIndex
void SetFrameIndex(uint32_t index)
Set this frame's synthetic frame index.
Definition: StackFrame.h:402
lldb_private::StackFrame::DumpUsingSettingsFormat
void DumpUsingSettingsFormat(Stream *strm, bool show_unique=false, const char *frame_marker=nullptr)
Print a description for this frame using the frame-format formatter settings.
Definition: StackFrame.cpp:1786
lldb_private::StackFrame::GetFrameCodeAddress
const Address & GetFrameCodeAddress()
Get an Address for the current pc value in this StackFrame.
Definition: StackFrame.cpp:190
lldb_private::Scalar
Definition: Scalar.h:34
lldb_private::StackFrame::GuessValueForRegisterAndOffset
lldb::ValueObjectSP GuessValueForRegisterAndOffset(ConstString reg, int64_t offset)
Attempt to reconstruct the ValueObject for the address contained in a given register plus an offset.
Definition: StackFrame.cpp:1675
lldb_private::StackFrame::GetFrameBlock
Block * GetFrameBlock()
Get the current lexical scope block for this StackFrame, if possible.
Definition: StackFrame.cpp:275
lldb_private::StackFrame::StackFrame
StackFrame(const lldb::ThreadSP &thread_sp, lldb::user_id_t frame_idx, lldb::user_id_t concrete_frame_idx, lldb::addr_t cfa, bool cfa_is_valid, lldb::addr_t pc, Kind frame_kind, bool behaves_like_zeroth_frame, const SymbolContext *sc_ptr)
Construct a StackFrame object without supplying a RegisterContextSP.
lldb_private::StackFrame::Kind::History
@ History
A historical stack frame – possibly without CFA or registers or local variables.
lldb_private::StackFrame::GetFrameBaseExpression
DWARFExpressionList * GetFrameBaseExpression(Status *error_ptr)
Get the DWARFExpressionList corresponding to the Canonical Frame Address.
Definition: StackFrame.cpp:1132
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
lldb_private::Flags
Definition: Flags.h:22
lldb_private::StackFrame::ExpressionPathOption
ExpressionPathOption
Definition: StackFrame.h:43
lldb_private::StackFrame::m_frame_base
Scalar m_frame_base
Definition: StackFrame.h:516
lldb_private::Stream
Definition: Stream.h:28
lldb_private::StackFrame::FindVariable
lldb::ValueObjectSP FindVariable(ConstString name)
Attempt to reconstruct the ValueObject for a variable with a given name from within the current Stack...
Definition: StackFrame.cpp:1724
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
pc
@ pc
Definition: CompactUnwindInfo.cpp:1251
lldb_private::StackFrame::eExpressionPathOptionsNoFragileObjcIvar
@ eExpressionPathOptionsNoFragileObjcIvar
Definition: StackFrame.h:45
lldb_private::SymbolContext
Definition: SymbolContext.h:33
lldb_private::StackFrame::HasDebugInformation
bool HasDebugInformation()
Determine whether this StackFrame has debug information available or not.
Definition: StackFrame.cpp:1153
lldb_private::VariableList
Definition: VariableList.h:18
lldb_private::StackFrame::m_behaves_like_zeroth_frame
bool m_behaves_like_zeroth_frame
Definition: StackFrame.h:526
lldb_private::StackFrame::GetConcreteFrameIndex
uint32_t GetConcreteFrameIndex() const
Query this frame to find what frame it is in this Thread's StackFrameList, not counting inlined frame...
Definition: StackFrame.h:412
lldb_private::StackFrame::m_frame_code_addr
Address m_frame_code_addr
Definition: StackFrame.h:511
lldb_private::StackFrameList
Definition: StackFrameList.h:22
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb_private::StackFrame::m_frame_index
uint32_t m_frame_index
Definition: StackFrame.h:507
lldb_private::StackFrame::IsInlined
bool IsInlined()
Query whether this frame is a concrete frame on the call stack, or if it is an inlined frame derived ...
Definition: StackFrame.cpp:1197
lldb_private::StackFrame::m_id
StackID m_id
Definition: StackFrame.h:510
lldb_private::ExecutionContextScope
Definition: ExecutionContextScope.h:32
lldb_private::StackFrame::CalculateThread
lldb::ThreadSP CalculateThread() override
Definition: StackFrame.cpp:1778
lldb_private::StackFrame::UpdateCurrentFrameFromPreviousFrame
void UpdateCurrentFrameFromPreviousFrame(StackFrame &prev_frame)
Definition: StackFrame.cpp:1840
lldb_private::StackFrame::eExpressionPathOptionCheckPtrVsMember
@ eExpressionPathOptionCheckPtrVsMember
Definition: StackFrame.h:44
lldb_private::StackFrame::m_recognized_frame_sp
lldb::RecognizedStackFrameSP m_recognized_frame_sp
Definition: StackFrame.h:531
StreamString.h
lldb_private::StackFrame::GetValueForVariableExpressionPath
lldb::ValueObjectSP GetValueForVariableExpressionPath(llvm::StringRef var_expr, lldb::DynamicValueType use_dynamic, uint32_t options, lldb::VariableSP &var_sp, Status &error)
Create a ValueObject for a variable name / pathname, possibly including simple dereference/child sele...
Definition: StackFrame.cpp:508
lldb_private::ConstString
Definition: ConstString.h:39
lldb_private::StreamString
Definition: StreamString.h:23
StackID.h
lldb_private::StackFrame::operator=
const StackFrame & operator=(const StackFrame &)=delete
lldb_private::StackFrame::eExpressionPathOptionsNoSyntheticArrayRange
@ eExpressionPathOptionsNoSyntheticArrayRange
Definition: StackFrame.h:47
lldb::DynamicValueType
DynamicValueType
Definition: lldb-enumerations.h:494
lldb_private::StackFrame::Kind::Regular
@ Regular
A regular stack frame with access to registers and local variables.
lldb_private::StackFrame::GetFrameBaseValue
bool GetFrameBaseValue(Scalar &value, Status *error_ptr)
Return the Canonical Frame Address (DWARF term) for this frame.
Definition: StackFrame.cpp:1086
UserID.h
lldb_private::StackFrame::m_frame_base_error
Status m_frame_base_error
Definition: StackFrame.h:517
lldb_private::StackFrame::GetStatus
bool GetStatus(Stream &strm, bool show_frame_info, bool show_source, bool show_unique=false, const char *frame_marker=nullptr)
Print a description of this stack frame and/or the source context/assembly for this stack frame.
Definition: StackFrame.cpp:1888
lldb_private::SymbolContextScope
Definition: SymbolContextScope.h:64
lldb_private::StackFrame::GetStackID
StackID & GetStackID()
Definition: StackFrame.cpp:145
lldb_private::StackFrame::eExpressionPathOptionsNoSyntheticChildren
@ eExpressionPathOptionsNoSyntheticChildren
Definition: StackFrame.h:46
lldb_private::StackFrame::CalculateStackFrame
lldb::StackFrameSP CalculateStackFrame() override
Definition: StackFrame.cpp:1780
lldb_private::StackFrame::m_disassembly
StreamString m_disassembly
Definition: StackFrame.h:532
lldb_private::Status
Definition: Status.h:44
lldb_private::StackFrame::GetThread
lldb::ThreadSP GetThread() const
Definition: StackFrame.h:125
lldb_private::StackFrame::GuessValueForAddress
lldb::ValueObjectSP GuessValueForAddress(lldb::addr_t addr)
Attempt to econstruct the ValueObject for a given raw address touched by the current instruction.
Definition: StackFrame.cpp:1314
lldb_private::Block
Definition: Block.h:41
uint32_t
lldb_private::StackFrame::CalculateExecutionContext
void CalculateExecutionContext(ExecutionContext &exe_ctx) override
Reconstruct the object's execution context into sc.
Definition: StackFrame.cpp:1782
lldb_private::StackFrame::m_mutex
std::recursive_mutex m_mutex
Definition: StackFrame.h:533
lldb_private::StackFrame::GetRegisterContextSP
const lldb::RegisterContextSP & GetRegisterContextSP() const
Definition: StackFrame.h:241
lldb_private::Address
Definition: Address.h:59
lldb_private::StackFrame::GuessLanguage
lldb::LanguageType GuessLanguage()
Definition: StackFrame.cpp:1220
lldb_private::StackFrame::GetLanguage
lldb::LanguageType GetLanguage()
Query this frame to determine what the default language should be when parsing expressions given the ...
Definition: StackFrame.cpp:1213
ExecutionContextScope.h
lldb_private::StackFrame::IsArtificial
bool IsArtificial() const
Query whether this frame is artificial (e.g a synthesized result of inferring missing tail call frame...
Definition: StackFrame.cpp:1209
lldb_private::StackFrame::Disassemble
const char * Disassemble()
Return the disassembly for the instructions of this StackFrame's function as a single C string.
Definition: StackFrame.cpp:261
lldb_private::StackFrame::Dump
void Dump(Stream *strm, bool show_frame_index, bool show_fullpaths)
Print a description for this frame using a default format.
Definition: StackFrame.cpp:1816
lldb_private::StackFrame::eExpressionPathOptionsAllowDirectIVarAccess
@ eExpressionPathOptionsAllowDirectIVarAccess
Definition: StackFrame.h:48
lldb_private::StackFrame::CalculateProcess
lldb::ProcessSP CalculateProcess() override
Definition: StackFrame.cpp:1770
lldb_private::StackFrame::Kind::Artificial
@ Artificial
An artificial stack frame (e.g.
Status.h
lldb::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
SymbolContext.h
lldb_private::StackFrame::m_variable_list_value_objects
ValueObjectList m_variable_list_value_objects
Definition: StackFrame.h:528
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::StackFrame::Kind
Kind
Definition: StackFrame.h:52
lldb_private::StackFrame::GetRegisterContext
lldb::RegisterContextSP GetRegisterContext()
Get the RegisterContext for this frame, if possible.
Definition: StackFrame.cpp:1143
lldb_private::StackFrame::GetFrameCodeAddressForSymbolication
Address GetFrameCodeAddressForSymbolication()
Get the current code Address suitable for symbolication, may not be the same as GetFrameCodeAddress()...
Definition: StackFrame.cpp:222
lldb_private::StackFrame::m_reg_context_sp
lldb::RegisterContextSP m_reg_context_sp
Definition: StackFrame.h:509
lldb_private::StackFrame::IsHistorical
bool IsHistorical() const
Query whether this frame is part of a historical backtrace.
Definition: StackFrame.cpp:1205
lldb_private::StackID
Definition: StackID.h:17
Flags.h
lldb_private::StackFrame::GetRecognizedFrame
lldb::RecognizedStackFrameSP GetRecognizedFrame()
Definition: StackFrame.cpp:1978
lldb_private::DWARFExpressionList
Definition: DWARFExpressionList.h:24
lldb_private::StackFrame::GetFrameIndex
uint32_t GetFrameIndex() const
Query this frame to find what frame it is in this Thread's StackFrameList.
Definition: StackFrame.cpp:175
lldb_private::StackFrame::GetInScopeVariableList
lldb::VariableListSP GetInScopeVariableList(bool get_file_globals, bool must_have_valid_location=false)
Retrieve the list of variables that are in scope at this StackFrame's pc.
Definition: StackFrame.cpp:475
lldb_private::StackFrame::m_cfa_is_valid
bool m_cfa_is_valid
Definition: StackFrame.h:518
lldb_private::StackFrame
Definition: StackFrame.h:40
lldb_private::StackFrame::m_variable_list_sp
lldb::VariableListSP m_variable_list_sp
Definition: StackFrame.h:527
ValueObjectList.h
lldb_private::StackFrame::GetSymbolContext
const SymbolContext & GetSymbolContext(lldb::SymbolContextItem resolve_scope)
Provide a SymbolContext for this StackFrame's current pc value.
Definition: StackFrame.cpp:300
lldb_private::StackFrame::SetSymbolContextScope
void SetSymbolContextScope(SymbolContextScope *symbol_scope)
Definition: StackFrame.cpp:184
lldb_private::StackFrame::ChangePC
bool ChangePC(lldb::addr_t pc)
Change the pc value for a given thread.
Definition: StackFrame.cpp:247
lldb_private::StackFrame::eExpressionPathOptionsInspectAnonymousUnions
@ eExpressionPathOptionsInspectAnonymousUnions
Definition: StackFrame.h:49
lldb_private::StackFrame::UpdatePreviousFrameFromCurrentFrame
void UpdatePreviousFrameFromCurrentFrame(StackFrame &curr_frame)
Definition: StackFrame.cpp:1852
lldb_private::StackFrame::m_concrete_frame_index
uint32_t m_concrete_frame_index
Definition: StackFrame.h:508
lldb_private::StackFrame::GetValueObjectForFrameVariable
lldb::ValueObjectSP GetValueObjectForFrameVariable(const lldb::VariableSP &variable_sp, lldb::DynamicValueType use_dynamic)
Create a ValueObject for a given Variable in this StackFrame.
Definition: StackFrame.cpp:1159