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:
46 /// LLVM RTTI support.
47 /// \{
48 static char ID;
49 virtual bool isA(const void *ClassID) const { return ClassID == &ID; }
50 static bool classof(const StackFrame *obj) { return obj->isA(&ID); }
51 /// \}
52
63
64 enum class Kind {
65 /// A regular stack frame with access to registers and local variables.
67
68 /// A historical stack frame -- possibly without CFA or registers or
69 /// local variables.
71
72 /// An synthetic stack frame (e.g. a synthesized result from script
73 /// resource) possibly without support for local variables or register.
75 };
76
77 /// Construct a StackFrame object without supplying a RegisterContextSP.
78 ///
79 /// This is the one constructor that doesn't take a RegisterContext
80 /// parameter. This ctor may be called when creating a history StackFrame;
81 /// these are used if we've collected a stack trace of pc addresses at some
82 /// point in the past. We may only have pc values. We may have a CFA,
83 /// or more likely, we won't.
84 ///
85 /// \param [in] thread_sp
86 /// The Thread that this frame belongs to.
87 ///
88 /// \param [in] frame_idx
89 /// This StackFrame's frame index number in the Thread. If inlined stack
90 /// frames are being created, this may differ from the concrete_frame_idx
91 /// which is the frame index without any inlined stack frames.
92 ///
93 /// \param [in] concrete_frame_idx
94 /// The StackFrame's frame index number in the Thread without any inlined
95 /// stack frames being included in the index.
96 ///
97 /// \param [in] cfa
98 /// The Canonical Frame Address (this terminology from DWARF) for this
99 /// stack frame. The CFA for a stack frame does not change over the
100 /// span of the stack frame's existence. It is often the value of the
101 /// caller's stack pointer before the call instruction into this frame's
102 /// function. It is usually not the same as the frame pointer register's
103 /// value.
104 ///
105 /// \param [in] cfa_is_valid
106 /// A history stack frame may not have a CFA value collected. We want to
107 /// distinguish between "no CFA available" and a CFA of
108 /// LLDB_INVALID_ADDRESS.
109 ///
110 /// \param [in] pc
111 /// The current pc value of this stack frame.
112 ///
113 /// \param [in] sc_ptr
114 /// Optionally seed the StackFrame with the SymbolContext information that
115 /// has
116 /// already been discovered.
117 StackFrame(const lldb::ThreadSP &thread_sp, lldb::user_id_t frame_idx,
118 lldb::user_id_t concrete_frame_idx, lldb::addr_t cfa,
119 bool cfa_is_valid, lldb::addr_t pc, Kind frame_kind,
120 bool artificial, bool behaves_like_zeroth_frame,
121 const SymbolContext *sc_ptr);
122
123 StackFrame(const lldb::ThreadSP &thread_sp, lldb::user_id_t frame_idx,
124 lldb::user_id_t concrete_frame_idx,
125 const lldb::RegisterContextSP &reg_context_sp, lldb::addr_t cfa,
126 lldb::addr_t pc, bool behaves_like_zeroth_frame,
127 const SymbolContext *sc_ptr);
128
129 StackFrame(const lldb::ThreadSP &thread_sp, lldb::user_id_t frame_idx,
130 lldb::user_id_t concrete_frame_idx,
131 const lldb::RegisterContextSP &reg_context_sp, lldb::addr_t cfa,
132 const Address &pc, bool behaves_like_zeroth_frame,
133 const SymbolContext *sc_ptr);
134
135 ~StackFrame() override;
136
137 lldb::ThreadSP GetThread() const { return m_thread_wp.lock(); }
138
139 virtual StackID &GetStackID();
140
141 /// Get an Address for the current pc value in this StackFrame.
142 ///
143 /// May not be the same as the actual PC value for inlined stack frames.
144 ///
145 /// \return
146 /// The Address object set to the current PC value.
147 virtual const Address &GetFrameCodeAddress();
148
149 /// Get the current code Address suitable for symbolication,
150 /// may not be the same as GetFrameCodeAddress().
151 ///
152 /// For a frame in the middle of the stack, the return-pc is the
153 /// current code address, but for symbolication purposes the
154 /// return address after a noreturn call may point to the next
155 /// function, a DWARF location list entry that is a completely
156 /// different code path, or the wrong source line.
157 ///
158 /// The address returned should be used for symbolication (source line,
159 /// block, function, DWARF location entry selection) but should NOT
160 /// be shown to the user. It may not point to an actual instruction
161 /// boundary.
162 ///
163 /// \return
164 /// The Address object set to the current PC value.
166
167 /// Change the pc value for a given thread.
168 ///
169 /// Change the current pc value for the frame on this thread.
170 ///
171 /// \param[in] pc
172 /// The load address that the pc will be set to.
173 ///
174 /// \return
175 /// true if the pc was changed. false if this failed -- possibly
176 /// because this frame is not a live StackFrame.
177 virtual bool ChangePC(lldb::addr_t pc);
178
179 /// Provide a SymbolContext for this StackFrame's current pc value.
180 ///
181 /// The StackFrame maintains this SymbolContext and adds additional
182 /// information to it on an as-needed basis. This helps to avoid different
183 /// functions looking up symbolic information for a given pc value multiple
184 /// times.
185 ///
186 /// \param [in] resolve_scope
187 /// Flags from the SymbolContextItem enumerated type which specify what
188 /// type of symbol context is needed by this caller.
189 ///
190 /// \return
191 /// A SymbolContext reference which includes the types of information
192 /// requested by resolve_scope, if they are available.
193 virtual const SymbolContext &
194 GetSymbolContext(lldb::SymbolContextItem resolve_scope);
195
196 /// Return the Canonical Frame Address (DWARF term) for this frame.
197 ///
198 /// The CFA is typically the value of the stack pointer register before the
199 /// call invocation is made. It will not change during the lifetime of a
200 /// stack frame. It is often not the same thing as the frame pointer
201 /// register value.
202 ///
203 /// Live StackFrames will always have a CFA but other types of frames may
204 /// not be able to supply one.
205 ///
206 /// \param [out] value
207 /// The address of the CFA for this frame, if available.
208 ///
209 /// \return
210 /// If there is an error determining the CFA address, return an error
211 /// explaining the failure. Success otherwise.
212 virtual llvm::Error GetFrameBaseValue(Scalar &value);
213
214 /// Get the DWARFExpressionList corresponding to the Canonical Frame Address.
215 ///
216 /// Often a register (bp), but sometimes a register + offset.
217 ///
218 /// \param [out] error_ptr
219 /// If there is an error determining the CFA address, this may contain a
220 /// string explaining the failure.
221 ///
222 /// \return
223 /// Returns the corresponding DWARF expression, or NULL.
225
226 /// Get the current lexical scope block for this StackFrame, if possible.
227 ///
228 /// If debug information is available for this stack frame, return a pointer
229 /// to the innermost lexical Block that the frame is currently executing.
230 ///
231 /// \return
232 /// A pointer to the current Block. nullptr is returned if this can
233 /// not be provided.
234 virtual Block *GetFrameBlock();
235
236 /// Get the RegisterContext for this frame, if possible.
237 ///
238 /// Returns a shared pointer to the RegisterContext for this stack frame.
239 /// Only a live StackFrame object will be able to return a RegisterContext -
240 /// callers must be prepared for an empty shared pointer being returned.
241 ///
242 /// Even a live StackFrame RegisterContext may not be able to provide all
243 /// registers. Only the currently executing frame (frame 0) can reliably
244 /// provide every register in the register context.
245 ///
246 /// \return
247 /// The RegisterContext shared point for this frame.
249
253
254 /// Retrieve the list of variables whose scope either:
255 /// * contains this StackFrame's pc,
256 /// * is a child of this StackFrame's current scope.
257 ///
258 /// A frame that is not live may return an empty VariableList for a given
259 /// pc value even though variables would be available at this point if it
260 /// were a live stack frame.
261 ///
262 /// \param[in] get_file_globals
263 /// Whether to also retrieve compilation-unit scoped variables
264 /// that are visible to the entire compilation unit (e.g. file
265 /// static in C, globals that are homed in this CU).
266 ///
267 /// \param[in] include_synthetic_vars
268 /// Whether to also include synthetic variables from other
269 /// sources. For example, synthetic frames can produce
270 /// variables that aren't strictly 'variables', but can still
271 /// be displayed with their values.
272 ///
273 /// \param [out] error_ptr
274 /// If there is an error in the debug information that prevents variables
275 /// from being fetched. \see SymbolFile::GetFrameVariableError() for full
276 /// details.
277 ///
278 /// \return
279 /// A pointer to a list of variables.
280 virtual VariableList *GetVariableList(bool get_file_globals,
281 bool include_synthetic_vars,
282 Status *error_ptr);
283
284 /// Retrieve the list of variables that are in scope at this StackFrame's
285 /// pc.
286 ///
287 /// A frame that is not live may return an empty VariableListSP for a
288 /// given pc value even though variables would be available at this point if
289 /// it were a live stack frame.
290 ///
291 /// \param[in] get_file_globals
292 /// Whether to also retrieve compilation-unit scoped variables
293 /// that are visible to the entire compilation unit (e.g. file
294 /// static in C, globals that are homed in this CU).
295 ///
296 /// \param[in] include_synthetic_vars
297 /// Whether to also include synthetic variables from other
298 /// sources. For example, synthetic frames can produce
299 /// variables that aren't strictly 'variables', but can still
300 /// be displayed with their values. Defaults to `true` because
301 /// we are assuming that if a user's context has synthetic variables,
302 /// they want them shown.
303 ///
304 /// \param[in] must_have_valid_location
305 /// Whether to filter variables whose location is not available at this
306 /// StackFrame's pc.
307 /// \return
308 /// A pointer to a list of variables.
310 GetInScopeVariableList(bool get_file_globals,
311 bool include_synthetic_vars = true,
312 bool must_have_valid_location = false);
313
314 /// Create a ValueObject for a variable name / pathname, possibly including
315 /// simple dereference/child selection syntax.
316 ///
317 /// \param[in] var_expr
318 /// The string specifying a variable to base the VariableObject off
319 /// of.
320 ///
321 /// \param[in] use_dynamic
322 /// Whether the correct dynamic type of an object pointer should be
323 /// determined before creating the object, or if the static type is
324 /// sufficient. One of the DynamicValueType enumerated values.
325 ///
326 /// \param[in] options
327 /// An unsigned integer of flags, values from
328 /// StackFrame::ExpressionPathOption
329 /// enum.
330 /// \param[in] var_sp
331 /// A VariableSP that will be set to the variable described in the
332 /// var_expr path.
333 ///
334 /// \param[in] error
335 /// Record any errors encountered while evaluating var_expr.
336 ///
337 /// \param[in] mode
338 /// Data Inspection Language (DIL) evaluation mode.
339 /// \see lldb::DILMode
340 ///
341 /// \return
342 /// A shared pointer to the ValueObject described by var_expr.
344 llvm::StringRef var_expr, lldb::DynamicValueType use_dynamic,
345 uint32_t options, lldb::VariableSP &var_sp, Status &error,
347
348 /// Determine whether this StackFrame has debug information available or not.
349 ///
350 /// \return
351 /// true if debug information is available for this frame (function,
352 /// compilation unit, block, etc.)
353 virtual bool HasDebugInformation();
354
355 /// Return the disassembly for the instructions of this StackFrame's
356 /// function as a single C string.
357 ///
358 /// \return
359 /// C string with the assembly instructions for this function.
360 virtual const char *Disassemble();
361
362 /// Print a description of this frame using the provided frame format.
363 ///
364 /// \param[out] strm
365 /// The Stream to print the description to.
366 ///
367 /// \param[in] frame_marker
368 /// Optional string that will be prepended to the frame output description.
369 ///
370 /// \return
371 /// \b true if and only if dumping with the given \p format worked.
372 virtual bool DumpUsingFormat(Stream &strm,
374 llvm::StringRef frame_marker = {});
375
376 /// Print a description for this frame using the frame-format formatter
377 /// settings. If the current frame-format settings are invalid, then the
378 /// default formatter will be used (see \a StackFrame::Dump()).
379 ///
380 /// \param [in] strm
381 /// The Stream to print the description to.
382 ///
383 /// \param [in] show_unique
384 /// Whether to print the function arguments or not for backtrace unique.
385 ///
386 /// \param [in] frame_marker
387 /// Optional string that will be prepended to the frame output description.
388 virtual void DumpUsingSettingsFormat(Stream *strm, bool show_unique = false,
389 const llvm::StringRef frame_marker = "");
390
391 /// Print a description for this frame using a default format.
392 ///
393 /// \param [in] strm
394 /// The Stream to print the description to.
395 ///
396 /// \param [in] show_frame_index
397 /// Whether to print the frame number or not.
398 ///
399 /// \param [in] show_fullpaths
400 /// Whether to print the full source paths or just the file base name.
401 virtual void Dump(Stream *strm, bool show_frame_index, bool show_fullpaths);
402
403 /// Print a description of this stack frame and/or the source
404 /// context/assembly for this stack frame.
405 ///
406 /// \param[in] strm
407 /// The Stream to send the output to.
408 ///
409 /// \param[in] show_frame_info
410 /// If true, print the frame info by calling DumpUsingSettingsFormat().
411 ///
412 /// \param[in] show_source
413 /// If true, print source or disassembly as per the user's settings.
414 ///
415 /// \param[in] show_unique
416 /// If true, print using backtrace unique style, without function
417 /// arguments as per the user's settings.
418 ///
419 /// \param[in] frame_marker
420 /// Passed to DumpUsingSettingsFormat() for the frame info printing.
421 ///
422 /// \return
423 /// Returns true if successful.
424 virtual bool GetStatus(Stream &strm, bool show_frame_info, bool show_source,
425 bool show_unique = false,
426 const llvm::StringRef frame_marker = "");
427
428 /// Query whether this frame is a concrete frame on the call stack, or if it
429 /// is an inlined frame derived from the debug information and presented by
430 /// the debugger.
431 ///
432 /// \return
433 /// true if this is an inlined frame.
434 virtual bool IsInlined();
435
436 /// Query whether this frame is synthetic.
437 virtual bool IsSynthetic() const;
438
439 /// Query whether this frame is part of a historical backtrace.
440 virtual bool IsHistorical() const;
441
442 /// Query whether this frame is artificial (e.g a synthesized result of
443 /// inferring missing tail call frames from a backtrace). Artificial frames
444 /// may have limited support for inspecting variables.
445 virtual bool IsArtificial() const;
446
447 /// Query whether this frame should be hidden from backtraces. Frame
448 /// recognizers can customize this behavior and hide distracting
449 /// system implementation details this way.
450 virtual bool IsHidden();
451
452 /// Language plugins can use this API to report language-specific
453 /// runtime information about this compile unit, such as additional
454 /// language version details or feature flags.
456
457 /// Get the frame's demangled name.
458 ///
459 /// /// \return
460 /// A C-String containing the function demangled name. Can be null.
461 virtual const char *GetFunctionName();
462
463 /// Get the frame's demangled display name.
464 ///
465 /// /// \return
466 /// A C-String containing the function demangled display name. Can be null.
467 virtual const char *GetDisplayFunctionName();
468
469 /// Query this frame to find what frame it is in this Thread's
470 /// StackFrameList.
471 ///
472 /// \return
473 /// StackFrame index 0 indicates the currently-executing function. Inline
474 /// frames are included in this frame index count.
475 virtual uint32_t GetFrameIndex() const;
476
477 /// Set this frame's frame index.
478 void SetFrameIndex(uint32_t index) { m_frame_index = index; }
479
480 /// Query this frame to find what frame it is in this Thread's
481 /// StackFrameList, not counting inlined frames.
482 ///
483 /// \return
484 /// StackFrame index 0 indicates the currently-executing function. Inline
485 /// frames are not included in this frame index count; their concrete
486 /// frame index will be the same as the concrete frame that they are
487 /// derived from.
488 virtual uint32_t GetConcreteFrameIndex() { return m_concrete_frame_index; }
489
490 /// Create a ValueObject for a given Variable in this StackFrame.
491 ///
492 /// \param [in] variable_sp
493 /// The Variable to base this ValueObject on
494 ///
495 /// \param [in] use_dynamic
496 /// Whether the correct dynamic type of the variable should be
497 /// determined before creating the ValueObject, or if the static type
498 /// is sufficient. One of the DynamicValueType enumerated values.
499 ///
500 /// \return
501 /// A ValueObject for this variable.
502 virtual lldb::ValueObjectSP
504 lldb::DynamicValueType use_dynamic);
505
506 /// Query this frame to determine what the default language should be when
507 /// parsing expressions given the execution context.
508 ///
509 /// \return The language of the frame if known.
510 virtual SourceLanguage GetLanguage();
511
512 /// Similar to GetLanguage(), but is allowed to take a potentially incorrect
513 /// guess if exact information is not available.
515
516 /// Attempt to econstruct the ValueObject for a given raw address touched by
517 /// the current instruction. The ExpressionPath should indicate how to get
518 /// to this value using "frame variable."
519 ///
520 /// \param [in] addr
521 /// The raw address.
522 ///
523 /// \return
524 /// The ValueObject if found. If valid, it has a valid ExpressionPath.
526
527 /// Attempt to reconstruct the ValueObject for the address contained in a
528 /// given register plus an offset. The ExpressionPath should indicate how
529 /// to get to this value using "frame variable."
530 ///
531 /// \param [in] reg
532 /// The name of the register.
533 ///
534 /// \param [in] offset
535 /// The offset from the register. Particularly important for sp...
536 ///
537 /// \return
538 /// The ValueObject if found. If valid, it has a valid ExpressionPath.
540 int64_t offset);
541
542 /// Attempt to reconstruct the ValueObject for a variable with a given \a name
543 /// from within the current StackFrame, within the current block. The search
544 /// for the variable starts in the deepest block corresponding to the current
545 /// PC in the stack frame and traverse through all parent blocks stopping at
546 /// inlined function boundaries.
547 ///
548 /// \param [in] name
549 /// The name of the variable.
550 ///
551 /// \return
552 /// The ValueObject if found.
554
555 // lldb::ExecutionContextScope pure virtual functions
557
559
561
563
564 void CalculateExecutionContext(ExecutionContext &exe_ctx) override;
565
567
568 /// Get the identifier of the StackFrameList that contains this frame.
569 ///
570 /// Returns the StackFrameList identifier that contains this frame, allowing
571 /// frames to resolve execution contexts without calling
572 /// Thread::GetStackFrameList(), which can cause circular dependencies
573 /// during frame provider initialization.
574 ///
575 /// \return
576 /// The identifier of the containing StackFrameList
580
581protected:
582 friend class BorrowedStackFrame;
583 friend class StackFrameList;
585
586 void SetSymbolContextScope(SymbolContextScope *symbol_scope);
587
589
591
592 bool HasCachedData() const;
593
594 /// For StackFrame and derived classes only.
595 /// \{
601 /// \}
602
603 /// The frame code address (might not be the same as the actual PC
604 /// for inlined frames) as a section/offset address.
611 /// Does this frame have a CFA? Different from CFA == LLDB_INVALID_ADDRESS.
614 /// Is this an artificial stack frame (e.g. a synthesized result of inferring
615 /// missing tail call frames from a backtrace) with limited support for
616 /// local variables. Orthogonal to `StackFrame::Kind`.
618
619 /// Whether this frame behaves like the zeroth frame, in the sense
620 /// that its pc value might not immediately follow a call (and thus might
621 /// be the first address of its function). True for actual frame zero as
622 /// well as any other frame with the same trait.
626 /// Value objects for each variable in m_variable_list_sp.
628 std::optional<lldb::RecognizedStackFrameSP> m_recognized_frame_sp;
630 std::recursive_mutex m_mutex;
631
632private:
633 /// Private methods, called from GetValueForVariableExpressionPath.
634 /// See that method for documentation of parameters and return value.
636 llvm::StringRef var_expr, lldb::DynamicValueType use_dynamic,
637 uint32_t options, lldb::VariableSP &var_sp, Status &error);
638
640 llvm::StringRef var_expr, lldb::DynamicValueType use_dynamic,
641 uint32_t options, lldb::VariableSP &var_sp, Status &error,
643
644 StackFrame(const StackFrame &) = delete;
645 const StackFrame &operator=(const StackFrame &) = delete;
646};
647
648} // namespace lldb_private
649
650#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
virtual lldb::ValueObjectSP GetValueForVariableExpressionPath(llvm::StringRef var_expr, lldb::DynamicValueType use_dynamic, uint32_t options, lldb::VariableSP &var_sp, Status &error, lldb::DILMode mode=lldb::eDILModeFull)
Create a ValueObject for a variable name / pathname, possibly including simple dereference/child sele...
void SetSymbolContextScope(SymbolContextScope *symbol_scope)
uint16_t m_frame_recognizer_generation
Definition StackFrame.h:610
lldb::VariableListSP m_variable_list_sp
Definition StackFrame.h:625
void UpdatePreviousFrameFromCurrentFrame(StackFrame &curr_frame)
bool m_artificial
Is this an artificial stack frame (e.g.
Definition StackFrame.h:617
lldb::ThreadSP GetThread() const
Definition StackFrame.h:137
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:605
@ eExpressionPathOptionsInspectAnonymousUnions
Definition StackFrame.h:59
@ eExpressionPathOptionsAllowDirectIVarAccess
Definition StackFrame.h:58
@ eExpressionPathOptionsNoSyntheticArrayRange
Definition StackFrame.h:57
virtual const char * GetFunctionName()
Get the frame's demangled name.
virtual bool IsHidden()
Query whether this frame should be hidden from backtraces.
virtual bool IsSynthetic() const
Query whether this frame is synthetic.
virtual DWARFExpressionList * GetFrameBaseExpression(Status *error_ptr)
Get the DWARFExpressionList corresponding to the Canonical Frame Address.
void SetFrameIndex(uint32_t index)
Set this frame's frame index.
Definition StackFrame.h:478
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:627
bool m_cfa_is_valid
Does this frame have a CFA? Different from CFA == LLDB_INVALID_ADDRESS.
Definition StackFrame.h:612
virtual 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:596
std::optional< lldb::RecognizedStackFrameSP > m_recognized_frame_sp
Definition StackFrame.h:628
virtual bool IsInlined()
Query whether this frame is a concrete frame on the call stack, or if it is an inlined frame derived ...
virtual uint32_t GetConcreteFrameIndex()
Query this frame to find what frame it is in this Thread's StackFrameList, not counting inlined frame...
Definition StackFrame.h:488
lldb::ValueObjectSP DILGetValueForVariableExpressionPath(llvm::StringRef var_expr, lldb::DynamicValueType use_dynamic, uint32_t options, lldb::VariableSP &var_sp, Status &error, lldb::DILMode mode=lldb::eDILModeFull)
static bool classof(const StackFrame *obj)
Definition StackFrame.h:50
virtual SourceLanguage GuessLanguage()
Similar to GetLanguage(), but is allowed to take a potentially incorrect guess if exact information i...
virtual lldb::RegisterContextSP GetRegisterContext()
Get the RegisterContext for this frame, if possible.
lldb::RegisterContextSP m_reg_context_sp
Definition StackFrame.h:599
static char ID
LLVM RTTI support.
Definition StackFrame.h:48
virtual 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
friend class BorrowedStackFrame
Definition StackFrame.h:582
virtual StructuredData::ObjectSP GetLanguageSpecificData()
Language plugins can use this API to report language-specific runtime information about this compile ...
virtual 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:70
@ Regular
A regular stack frame with access to registers and local variables.
Definition StackFrame.h:66
@ Synthetic
An synthetic stack frame (e.g.
Definition StackFrame.h:74
friend class SyntheticStackFrameList
Definition StackFrame.h:584
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:623
lldb::frame_list_id_t GetContainingStackFrameListIdentifier() const
Get the identifier of the StackFrameList that contains this frame.
Definition StackFrame.h:577
virtual StackID & GetStackID()
virtual lldb::ValueObjectSP GuessValueForAddress(lldb::addr_t addr)
Attempt to econstruct the ValueObject for a given raw address touched by the current instruction.
virtual bool GetStatus(Stream &strm, bool show_frame_info, bool show_source, bool show_unique=false, const llvm::StringRef frame_marker="")
Print a description of this stack frame and/or the source context/assembly for this stack frame.
virtual 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
virtual SourceLanguage GetLanguage()
Query this frame to determine what the default language should be when parsing expressions given the ...
virtual lldb::ValueObjectSP GetValueObjectForFrameVariable(const lldb::VariableSP &variable_sp, lldb::DynamicValueType use_dynamic)
Create a ValueObject for a given Variable in this StackFrame.
virtual VariableList * GetVariableList(bool get_file_globals, bool include_synthetic_vars, Status *error_ptr)
Retrieve the list of variables whose scope either:
StreamString m_disassembly
Definition StackFrame.h:629
lldb::StackFrameSP CalculateStackFrame() override
virtual 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.
virtual bool IsHistorical() const
Query whether this frame is part of a historical backtrace.
virtual 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.
virtual void Dump(Stream *strm, bool show_frame_index, bool show_fullpaths)
Print a description for this frame using a default format.
virtual uint32_t GetFrameIndex() const
Query this frame to find what frame it is in this Thread's StackFrameList.
virtual bool HasDebugInformation()
Determine whether this StackFrame has debug information available or not.
virtual void DumpUsingSettingsFormat(Stream *strm, bool show_unique=false, const llvm::StringRef frame_marker="")
Print a description for this frame using the frame-format formatter settings.
friend class StackFrameList
Definition StackFrame.h:583
virtual lldb::VariableListSP GetInScopeVariableList(bool get_file_globals, bool include_synthetic_vars=true, bool must_have_valid_location=false)
Retrieve the list of variables that are in scope at this StackFrame's pc.
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.
virtual Block * GetFrameBlock()
Get the current lexical scope block for this StackFrame, if possible.
virtual bool isA(const void *ClassID) const
Definition StackFrame.h:49
virtual 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
lldb::frame_list_id_t m_frame_list_id
Definition StackFrame.h:624
const lldb::RegisterContextSP & GetRegisterContextSP() const
Definition StackFrame.h:250
virtual lldb::RecognizedStackFrameSP GetRecognizedFrame()
std::recursive_mutex m_mutex
Definition StackFrame.h:630
virtual lldb::ValueObjectSP FindVariable(ConstString name)
Attempt to reconstruct the ValueObject for a variable with a given name from within the current Stack...
virtual 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
DILMode
Data Inspection Language (DIL) evaluation modes.
@ eDILModeFull
Allowed: everything supported by DIL.
uint32_t frame_list_id_t
Definition lldb-types.h:86
A type-erased pair of llvm::dwarf::SourceLanguageName and version.