LLDB mainline
StackFrame.h
Go to the documentation of this file.
1
2//===-- StackFrame.h --------------------------------------------*- C++ -*-===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef LLDB_TARGET_STACKFRAME_H
11#define LLDB_TARGET_STACKFRAME_H
12
13#include <memory>
14#include <mutex>
15
16#include "lldb/Utility/Flags.h"
17
21#include "lldb/Target/StackID.h"
22#include "lldb/Utility/Scalar.h"
23#include "lldb/Utility/Status.h"
26#include "lldb/Utility/UserID.h"
28
29namespace lldb_private {
30
31/// \class StackFrame StackFrame.h "lldb/Target/StackFrame.h"
32///
33/// This base class provides an interface to stack frames.
34///
35/// StackFrames may have a Canonical Frame Address (CFA) or not.
36/// A frame may have a plain pc value or it may indicate a specific point in
37/// the debug session so the correct section load list is used for
38/// symbolication.
39///
40/// Local variables may be available, or not. A register context may be
41/// available, or not.
42
44 public std::enable_shared_from_this<StackFrame> {
45public:
54
55 enum class Kind {
56 /// A regular stack frame with access to registers and local variables.
58
59 /// A historical stack frame -- possibly without CFA or registers or
60 /// local variables.
62
63 /// An synthetic stack frame (e.g. a synthesized result from script
64 /// resource) possibly without support for local variables or register.
66 };
67
68 /// Construct a StackFrame object without supplying a RegisterContextSP.
69 ///
70 /// This is the one constructor that doesn't take a RegisterContext
71 /// parameter. This ctor may be called when creating a history StackFrame;
72 /// these are used if we've collected a stack trace of pc addresses at some
73 /// point in the past. We may only have pc values. We may have a CFA,
74 /// or more likely, we won't.
75 ///
76 /// \param [in] thread_sp
77 /// The Thread that this frame belongs to.
78 ///
79 /// \param [in] frame_idx
80 /// This StackFrame's frame index number in the Thread. If inlined stack
81 /// frames are being created, this may differ from the concrete_frame_idx
82 /// which is the frame index without any inlined stack frames.
83 ///
84 /// \param [in] concrete_frame_idx
85 /// The StackFrame's frame index number in the Thread without any inlined
86 /// stack frames being included in the index.
87 ///
88 /// \param [in] cfa
89 /// The Canonical Frame Address (this terminology from DWARF) for this
90 /// stack frame. The CFA for a stack frame does not change over the
91 /// span of the stack frame's existence. It is often the value of the
92 /// caller's stack pointer before the call instruction into this frame's
93 /// function. It is usually not the same as the frame pointer register's
94 /// value.
95 ///
96 /// \param [in] cfa_is_valid
97 /// A history stack frame may not have a CFA value collected. We want to
98 /// distinguish between "no CFA available" and a CFA of
99 /// LLDB_INVALID_ADDRESS.
100 ///
101 /// \param [in] pc
102 /// The current pc value of this stack frame.
103 ///
104 /// \param [in] sc_ptr
105 /// Optionally seed the StackFrame with the SymbolContext information that
106 /// has
107 /// already been discovered.
108 StackFrame(const lldb::ThreadSP &thread_sp, lldb::user_id_t frame_idx,
109 lldb::user_id_t concrete_frame_idx, lldb::addr_t cfa,
110 bool cfa_is_valid, lldb::addr_t pc, Kind frame_kind,
111 bool artificial, bool behaves_like_zeroth_frame,
112 const SymbolContext *sc_ptr);
113
114 StackFrame(const lldb::ThreadSP &thread_sp, lldb::user_id_t frame_idx,
115 lldb::user_id_t concrete_frame_idx,
116 const lldb::RegisterContextSP &reg_context_sp, lldb::addr_t cfa,
117 lldb::addr_t pc, bool behaves_like_zeroth_frame,
118 const SymbolContext *sc_ptr);
119
120 StackFrame(const lldb::ThreadSP &thread_sp, lldb::user_id_t frame_idx,
121 lldb::user_id_t concrete_frame_idx,
122 const lldb::RegisterContextSP &reg_context_sp, lldb::addr_t cfa,
123 const Address &pc, bool behaves_like_zeroth_frame,
124 const SymbolContext *sc_ptr);
125
126 ~StackFrame() override;
127
128 lldb::ThreadSP GetThread() const { return m_thread_wp.lock(); }
129
131
132 /// Get an Address for the current pc value in this StackFrame.
133 ///
134 /// May not be the same as the actual PC value for inlined stack frames.
135 ///
136 /// \return
137 /// The Address object set to the current PC value.
139
140 /// Get the current code Address suitable for symbolication,
141 /// may not be the same as GetFrameCodeAddress().
142 ///
143 /// For a frame in the middle of the stack, the return-pc is the
144 /// current code address, but for symbolication purposes the
145 /// return address after a noreturn call may point to the next
146 /// function, a DWARF location list entry that is a completely
147 /// different code path, or the wrong source line.
148 ///
149 /// The address returned should be used for symbolication (source line,
150 /// block, function, DWARF location entry selection) but should NOT
151 /// be shown to the user. It may not point to an actual instruction
152 /// boundary.
153 ///
154 /// \return
155 /// The Address object set to the current PC value.
157
158 /// Change the pc value for a given thread.
159 ///
160 /// Change the current pc value for the frame on this thread.
161 ///
162 /// \param[in] pc
163 /// The load address that the pc will be set to.
164 ///
165 /// \return
166 /// true if the pc was changed. false if this failed -- possibly
167 /// because this frame is not a live StackFrame.
169
170 /// Provide a SymbolContext for this StackFrame's current pc value.
171 ///
172 /// The StackFrame maintains this SymbolContext and adds additional
173 /// information to it on an as-needed basis. This helps to avoid different
174 /// functions looking up symbolic information for a given pc value multiple
175 /// times.
176 ///
177 /// \param [in] resolve_scope
178 /// Flags from the SymbolContextItem enumerated type which specify what
179 /// type of symbol context is needed by this caller.
180 ///
181 /// \return
182 /// A SymbolContext reference which includes the types of information
183 /// requested by resolve_scope, if they are available.
184 const SymbolContext &GetSymbolContext(lldb::SymbolContextItem resolve_scope);
185
186 /// Return the Canonical Frame Address (DWARF term) for this frame.
187 ///
188 /// The CFA is typically the value of the stack pointer register before the
189 /// call invocation is made. It will not change during the lifetime of a
190 /// stack frame. It is often not the same thing as the frame pointer
191 /// register value.
192 ///
193 /// Live StackFrames will always have a CFA but other types of frames may
194 /// not be able to supply one.
195 ///
196 /// \param [out] value
197 /// The address of the CFA for this frame, if available.
198 ///
199 /// \return
200 /// If there is an error determining the CFA address, return an error
201 /// explaining the failure. Success otherwise.
202 llvm::Error GetFrameBaseValue(Scalar &value);
203
204 /// Get the DWARFExpressionList corresponding to the Canonical Frame Address.
205 ///
206 /// Often a register (bp), but sometimes a register + offset.
207 ///
208 /// \param [out] error_ptr
209 /// If there is an error determining the CFA address, this may contain a
210 /// string explaining the failure.
211 ///
212 /// \return
213 /// Returns the corresponding DWARF expression, or NULL.
215
216 /// Get the current lexical scope block for this StackFrame, if possible.
217 ///
218 /// If debug information is available for this stack frame, return a pointer
219 /// to the innermost lexical Block that the frame is currently executing.
220 ///
221 /// \return
222 /// A pointer to the current Block. nullptr is returned if this can
223 /// not be provided.
225
226 /// Get the RegisterContext for this frame, if possible.
227 ///
228 /// Returns a shared pointer to the RegisterContext for this stack frame.
229 /// Only a live StackFrame object will be able to return a RegisterContext -
230 /// callers must be prepared for an empty shared pointer being returned.
231 ///
232 /// Even a live StackFrame RegisterContext may not be able to provide all
233 /// registers. Only the currently executing frame (frame 0) can reliably
234 /// provide every register in the register context.
235 ///
236 /// \return
237 /// The RegisterContext shared point for this frame.
239
243
244 /// Retrieve the list of variables whose scope either:
245 /// * contains this StackFrame's pc,
246 /// * is a child of this StackFrame's current scope.
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 /// \param[in] must_have_valid_location
279 /// Whether to filter variables whose location is not available at this
280 /// StackFrame's pc.
281 /// \return
282 /// A pointer to a list of variables.
284 GetInScopeVariableList(bool get_file_globals,
285 bool must_have_valid_location = false);
286
287 /// Create a ValueObject for a variable name / pathname, possibly including
288 /// simple dereference/child selection syntax.
289 ///
290 /// \param[in] var_expr
291 /// The string specifying a variable to base the VariableObject off
292 /// of.
293 ///
294 /// \param[in] use_dynamic
295 /// Whether the correct dynamic type of an object pointer should be
296 /// determined before creating the object, or if the static type is
297 /// sufficient. One of the DynamicValueType enumerated values.
298 ///
299 /// \param[in] options
300 /// An unsigned integer of flags, values from
301 /// StackFrame::ExpressionPathOption
302 /// enum.
303 /// \param[in] var_sp
304 /// A VariableSP that will be set to the variable described in the
305 /// var_expr path.
306 ///
307 /// \param[in] error
308 /// Record any errors encountered while evaluating var_expr.
309 ///
310 /// \return
311 /// A shared pointer to the ValueObject described by var_expr.
313 llvm::StringRef var_expr, lldb::DynamicValueType use_dynamic,
314 uint32_t options, lldb::VariableSP &var_sp, Status &error);
315
316 /// Determine whether this StackFrame has debug information available or not.
317 ///
318 /// \return
319 /// true if debug information is available for this frame (function,
320 /// compilation unit, block, etc.)
321 bool HasDebugInformation();
322
323 /// Return the disassembly for the instructions of this StackFrame's
324 /// function as a single C string.
325 ///
326 /// \return
327 /// C string with the assembly instructions for this function.
328 const char *Disassemble();
329
330 /// Print a description of this frame using the provided frame format.
331 ///
332 /// \param[out] strm
333 /// The Stream to print the description to.
334 ///
335 /// \param[in] frame_marker
336 /// Optional string that will be prepended to the frame output description.
337 ///
338 /// \return
339 /// \b true if and only if dumping with the given \p format worked.
340 bool DumpUsingFormat(Stream &strm,
342 llvm::StringRef frame_marker = {});
343
344 /// Print a description for this frame using the frame-format formatter
345 /// settings. If the current frame-format settings are invalid, then the
346 /// default formatter will be used (see \a StackFrame::Dump()).
347 ///
348 /// \param [in] strm
349 /// The Stream to print the description to.
350 ///
351 /// \param [in] show_unique
352 /// Whether to print the function arguments or not for backtrace unique.
353 ///
354 /// \param [in] frame_marker
355 /// Optional string that will be prepended to the frame output description.
356 void DumpUsingSettingsFormat(Stream *strm, bool show_unique = false,
357 const char *frame_marker = nullptr);
358
359 /// Print a description for this frame using a default format.
360 ///
361 /// \param [in] strm
362 /// The Stream to print the description to.
363 ///
364 /// \param [in] show_frame_index
365 /// Whether to print the frame number or not.
366 ///
367 /// \param [in] show_fullpaths
368 /// Whether to print the full source paths or just the file base name.
369 void Dump(Stream *strm, bool show_frame_index, bool show_fullpaths);
370
371 /// Print a description of this stack frame and/or the source
372 /// context/assembly for this stack frame.
373 ///
374 /// \param[in] strm
375 /// The Stream to send the output to.
376 ///
377 /// \param[in] show_frame_info
378 /// If true, print the frame info by calling DumpUsingSettingsFormat().
379 ///
380 /// \param[in] show_source
381 /// If true, print source or disassembly as per the user's settings.
382 ///
383 /// \param[in] show_unique
384 /// If true, print using backtrace unique style, without function
385 /// arguments as per the user's settings.
386 ///
387 /// \param[in] frame_marker
388 /// Passed to DumpUsingSettingsFormat() for the frame info printing.
389 ///
390 /// \return
391 /// Returns true if successful.
392 bool GetStatus(Stream &strm, bool show_frame_info, bool show_source,
393 bool show_unique = false, const char *frame_marker = nullptr);
394
395 /// Query whether this frame is a concrete frame on the call stack, or if it
396 /// is an inlined frame derived from the debug information and presented by
397 /// the debugger.
398 ///
399 /// \return
400 /// true if this is an inlined frame.
401 virtual bool IsInlined();
402
403 /// Query whether this frame is synthetic.
404 bool IsSynthetic() const;
405
406 /// Query whether this frame is part of a historical backtrace.
407 bool IsHistorical() const;
408
409 /// Query whether this frame is artificial (e.g a synthesized result of
410 /// inferring missing tail call frames from a backtrace). Artificial frames
411 /// may have limited support for inspecting variables.
412 virtual bool IsArtificial() const;
413
414 /// Query whether this frame should be hidden from backtraces. Frame
415 /// recognizers can customize this behavior and hide distracting
416 /// system implementation details this way.
417 virtual bool IsHidden();
418
419 /// Language plugins can use this API to report language-specific
420 /// runtime information about this compile unit, such as additional
421 /// language version details or feature flags.
423
424 /// Get the frame's demangled name.
425 ///
426 /// /// \return
427 /// A C-String containing the function demangled name. Can be null.
428 virtual const char *GetFunctionName();
429
430 /// Get the frame's demangled display name.
431 ///
432 /// /// \return
433 /// A C-String containing the function demangled display name. Can be null.
434 virtual const char *GetDisplayFunctionName();
435
436 /// Query this frame to find what frame it is in this Thread's
437 /// StackFrameList.
438 ///
439 /// \return
440 /// StackFrame index 0 indicates the currently-executing function. Inline
441 /// frames are included in this frame index count.
442 uint32_t GetFrameIndex() const;
443
444 /// Set this frame's synthetic frame index.
445 void SetFrameIndex(uint32_t index) { m_frame_index = index; }
446
447 /// Query this frame to find what frame it is in this Thread's
448 /// StackFrameList, not counting inlined frames.
449 ///
450 /// \return
451 /// StackFrame index 0 indicates the currently-executing function. Inline
452 /// frames are not included in this frame index count; their concrete
453 /// frame index will be the same as the concrete frame that they are
454 /// derived from.
456
457 /// Create a ValueObject for a given Variable in this StackFrame.
458 ///
459 /// \param [in] variable_sp
460 /// The Variable to base this ValueObject on
461 ///
462 /// \param [in] use_dynamic
463 /// Whether the correct dynamic type of the variable should be
464 /// determined before creating the ValueObject, or if the static type
465 /// is sufficient. One of the DynamicValueType enumerated values.
466 ///
467 /// \return
468 /// A ValueObject for this variable.
471 lldb::DynamicValueType use_dynamic);
472
473 /// Query this frame to determine what the default language should be when
474 /// parsing expressions given the execution context.
475 ///
476 /// \return The language of the frame if known.
478
479 /// Similar to GetLanguage(), but is allowed to take a potentially incorrect
480 /// guess if exact information is not available.
482
483 /// Attempt to econstruct the ValueObject for a given raw address touched by
484 /// the current instruction. The ExpressionPath should indicate how to get
485 /// to this value using "frame variable."
486 ///
487 /// \param [in] addr
488 /// The raw address.
489 ///
490 /// \return
491 /// The ValueObject if found. If valid, it has a valid ExpressionPath.
493
494 /// Attempt to reconstruct the ValueObject for the address contained in a
495 /// given register plus an offset. The ExpressionPath should indicate how
496 /// to get to this value using "frame variable."
497 ///
498 /// \param [in] reg
499 /// The name of the register.
500 ///
501 /// \param [in] offset
502 /// The offset from the register. Particularly important for sp...
503 ///
504 /// \return
505 /// The ValueObject if found. If valid, it has a valid ExpressionPath.
507 int64_t offset);
508
509 /// Attempt to reconstruct the ValueObject for a variable with a given \a name
510 /// from within the current StackFrame, within the current block. The search
511 /// for the variable starts in the deepest block corresponding to the current
512 /// PC in the stack frame and traverse through all parent blocks stopping at
513 /// inlined function boundaries.
514 ///
515 /// \param [in] name
516 /// The name of the variable.
517 ///
518 /// \return
519 /// The ValueObject if found.
521
522 // lldb::ExecutionContextScope pure virtual functions
524
526
528
530
531 void CalculateExecutionContext(ExecutionContext &exe_ctx) override;
532
534
535protected:
536 friend class StackFrameList;
537
538 void SetSymbolContextScope(SymbolContextScope *symbol_scope);
539
541
543
544 bool HasCachedData() const;
545
546 /// For StackFrame and derived classes only.
547 /// \{
553 /// \}
554
555 /// The frame code address (might not be the same as the actual PC
556 /// for inlined frames) as a section/offset address.
563 /// Does this frame have a CFA? Different from CFA == LLDB_INVALID_ADDRESS.
566 /// Is this an artificial stack frame (e.g. a synthesized result of inferring
567 /// missing tail call frames from a backtrace) with limited support for
568 /// local variables. Orthogonal to `StackFrame::Kind`.
570
571 /// Whether this frame behaves like the zeroth frame, in the sense
572 /// that its pc value might not immediately follow a call (and thus might
573 /// be the first address of its function). True for actual frame zero as
574 /// well as any other frame with the same trait.
577 /// Value objects for each variable in m_variable_list_sp.
579 std::optional<lldb::RecognizedStackFrameSP> m_recognized_frame_sp;
581 std::recursive_mutex m_mutex;
582
583private:
584 /// Private methods, called from GetValueForVariableExpressionPath.
585 /// See that method for documentation of parameters and return value.
587 llvm::StringRef var_expr, lldb::DynamicValueType use_dynamic,
588 uint32_t options, lldb::VariableSP &var_sp, Status &error);
589
591 llvm::StringRef var_expr, lldb::DynamicValueType use_dynamic,
592 uint32_t options, lldb::VariableSP &var_sp, Status &error);
593
594 StackFrame(const StackFrame &) = delete;
595 const StackFrame &operator=(const StackFrame &) = delete;
596};
597
598} // namespace lldb_private
599
600#endif // LLDB_TARGET_STACKFRAME_H
static llvm::raw_ostream & error(Stream &strm)
A section + offset based address class.
Definition Address.h:62
A class that describes a single lexical block.
Definition Block.h:41
A uniqued constant string class.
Definition ConstString.h:40
"lldb/Expression/DWARFExpressionList.h" Encapsulates a range map from file address range to a single ...
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A class to manage flags.
Definition Flags.h:22
void SetSymbolContextScope(SymbolContextScope *symbol_scope)
uint16_t m_frame_recognizer_generation
Definition StackFrame.h:562
lldb::VariableListSP m_variable_list_sp
Definition StackFrame.h:576
void UpdatePreviousFrameFromCurrentFrame(StackFrame &curr_frame)
bool m_artificial
Is this an artificial stack frame (e.g.
Definition StackFrame.h:569
lldb::ThreadSP GetThread() const
Definition StackFrame.h:128
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:455
Address m_frame_code_addr
The frame code address (might not be the same as the actual PC for inlined frames) as a section/offse...
Definition StackFrame.h:557
@ eExpressionPathOptionsInspectAnonymousUnions
Definition StackFrame.h:52
@ eExpressionPathOptionsAllowDirectIVarAccess
Definition StackFrame.h:51
@ eExpressionPathOptionsNoSyntheticArrayRange
Definition StackFrame.h:50
virtual const char * GetFunctionName()
Get the frame's demangled name.
virtual bool IsHidden()
Query whether this frame should be hidden from backtraces.
VariableList * GetVariableList(bool get_file_globals, Status *error_ptr)
Retrieve the list of variables whose scope either:
bool IsSynthetic() const
Query whether this frame is synthetic.
DWARFExpressionList * GetFrameBaseExpression(Status *error_ptr)
Get the DWARFExpressionList corresponding to the Canonical Frame Address.
void SetFrameIndex(uint32_t index)
Set this frame's synthetic frame index.
Definition StackFrame.h:445
void UpdateCurrentFrameFromPreviousFrame(StackFrame &prev_frame)
const StackFrame & operator=(const StackFrame &)=delete
ValueObjectList m_variable_list_value_objects
Value objects for each variable in m_variable_list_sp.
Definition StackFrame.h:578
bool m_cfa_is_valid
Does this frame have a CFA? Different from CFA == LLDB_INVALID_ADDRESS.
Definition StackFrame.h:564
llvm::Error GetFrameBaseValue(Scalar &value)
Return the Canonical Frame Address (DWARF term) for this frame.
lldb::ThreadWP m_thread_wp
For StackFrame and derived classes only.
Definition StackFrame.h:548
std::optional< lldb::RecognizedStackFrameSP > m_recognized_frame_sp
Definition StackFrame.h:579
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.
virtual bool IsInlined()
Query whether this frame is a concrete frame on the call stack, or if it is an inlined frame derived ...
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...
SourceLanguage GuessLanguage()
Similar to GetLanguage(), but is allowed to take a potentially incorrect guess if exact information i...
lldb::RegisterContextSP GetRegisterContext()
Get the RegisterContext for this frame, if possible.
lldb::RegisterContextSP m_reg_context_sp
Definition StackFrame.h:551
lldb::ValueObjectSP GuessValueForRegisterAndOffset(ConstString reg, int64_t offset)
Attempt to reconstruct the ValueObject for the address contained in a given register plus an offset.
StackFrame(const StackFrame &)=delete
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.
StructuredData::ObjectSP GetLanguageSpecificData()
Language plugins can use this API to report language-specific runtime information about this compile ...
Address GetFrameCodeAddressForSymbolication()
Get the current code Address suitable for symbolication, may not be the same as GetFrameCodeAddress()...
@ History
A historical stack frame – possibly without CFA or registers or local variables.
Definition StackFrame.h:61
@ Regular
A regular stack frame with access to registers and local variables.
Definition StackFrame.h:57
@ Synthetic
An synthetic stack frame (e.g.
Definition StackFrame.h:65
lldb::ValueObjectSP DILGetValueForVariableExpressionPath(llvm::StringRef var_expr, lldb::DynamicValueType use_dynamic, uint32_t options, lldb::VariableSP &var_sp, Status &error)
bool m_behaves_like_zeroth_frame
Whether this frame behaves like the zeroth frame, in the sense that its pc value might not immediatel...
Definition StackFrame.h:575
lldb::ValueObjectSP GuessValueForAddress(lldb::addr_t addr)
Attempt to econstruct the ValueObject for a given raw address touched by the current instruction.
bool ChangePC(lldb::addr_t pc)
Change the pc value for a given thread.
lldb::ValueObjectSP LegacyGetValueForVariableExpressionPath(llvm::StringRef var_expr, lldb::DynamicValueType use_dynamic, uint32_t options, lldb::VariableSP &var_sp, Status &error)
Private methods, called from GetValueForVariableExpressionPath.
lldb::ThreadSP CalculateThread() override
SourceLanguage GetLanguage()
Query this frame to determine what the default language should be when parsing expressions given the ...
lldb::ValueObjectSP GetValueObjectForFrameVariable(const lldb::VariableSP &variable_sp, lldb::DynamicValueType use_dynamic)
Create a ValueObject for a given Variable in this StackFrame.
StreamString m_disassembly
Definition StackFrame.h:580
lldb::StackFrameSP CalculateStackFrame() override
const SymbolContext & GetSymbolContext(lldb::SymbolContextItem resolve_scope)
Provide a SymbolContext for this StackFrame's current pc value.
virtual const char * GetDisplayFunctionName()
Get the frame's demangled display name.
bool IsHistorical() const
Query whether this frame is part of a historical backtrace.
const char * Disassemble()
Return the disassembly for the instructions of this StackFrame's function as a single C string.
virtual bool IsArtificial() const
Query whether this frame is artificial (e.g a synthesized result of inferring missing tail call frame...
void CalculateExecutionContext(ExecutionContext &exe_ctx) override
Reconstruct the object's execution context into sc.
void Dump(Stream *strm, bool show_frame_index, bool show_fullpaths)
Print a description for this frame using a default format.
uint32_t GetFrameIndex() const
Query this frame to find what frame it is in this Thread's StackFrameList.
bool HasDebugInformation()
Determine whether this StackFrame has debug information available or not.
friend class StackFrameList
Definition StackFrame.h:536
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.
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 artificial, bool behaves_like_zeroth_frame, const SymbolContext *sc_ptr)
Construct a StackFrame object without supplying a RegisterContextSP.
Block * GetFrameBlock()
Get the current lexical scope block for this StackFrame, if possible.
bool DumpUsingFormat(Stream &strm, const lldb_private::FormatEntity::Entry *format, llvm::StringRef frame_marker={})
Print a description of this frame using the provided frame format.
lldb::ProcessSP CalculateProcess() override
const lldb::RegisterContextSP & GetRegisterContextSP() const
Definition StackFrame.h:240
lldb::RecognizedStackFrameSP GetRecognizedFrame()
std::recursive_mutex m_mutex
Definition StackFrame.h:581
lldb::ValueObjectSP FindVariable(ConstString name)
Attempt to reconstruct the ValueObject for a variable with a given name from within the current Stack...
const Address & GetFrameCodeAddress()
Get an Address for the current pc value in this StackFrame.
lldb::TargetSP CalculateTarget() override
An error handling class.
Definition Status.h:118
A stream class that can stream formatted output to a file.
Definition Stream.h:28
std::shared_ptr< Object > ObjectSP
"lldb/Symbol/SymbolContextScope.h" Inherit from this if your object is part of a symbol context and c...
Defines a symbol context baton that can be handed other debug core functions.
A collection of ValueObject values that.
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::RecognizedStackFrame > RecognizedStackFrameSP
std::shared_ptr< lldb_private::Thread > ThreadSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::VariableList > VariableListSP
std::shared_ptr< lldb_private::Variable > VariableSP
uint64_t user_id_t
Definition lldb-types.h:82
uint64_t addr_t
Definition lldb-types.h:80
std::shared_ptr< lldb_private::Target > TargetSP
std::weak_ptr< lldb_private::Thread > ThreadWP
std::shared_ptr< lldb_private::RegisterContext > RegisterContextSP
A type-erased pair of llvm::dwarf::SourceLanguageName and version.