LLDB  mainline
UnwindPlan.h
Go to the documentation of this file.
1 //===-- UnwindPlan.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_SYMBOL_UNWINDPLAN_H
10 #define LLDB_SYMBOL_UNWINDPLAN_H
11 
12 #include <map>
13 #include <memory>
14 #include <vector>
15 
16 #include "lldb/Core/AddressRange.h"
18 #include "lldb/Utility/Stream.h"
19 #include "lldb/lldb-private.h"
20 
21 namespace lldb_private {
22 
23 // The UnwindPlan object specifies how to unwind out of a function - where this
24 // function saves the caller's register values before modifying them (for non-
25 // volatile aka saved registers) and how to find this frame's Canonical Frame
26 // Address (CFA) or Aligned Frame Address (AFA).
27 
28 // CFA is a DWARF's Canonical Frame Address.
29 // Most commonly, registers are saved on the stack, offset some bytes from the
30 // Canonical Frame Address, or CFA, which is the starting address of this
31 // function's stack frame (the CFA is same as the eh_frame's CFA, whatever that
32 // may be on a given architecture). The CFA address for the stack frame does
33 // not change during the lifetime of the function.
34 
35 // AFA is an artificially introduced Aligned Frame Address.
36 // It is used only for stack frames with realignment (e.g. when some of the
37 // locals has an alignment requirement higher than the stack alignment right
38 // after the function call). It is used to access register values saved on the
39 // stack after the realignment (and so they are inaccessible through the CFA).
40 // AFA usually equals the stack pointer value right after the realignment.
41 
42 // Internally, the UnwindPlan is structured as a vector of register locations
43 // organized by code address in the function, showing which registers have been
44 // saved at that point and where they are saved. It can be thought of as the
45 // expanded table form of the DWARF CFI encoded information.
46 
47 // Other unwind information sources will be converted into UnwindPlans before
48 // being added to a FuncUnwinders object. The unwind source may be an eh_frame
49 // FDE, a DWARF debug_frame FDE, or assembly language based prologue analysis.
50 // The UnwindPlan is the canonical form of this information that the unwinder
51 // code will use when walking the stack.
52 
53 class UnwindPlan {
54 public:
55  class Row {
56  public:
58  public:
59  enum RestoreType {
60  unspecified, // not specified, we may be able to assume this
61  // is the same register. gcc doesn't specify all
62  // initial values so we really don't know...
63  undefined, // reg is not available, e.g. volatile reg
64  same, // reg is unchanged
65  atCFAPlusOffset, // reg = deref(CFA + offset)
66  isCFAPlusOffset, // reg = CFA + offset
67  atAFAPlusOffset, // reg = deref(AFA + offset)
68  isAFAPlusOffset, // reg = AFA + offset
69  inOtherRegister, // reg = other reg
70  atDWARFExpression, // reg = deref(eval(dwarf_expr))
71  isDWARFExpression // reg = eval(dwarf_expr)
72  };
73 
75 
76  bool operator==(const RegisterLocation &rhs) const;
77 
78  bool operator!=(const RegisterLocation &rhs) const {
79  return !(*this == rhs);
80  }
81 
83 
85 
86  void SetSame() { m_type = same; }
87 
88  bool IsSame() const { return m_type == same; }
89 
90  bool IsUnspecified() const { return m_type == unspecified; }
91 
92  bool IsUndefined() const { return m_type == undefined; }
93 
94  bool IsCFAPlusOffset() const { return m_type == isCFAPlusOffset; }
95 
96  bool IsAtCFAPlusOffset() const { return m_type == atCFAPlusOffset; }
97 
98  bool IsAFAPlusOffset() const { return m_type == isAFAPlusOffset; }
99 
100  bool IsAtAFAPlusOffset() const { return m_type == atAFAPlusOffset; }
101 
102  bool IsInOtherRegister() const { return m_type == inOtherRegister; }
103 
104  bool IsAtDWARFExpression() const { return m_type == atDWARFExpression; }
105 
106  bool IsDWARFExpression() const { return m_type == isDWARFExpression; }
107 
108  void SetAtCFAPlusOffset(int32_t offset) {
110  m_location.offset = offset;
111  }
112 
113  void SetIsCFAPlusOffset(int32_t offset) {
115  m_location.offset = offset;
116  }
117 
118  void SetAtAFAPlusOffset(int32_t offset) {
120  m_location.offset = offset;
121  }
122 
123  void SetIsAFAPlusOffset(int32_t offset) {
125  m_location.offset = offset;
126  }
127 
130  m_location.reg_num = reg_num;
131  }
132 
134  if (m_type == inOtherRegister)
135  return m_location.reg_num;
136  return LLDB_INVALID_REGNUM;
137  }
138 
139  RestoreType GetLocationType() const { return m_type; }
140 
141  int32_t GetOffset() const {
142  switch(m_type)
143  {
144  case atCFAPlusOffset:
145  case isCFAPlusOffset:
146  case atAFAPlusOffset:
147  case isAFAPlusOffset:
148  return m_location.offset;
149  default:
150  return 0;
151  }
152  }
153 
154  void GetDWARFExpr(const uint8_t **opcodes, uint16_t &len) const {
156  *opcodes = m_location.expr.opcodes;
157  len = m_location.expr.length;
158  } else {
159  *opcodes = nullptr;
160  len = 0;
161  }
162  }
163 
164  void SetAtDWARFExpression(const uint8_t *opcodes, uint32_t len);
165 
166  void SetIsDWARFExpression(const uint8_t *opcodes, uint32_t len);
167 
168  const uint8_t *GetDWARFExpressionBytes() {
170  return m_location.expr.opcodes;
171  return nullptr;
172  }
173 
176  return m_location.expr.length;
177  return 0;
178  }
179 
180  void Dump(Stream &s, const UnwindPlan *unwind_plan,
181  const UnwindPlan::Row *row, Thread *thread, bool verbose) const;
182 
183  private:
184  RestoreType m_type = unspecified; // How do we locate this register?
185  union {
186  // For m_type == atCFAPlusOffset or m_type == isCFAPlusOffset
187  int32_t offset;
188  // For m_type == inOtherRegister
189  uint32_t reg_num; // The register number
190  // For m_type == atDWARFExpression or m_type == isDWARFExpression
191  struct {
192  const uint8_t *opcodes;
194  } expr;
195  } m_location;
196  };
197 
198  class FAValue {
199  public:
200  enum ValueType {
201  unspecified, // not specified
202  isRegisterPlusOffset, // FA = register + offset
203  isRegisterDereferenced, // FA = [reg]
204  isDWARFExpression, // FA = eval(dwarf_expr)
205  isRaSearch, // FA = SP + offset + ???
206  };
207 
208  FAValue() : m_value() {}
209 
210  bool operator==(const FAValue &rhs) const;
211 
212  bool operator!=(const FAValue &rhs) const { return !(*this == rhs); }
213 
215 
216  bool IsUnspecified() const { return m_type == unspecified; }
217 
218  void SetRaSearch(int32_t offset) {
219  m_type = isRaSearch;
220  m_value.ra_search_offset = offset;
221  }
222 
223  bool IsRegisterPlusOffset() const {
224  return m_type == isRegisterPlusOffset;
225  }
226 
229  m_value.reg.reg_num = reg_num;
230  m_value.reg.offset = offset;
231  }
232 
233  bool IsRegisterDereferenced() const {
234  return m_type == isRegisterDereferenced;
235  }
236 
239  m_value.reg.reg_num = reg_num;
240  }
241 
242  bool IsDWARFExpression() const { return m_type == isDWARFExpression; }
243 
244  void SetIsDWARFExpression(const uint8_t *opcodes, uint32_t len) {
246  m_value.expr.opcodes = opcodes;
247  m_value.expr.length = len;
248  }
249 
252  return m_value.reg.reg_num;
253  return LLDB_INVALID_REGNUM;
254  }
255 
256  ValueType GetValueType() const { return m_type; }
257 
258  int32_t GetOffset() const {
259  switch (m_type) {
261  return m_value.reg.offset;
262  case isRaSearch:
263  return m_value.ra_search_offset;
264  default:
265  return 0;
266  }
267  }
268 
269  void IncOffset(int32_t delta) {
271  m_value.reg.offset += delta;
272  }
273 
274  void SetOffset(int32_t offset) {
276  m_value.reg.offset = offset;
277  }
278 
279  void GetDWARFExpr(const uint8_t **opcodes, uint16_t &len) const {
280  if (m_type == isDWARFExpression) {
281  *opcodes = m_value.expr.opcodes;
282  len = m_value.expr.length;
283  } else {
284  *opcodes = nullptr;
285  len = 0;
286  }
287  }
288 
289  const uint8_t *GetDWARFExpressionBytes() {
290  if (m_type == isDWARFExpression)
291  return m_value.expr.opcodes;
292  return nullptr;
293  }
294 
296  if (m_type == isDWARFExpression)
297  return m_value.expr.length;
298  return 0;
299  }
300 
301  void Dump(Stream &s, const UnwindPlan *unwind_plan, Thread *thread) const;
302 
303  private:
304  ValueType m_type = unspecified; // How do we compute CFA value?
305  union {
306  struct {
307  // For m_type == isRegisterPlusOffset or m_type ==
308  // isRegisterDereferenced
309  uint32_t reg_num; // The register number
310  // For m_type == isRegisterPlusOffset
311  int32_t offset;
312  } reg;
313  // For m_type == isDWARFExpression
314  struct {
315  const uint8_t *opcodes;
317  } expr;
318  // For m_type == isRaSearch
320  } m_value;
321  }; // class FAValue
322 
323  Row();
324 
325  bool operator==(const Row &rhs) const;
326 
327  bool GetRegisterInfo(uint32_t reg_num,
328  RegisterLocation &register_location) const;
329 
330  void SetRegisterInfo(uint32_t reg_num,
331  const RegisterLocation register_location);
332 
333  void RemoveRegisterInfo(uint32_t reg_num);
334 
335  lldb::addr_t GetOffset() const { return m_offset; }
336 
337  void SetOffset(lldb::addr_t offset) { m_offset = offset; }
338 
339  void SlideOffset(lldb::addr_t offset) { m_offset += offset; }
340 
342 
344 
345  bool SetRegisterLocationToAtCFAPlusOffset(uint32_t reg_num, int32_t offset,
346  bool can_replace);
347 
348  bool SetRegisterLocationToIsCFAPlusOffset(uint32_t reg_num, int32_t offset,
349  bool can_replace);
350 
351  bool SetRegisterLocationToUndefined(uint32_t reg_num, bool can_replace,
352  bool can_replace_only_if_unspecified);
353 
354  bool SetRegisterLocationToUnspecified(uint32_t reg_num, bool can_replace);
355 
356  bool SetRegisterLocationToRegister(uint32_t reg_num, uint32_t other_reg_num,
357  bool can_replace);
358 
359  bool SetRegisterLocationToSame(uint32_t reg_num, bool must_replace);
360 
361  // When this UnspecifiedRegistersAreUndefined mode is
362  // set, any register that is not specified by this Row will
363  // be described as Undefined.
364  // This will prevent the unwinder from iterating down the
365  // stack looking for a spill location, or a live register value
366  // at frame 0.
367  // It would be used for an UnwindPlan row where we can't track
368  // spilled registers -- for instance a jitted stack frame where
369  // we have no unwind information or start address -- and registers
370  // MAY have been spilled and overwritten, so providing the
371  // spilled/live value from a newer frame may show an incorrect value.
372  void SetUnspecifiedRegistersAreUndefined(bool unspec_is_undef) {
373  m_unspecified_registers_are_undefined = unspec_is_undef;
374  }
375 
378  }
379 
380  void Clear();
381 
382  void Dump(Stream &s, const UnwindPlan *unwind_plan, Thread *thread,
383  lldb::addr_t base_addr) const;
384 
385  protected:
386  typedef std::map<uint32_t, RegisterLocation> collection;
387  lldb::addr_t m_offset = 0; // Offset into the function for this row
388 
393  }; // class Row
394 
395  typedef std::shared_ptr<Row> RowSP;
396 
404 
405  // Performs a deep copy of the plan, including all the rows (expensive).
406  UnwindPlan(const UnwindPlan &rhs)
417  m_row_list.reserve(rhs.m_row_list.size());
418  for (const RowSP &row_sp : rhs.m_row_list)
419  m_row_list.emplace_back(new Row(*row_sp));
420  }
421 
422  ~UnwindPlan() = default;
423 
424  void Dump(Stream &s, Thread *thread, lldb::addr_t base_addr) const;
425 
426  void AppendRow(const RowSP &row_sp);
427 
428  void InsertRow(const RowSP &row_sp, bool replace_existing = false);
429 
430  // Returns a pointer to the best row for the given offset into the function's
431  // instructions. If offset is -1 it indicates that the function start is
432  // unknown - the final row in the UnwindPlan is returned. In practice, the
433  // UnwindPlan for a function with no known start address will be the
434  // architectural default UnwindPlan which will only have one row.
435  UnwindPlan::RowSP GetRowForFunctionOffset(int offset) const;
436 
438 
440 
442  m_return_addr_register = regnum;
443  }
444 
446 
448  if (m_row_list.empty())
449  return LLDB_INVALID_REGNUM;
450  return m_row_list.front()->GetCFAValue().GetRegisterNumber();
451  }
452 
453  // This UnwindPlan may not be valid at every address of the function span.
454  // For instance, a FastUnwindPlan will not be valid at the prologue setup
455  // instructions - only in the body of the function.
456  void SetPlanValidAddressRange(const AddressRange &range);
457 
458  const AddressRange &GetAddressRange() const {
460  }
461 
462  bool PlanValidAtAddress(Address addr);
463 
464  bool IsValidRowIndex(uint32_t idx) const;
465 
466  const UnwindPlan::RowSP GetRowAtIndex(uint32_t idx) const;
467 
468  const UnwindPlan::RowSP GetLastRow() const;
469 
471 
472  void SetSourceName(const char *);
473 
474  // Was this UnwindPlan emitted by a compiler?
477  }
478 
479  // Was this UnwindPlan emitted by a compiler?
481  m_plan_is_sourced_from_compiler = from_compiler;
482  }
483 
484  // Is this UnwindPlan valid at all instructions? If not, then it is assumed
485  // valid at call sites, e.g. for exception handling.
488  }
489 
490  // Is this UnwindPlan valid at all instructions? If not, then it is assumed
491  // valid at call sites, e.g. for exception handling.
493  lldb_private::LazyBool valid_at_all_insn) {
495  }
496 
497  // Is this UnwindPlan for a signal trap frame? If so, then its saved pc
498  // may have been set manually by the signal dispatch code and therefore
499  // not follow a call to the child frame.
502  }
503 
505  m_plan_is_for_signal_trap = is_for_signal_trap;
506  }
507 
508  int GetRowCount() const;
509 
510  void Clear() {
511  m_row_list.clear();
520  }
521 
522  const RegisterInfo *GetRegisterInfo(Thread *thread, uint32_t reg_num) const;
523 
525 
526  void SetLSDAAddress(Address lsda_addr) { m_lsda_address = lsda_addr; }
527 
529 
530  void SetPersonalityFunctionPtr(Address presonality_func_ptr) {
531  m_personality_func_addr = presonality_func_ptr;
532  }
533 
534 private:
535  typedef std::vector<RowSP> collection;
538  lldb::RegisterKind m_register_kind; // The RegisterKind these register numbers
539  // are in terms of - will need to be
540  // translated to lldb native reg nums at unwind time
541  uint32_t m_return_addr_register; // The register that has the return address
542  // for the caller frame
543  // e.g. the lr on arm
545  m_source_name; // for logging, where this UnwindPlan originated from
549 
550  Address m_lsda_address; // Where the language specific data area exists in the
551  // module - used
552  // in exception handling.
553  Address m_personality_func_addr; // The address of a pointer to the
554  // personality function - used in
555  // exception handling.
556 }; // class UnwindPlan
557 
558 } // namespace lldb_private
559 
560 #endif // LLDB_SYMBOL_UNWINDPLAN_H
lldb_private::UnwindPlan::Row::RegisterLocation::GetOffset
int32_t GetOffset() const
Definition: UnwindPlan.h:141
lldb_private::UnwindPlan::Row::RegisterLocation::reg_num
uint32_t reg_num
Definition: UnwindPlan.h:189
lldb_private::UnwindPlan::Row::m_cfa_value
FAValue m_cfa_value
Definition: UnwindPlan.h:389
lldb_private::UnwindPlan::Row::SetRegisterLocationToIsCFAPlusOffset
bool SetRegisterLocationToIsCFAPlusOffset(uint32_t reg_num, int32_t offset, bool can_replace)
Definition: UnwindPlan.cpp:289
lldb_private::UnwindPlan::Row::FAValue::ValueType
ValueType
Definition: UnwindPlan.h:200
lldb_private::UnwindPlan::InsertRow
void InsertRow(const RowSP &row_sp, bool replace_existing=false)
Definition: UnwindPlan.cpp:368
lldb_private::UnwindPlan::Row::Row
Row()
Definition: UnwindPlan.cpp:247
lldb_private::UnwindPlan::AppendRow
void AppendRow(const RowSP &row_sp)
Definition: UnwindPlan.cpp:360
lldb_private::UnwindPlan::Row::RegisterLocation::SetIsAFAPlusOffset
void SetIsAFAPlusOffset(int32_t offset)
Definition: UnwindPlan.h:123
lldb_private::UnwindPlan::m_source_name
lldb_private::ConstString m_source_name
Definition: UnwindPlan.h:545
lldb_private::UnwindPlan::Row::RegisterLocation::GetRegisterNumber
uint32_t GetRegisterNumber() const
Definition: UnwindPlan.h:133
LLDB_INVALID_REGNUM
#define LLDB_INVALID_REGNUM
Definition: lldb-defines.h:91
lldb_private::UnwindPlan::Row::FAValue::GetOffset
int32_t GetOffset() const
Definition: UnwindPlan.h:258
lldb_private::Address::Clear
void Clear()
Clear the object's state.
Definition: Address.h:178
lldb_private::UnwindPlan::Row::RegisterLocation::isCFAPlusOffset
@ isCFAPlusOffset
Definition: UnwindPlan.h:66
lldb_private::UnwindPlan::m_return_addr_register
uint32_t m_return_addr_register
Definition: UnwindPlan.h:541
lldb_private::UnwindPlan::GetSourcedFromCompiler
lldb_private::LazyBool GetSourcedFromCompiler() const
Definition: UnwindPlan.h:475
lldb_private::UnwindPlan::Row::RegisterLocation::length
uint16_t length
Definition: UnwindPlan.h:193
lldb_private::UnwindPlan::SetRegisterKind
void SetRegisterKind(lldb::RegisterKind kind)
Definition: UnwindPlan.h:439
lldb::eRegisterKindDWARF
@ eRegisterKindDWARF
the register numbers seen DWARF
Definition: lldb-enumerations.h:229
lldb_private::UnwindPlan::Row::SetRegisterLocationToRegister
bool SetRegisterLocationToRegister(uint32_t reg_num, uint32_t other_reg_num, bool can_replace)
Definition: UnwindPlan.cpp:329
lldb_private::UnwindPlan::Row::FAValue::IsRegisterDereferenced
bool IsRegisterDereferenced() const
Definition: UnwindPlan.h:233
lldb_private::UnwindPlan::Row::operator==
bool operator==(const Row &rhs) const
Definition: UnwindPlan.cpp:352
lldb_private::UnwindPlan::Row::SetRegisterInfo
void SetRegisterInfo(uint32_t reg_num, const RegisterLocation register_location)
Definition: UnwindPlan.cpp:271
lldb_private::UnwindPlan::Row::FAValue::ra_search_offset
int32_t ra_search_offset
Definition: UnwindPlan.h:319
lldb_private::UnwindPlan::Row::SetRegisterLocationToSame
bool SetRegisterLocationToSame(uint32_t reg_num, bool must_replace)
Definition: UnwindPlan.cpp:341
lldb_private::UnwindPlan::Row::GetUnspecifiedRegistersAreUndefined
bool GetUnspecifiedRegistersAreUndefined()
Definition: UnwindPlan.h:376
lldb_private::UnwindPlan::Row::FAValue::isRaSearch
@ isRaSearch
Definition: UnwindPlan.h:205
lldb_private::UnwindPlan::Row::FAValue::expr
struct lldb_private::UnwindPlan::Row::FAValue::@29::@31 expr
lldb_private::UnwindPlan::SetUnwindPlanValidAtAllInstructions
void SetUnwindPlanValidAtAllInstructions(lldb_private::LazyBool valid_at_all_insn)
Definition: UnwindPlan.h:492
lldb_private::UnwindPlan::Row::RegisterLocation::SetSame
void SetSame()
Definition: UnwindPlan.h:86
lldb_private::UnwindPlan::GetReturnAddressRegister
uint32_t GetReturnAddressRegister(void)
Definition: UnwindPlan.h:445
lldb_private::UnwindPlan::Row::RegisterLocation::SetAtDWARFExpression
void SetAtDWARFExpression(const uint8_t *opcodes, uint32_t len)
Definition: UnwindPlan.cpp:53
lldb_private::UnwindPlan::Row::RegisterLocation::IsAtAFAPlusOffset
bool IsAtAFAPlusOffset() const
Definition: UnwindPlan.h:100
lldb_private::UnwindPlan::UnwindPlan
UnwindPlan(const UnwindPlan &rhs)
Definition: UnwindPlan.h:406
lldb_private::UnwindPlan::GetRowForFunctionOffset
UnwindPlan::RowSP GetRowForFunctionOffset(int offset) const
Definition: UnwindPlan.cpp:383
lldb_private::UnwindPlan::Row::RegisterLocation::IsAtDWARFExpression
bool IsAtDWARFExpression() const
Definition: UnwindPlan.h:104
lldb_private::UnwindPlan::Row::RegisterLocation::operator==
bool operator==(const RegisterLocation &rhs) const
Definition: UnwindPlan.cpp:23
lldb_private::UnwindPlan::Row::FAValue::IsRegisterPlusOffset
bool IsRegisterPlusOffset() const
Definition: UnwindPlan.h:223
lldb_private::UnwindPlan::Row::RegisterLocation::SetUndefined
void SetUndefined()
Definition: UnwindPlan.h:84
lldb_private::UnwindPlan::Row::RegisterLocation::isDWARFExpression
@ isDWARFExpression
Definition: UnwindPlan.h:71
lldb_private::UnwindPlan::SetUnwindPlanForSignalTrap
void SetUnwindPlanForSignalTrap(lldb_private::LazyBool is_for_signal_trap)
Definition: UnwindPlan.h:504
lldb_private::UnwindPlan::Row::SetUnspecifiedRegistersAreUndefined
void SetUnspecifiedRegistersAreUndefined(bool unspec_is_undef)
Definition: UnwindPlan.h:372
lldb_private::UnwindPlan::Row::FAValue::opcodes
const uint8_t * opcodes
Definition: UnwindPlan.h:315
lldb_private::UnwindPlan::Row::FAValue::offset
int32_t offset
Definition: UnwindPlan.h:311
lldb_private::UnwindPlan::GetUnwindPlanValidAtAllInstructions
lldb_private::LazyBool GetUnwindPlanValidAtAllInstructions() const
Definition: UnwindPlan.h:486
lldb_private::UnwindPlan::Row::RegisterLocation::m_type
RestoreType m_type
Definition: UnwindPlan.h:184
lldb_private::UnwindPlan::Row::m_register_locations
collection m_register_locations
Definition: UnwindPlan.h:391
lldb_private::UnwindPlan::Row::SetRegisterLocationToUndefined
bool SetRegisterLocationToUndefined(uint32_t reg_num, bool can_replace, bool can_replace_only_if_unspecified)
Definition: UnwindPlan.cpp:301
lldb_private::Stream
Definition: Stream.h:28
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::UnwindPlan::Row::RegisterLocation::RestoreType
RestoreType
Definition: UnwindPlan.h:59
lldb_private::UnwindPlan::Row::FAValue::IsUnspecified
bool IsUnspecified() const
Definition: UnwindPlan.h:216
lldb_private::LazyBool
LazyBool
Definition: lldb-private-enumerations.h:115
lldb_private::UnwindPlan::Row::RegisterLocation::expr
struct lldb_private::UnwindPlan::Row::RegisterLocation::@27::@28 expr
lldb_private::UnwindPlan::SetSourceName
void SetSourceName(const char *)
Definition: UnwindPlan.cpp:562
lldb_private::UnwindPlan::Row::FAValue::SetUnspecified
void SetUnspecified()
Definition: UnwindPlan.h:214
lldb_private::UnwindPlan::Row::Clear
void Clear()
Definition: UnwindPlan.cpp:215
lldb_private::UnwindPlan::Row::FAValue::SetIsRegisterDereferenced
void SetIsRegisterDereferenced(uint32_t reg_num)
Definition: UnwindPlan.h:237
lldb_private::UnwindPlan::Row::FAValue::length
uint16_t length
Definition: UnwindPlan.h:316
lldb_private::UnwindPlan::GetRegisterKind
lldb::RegisterKind GetRegisterKind() const
Definition: UnwindPlan.h:437
lldb_private::UnwindPlan::Row::SetRegisterLocationToAtCFAPlusOffset
bool SetRegisterLocationToAtCFAPlusOffset(uint32_t reg_num, int32_t offset, bool can_replace)
Definition: UnwindPlan.cpp:277
lldb_private::UnwindPlan::Row::RegisterLocation::Dump
void Dump(Stream &s, const UnwindPlan *unwind_plan, const UnwindPlan::Row *row, Thread *thread, bool verbose) const
Definition: UnwindPlan.cpp:90
lldb_private::UnwindPlan::Row::m_afa_value
FAValue m_afa_value
Definition: UnwindPlan.h:390
lldb_private::UnwindPlan::Row::SetRegisterLocationToUnspecified
bool SetRegisterLocationToUnspecified(uint32_t reg_num, bool can_replace)
Definition: UnwindPlan.cpp:318
lldb_private::UnwindPlan::GetInitialCFARegister
uint32_t GetInitialCFARegister() const
Definition: UnwindPlan.h:447
lldb_private::UnwindPlan::Row::FAValue::SetRaSearch
void SetRaSearch(int32_t offset)
Definition: UnwindPlan.h:218
lldb_private::UnwindPlan::Row::RegisterLocation::IsCFAPlusOffset
bool IsCFAPlusOffset() const
Definition: UnwindPlan.h:94
lldb_private::UnwindPlan::Row::RegisterLocation::SetUnspecified
void SetUnspecified()
Definition: UnwindPlan.h:82
lldb_private::UnwindPlan::SetPlanValidAddressRange
void SetPlanValidAddressRange(const AddressRange &range)
Definition: UnwindPlan.cpp:429
lldb_private::UnwindPlan::collection
std::vector< RowSP > collection
Definition: UnwindPlan.h:535
lldb_private::UnwindPlan::Row::FAValue::GetRegisterNumber
uint32_t GetRegisterNumber() const
Definition: UnwindPlan.h:250
lldb_private::UnwindPlan::PlanValidAtAddress
bool PlanValidAtAddress(Address addr)
Definition: UnwindPlan.cpp:434
lldb_private::UnwindPlan::Row::FAValue::GetValueType
ValueType GetValueType() const
Definition: UnwindPlan.h:256
lldb_private::UnwindPlan::Row::collection
std::map< uint32_t, RegisterLocation > collection
Definition: UnwindPlan.h:386
lldb_private::UnwindPlan::Row::RegisterLocation::GetDWARFExpr
void GetDWARFExpr(const uint8_t **opcodes, uint16_t &len) const
Definition: UnwindPlan.h:154
lldb_private::UnwindPlan::Row::FAValue::GetDWARFExpressionBytes
const uint8_t * GetDWARFExpressionBytes()
Definition: UnwindPlan.h:289
lldb_private::UnwindPlan::Row::FAValue::isRegisterDereferenced
@ isRegisterDereferenced
Definition: UnwindPlan.h:203
lldb_private::UnwindPlan::Row::FAValue::isDWARFExpression
@ isDWARFExpression
Definition: UnwindPlan.h:204
lldb_private::UnwindPlan::SetReturnAddressRegister
void SetReturnAddressRegister(uint32_t regnum)
Definition: UnwindPlan.h:441
lldb_private::UnwindPlan::m_personality_func_addr
Address m_personality_func_addr
Definition: UnwindPlan.h:553
lldb_private::UnwindPlan::Row::RemoveRegisterInfo
void RemoveRegisterInfo(uint32_t reg_num)
Definition: UnwindPlan.cpp:264
lldb_private::Thread
Definition: Thread.h:60
lldb_private::UnwindPlan::Row::GetCFAValue
FAValue & GetCFAValue()
Definition: UnwindPlan.h:341
lldb_private::UnwindPlan::GetLSDAAddress
Address GetLSDAAddress() const
Definition: UnwindPlan.h:524
lldb_private::UnwindPlan::Dump
void Dump(Stream &s, Thread *thread, lldb::addr_t base_addr) const
Definition: UnwindPlan.cpp:491
lldb_private::UnwindPlan::Row::SlideOffset
void SlideOffset(lldb::addr_t offset)
Definition: UnwindPlan.h:339
lldb_private::UnwindPlan::SetSourcedFromCompiler
void SetSourcedFromCompiler(lldb_private::LazyBool from_compiler)
Definition: UnwindPlan.h:480
lldb_private::UnwindPlan::Row::m_unspecified_registers_are_undefined
bool m_unspecified_registers_are_undefined
Definition: UnwindPlan.h:392
lldb_private::UnwindPlan::Row::FAValue
Definition: UnwindPlan.h:198
lldb_private::UnwindPlan::Row::FAValue::IsDWARFExpression
bool IsDWARFExpression() const
Definition: UnwindPlan.h:242
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::UnwindPlan::Row::GetRegisterInfo
bool GetRegisterInfo(uint32_t reg_num, RegisterLocation &register_location) const
Definition: UnwindPlan.cpp:249
lldb_private::AddressRange
Definition: AddressRange.h:25
lldb_private::UnwindPlan::Row::RegisterLocation::operator!=
bool operator!=(const RegisterLocation &rhs) const
Definition: UnwindPlan.h:78
lldb_private::UnwindPlan::m_row_list
collection m_row_list
Definition: UnwindPlan.h:536
lldb_private::UnwindPlan::Row::RegisterLocation::IsAtCFAPlusOffset
bool IsAtCFAPlusOffset() const
Definition: UnwindPlan.h:96
lldb_private::UnwindPlan::GetLastRow
const UnwindPlan::RowSP GetLastRow() const
Definition: UnwindPlan.cpp:418
lldb_private::UnwindPlan::Row::RegisterLocation::GetLocationType
RestoreType GetLocationType() const
Definition: UnwindPlan.h:139
lldb_private::UnwindPlan::Row::RegisterLocation::SetInRegister
void SetInRegister(uint32_t reg_num)
Definition: UnwindPlan.h:128
lldb_private::UnwindPlan::Row::FAValue::GetDWARFExpressionLength
int GetDWARFExpressionLength()
Definition: UnwindPlan.h:295
lldb_private::UnwindPlan::Row::RegisterLocation::atCFAPlusOffset
@ atCFAPlusOffset
Definition: UnwindPlan.h:65
lldb_private::UnwindPlan::SetLSDAAddress
void SetLSDAAddress(Address lsda_addr)
Definition: UnwindPlan.h:526
lldb_private::UnwindPlan::Row::RegisterLocation::atAFAPlusOffset
@ atAFAPlusOffset
Definition: UnwindPlan.h:67
lldb_private::UnwindPlan::Row::RegisterLocation::IsUnspecified
bool IsUnspecified() const
Definition: UnwindPlan.h:90
lldb_private::UnwindPlan::Row::RegisterLocation::IsAFAPlusOffset
bool IsAFAPlusOffset() const
Definition: UnwindPlan.h:98
lldb::RegisterKind
RegisterKind
Register numbering types.
Definition: lldb-enumerations.h:227
lldb-private.h
lldb_private::UnwindPlan::Row::RegisterLocation
Definition: UnwindPlan.h:57
lldb_private::UnwindPlan::Row::FAValue::isRegisterPlusOffset
@ isRegisterPlusOffset
Definition: UnwindPlan.h:202
lldb_private::UnwindPlan::Row::RegisterLocation::undefined
@ undefined
Definition: UnwindPlan.h:63
lldb_private::UnwindPlan::RowSP
std::shared_ptr< Row > RowSP
Definition: UnwindPlan.h:395
lldb_private::UnwindPlan::Row::FAValue::SetOffset
void SetOffset(int32_t offset)
Definition: UnwindPlan.h:274
lldb_private::UnwindPlan::m_plan_is_sourced_from_compiler
lldb_private::LazyBool m_plan_is_sourced_from_compiler
Definition: UnwindPlan.h:546
lldb_private::ConstString::Clear
void Clear()
Clear this object's state.
Definition: ConstString.h:232
lldb_private::UnwindPlan::Row::FAValue::GetDWARFExpr
void GetDWARFExpr(const uint8_t **opcodes, uint16_t &len) const
Definition: UnwindPlan.h:279
lldb_private::UnwindPlan::SetPersonalityFunctionPtr
void SetPersonalityFunctionPtr(Address presonality_func_ptr)
Definition: UnwindPlan.h:530
lldb_private::UnwindPlan::GetRowCount
int GetRowCount() const
Definition: UnwindPlan.cpp:427
lldb_private::UnwindPlan::Clear
void Clear()
Definition: UnwindPlan.h:510
lldb_private::UnwindPlan::Row::FAValue::reg_num
uint32_t reg_num
Definition: UnwindPlan.h:309
lldb_private::UnwindPlan::~UnwindPlan
~UnwindPlan()=default
lldb_private::AddressRange::Clear
void Clear()
Clear the object's state.
Definition: AddressRange.cpp:152
lldb_private::UnwindPlan::GetRowAtIndex
const UnwindPlan::RowSP GetRowAtIndex(uint32_t idx) const
Definition: UnwindPlan.cpp:405
lldb_private::UnwindPlan::Row
Definition: UnwindPlan.h:55
uint32_t
lldb_private::UnwindPlan::Row::RegisterLocation::IsInOtherRegister
bool IsInOtherRegister() const
Definition: UnwindPlan.h:102
lldb_private::UnwindPlan::IsValidRowIndex
bool IsValidRowIndex(uint32_t idx) const
Definition: UnwindPlan.cpp:401
lldb_private::UnwindPlan::Row::FAValue::reg
struct lldb_private::UnwindPlan::Row::FAValue::@29::@30 reg
lldb_private::UnwindPlan::Row::RegisterLocation::unspecified
@ unspecified
Definition: UnwindPlan.h:60
lldb_private::Address
Definition: Address.h:59
lldb_private::UnwindPlan::Row::RegisterLocation::SetIsDWARFExpression
void SetIsDWARFExpression(const uint8_t *opcodes, uint32_t len)
Definition: UnwindPlan.cpp:62
lldb_private::UnwindPlan::UnwindPlan
UnwindPlan(lldb::RegisterKind reg_kind)
Definition: UnwindPlan.h:397
lldb_private::UnwindPlan::GetSourceName
lldb_private::ConstString GetSourceName() const
Definition: UnwindPlan.cpp:566
lldb_private::UnwindPlan::m_plan_is_valid_at_all_instruction_locations
lldb_private::LazyBool m_plan_is_valid_at_all_instruction_locations
Definition: UnwindPlan.h:547
lldb_private::UnwindPlan::Row::FAValue::IncOffset
void IncOffset(int32_t delta)
Definition: UnwindPlan.h:269
lldb_private::UnwindPlan::Row::FAValue::SetIsRegisterPlusOffset
void SetIsRegisterPlusOffset(uint32_t reg_num, int32_t offset)
Definition: UnwindPlan.h:227
lldb_private::UnwindPlan::GetUnwindPlanForSignalTrap
lldb_private::LazyBool GetUnwindPlanForSignalTrap() const
Definition: UnwindPlan.h:500
lldb_private::UnwindPlan::Row::RegisterLocation::RegisterLocation
RegisterLocation()
Definition: UnwindPlan.h:74
lldb_private::UnwindPlan::Row::RegisterLocation::SetAtCFAPlusOffset
void SetAtCFAPlusOffset(int32_t offset)
Definition: UnwindPlan.h:108
uint16_t
lldb_private::UnwindPlan::m_plan_valid_address_range
AddressRange m_plan_valid_address_range
Definition: UnwindPlan.h:537
lldb_private::UnwindPlan::Row::SetOffset
void SetOffset(lldb::addr_t offset)
Definition: UnwindPlan.h:337
lldb_private::UnwindPlan::m_plan_is_for_signal_trap
lldb_private::LazyBool m_plan_is_for_signal_trap
Definition: UnwindPlan.h:548
lldb_private::UnwindPlan::Row::FAValue::operator!=
bool operator!=(const FAValue &rhs) const
Definition: UnwindPlan.h:212
lldb_private::UnwindPlan::Row::FAValue::SetIsDWARFExpression
void SetIsDWARFExpression(const uint8_t *opcodes, uint32_t len)
Definition: UnwindPlan.h:244
lldb_private::UnwindPlan::Row::RegisterLocation::opcodes
const uint8_t * opcodes
Definition: UnwindPlan.h:192
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::UnwindPlan::Row::RegisterLocation::IsUndefined
bool IsUndefined() const
Definition: UnwindPlan.h:92
lldb_private::eLazyBoolCalculate
@ eLazyBoolCalculate
Definition: lldb-private-enumerations.h:115
lldb_private::UnwindPlan::GetAddressRange
const AddressRange & GetAddressRange() const
Definition: UnwindPlan.h:458
lldb_private::UnwindPlan::Row::GetOffset
lldb::addr_t GetOffset() const
Definition: UnwindPlan.h:335
lldb_private::UnwindPlan::Row::RegisterLocation::offset
int32_t offset
Definition: UnwindPlan.h:187
lldb_private::UnwindPlan::Row::Dump
void Dump(Stream &s, const UnwindPlan *unwind_plan, Thread *thread, lldb::addr_t base_addr) const
Definition: UnwindPlan.cpp:223
lldb_private::UnwindPlan::Row::RegisterLocation::SetAtAFAPlusOffset
void SetAtAFAPlusOffset(int32_t offset)
Definition: UnwindPlan.h:118
lldb_private::UnwindPlan::Row::FAValue::unspecified
@ unspecified
Definition: UnwindPlan.h:201
ConstString.h
lldb_private::UnwindPlan::Row::FAValue::m_type
ValueType m_type
Definition: UnwindPlan.h:304
lldb_private::UnwindPlan::GetPersonalityFunctionPtr
Address GetPersonalityFunctionPtr() const
Definition: UnwindPlan.h:528
lldb_private::UnwindPlan::Row::RegisterLocation::SetIsCFAPlusOffset
void SetIsCFAPlusOffset(int32_t offset)
Definition: UnwindPlan.h:113
Stream.h
lldb_private::UnwindPlan::Row::GetAFAValue
FAValue & GetAFAValue()
Definition: UnwindPlan.h:343
lldb_private::UnwindPlan::Row::FAValue::FAValue
FAValue()
Definition: UnwindPlan.h:208
lldb_private::UnwindPlan::Row::FAValue::operator==
bool operator==(const FAValue &rhs) const
Definition: UnwindPlan.cpp:166
lldb_private::UnwindPlan::m_lsda_address
Address m_lsda_address
Definition: UnwindPlan.h:550
lldb_private::UnwindPlan::GetRegisterInfo
const RegisterInfo * GetRegisterInfo(Thread *thread, uint32_t reg_num) const
Definition: UnwindPlan.cpp:568
lldb_private::UnwindPlan::Row::RegisterLocation::IsSame
bool IsSame() const
Definition: UnwindPlan.h:88
lldb_private::UnwindPlan::m_register_kind
lldb::RegisterKind m_register_kind
Definition: UnwindPlan.h:538
AddressRange.h
lldb_private::UnwindPlan
Definition: UnwindPlan.h:53
lldb_private::UnwindPlan::Row::FAValue::m_value
union lldb_private::UnwindPlan::Row::FAValue::@29 m_value
lldb_private::UnwindPlan::Row::RegisterLocation::same
@ same
Definition: UnwindPlan.h:64
lldb_private::UnwindPlan::Row::RegisterLocation::GetDWARFExpressionLength
int GetDWARFExpressionLength()
Definition: UnwindPlan.h:174
lldb_private::UnwindPlan::Row::RegisterLocation::IsDWARFExpression
bool IsDWARFExpression() const
Definition: UnwindPlan.h:106
lldb_private::UnwindPlan::Row::FAValue::Dump
void Dump(Stream &s, const UnwindPlan *unwind_plan, Thread *thread) const
Definition: UnwindPlan.cpp:189
lldb_private::UnwindPlan::Row::RegisterLocation::GetDWARFExpressionBytes
const uint8_t * GetDWARFExpressionBytes()
Definition: UnwindPlan.h:168
lldb_private::UnwindPlan::Row::RegisterLocation::m_location
union lldb_private::UnwindPlan::Row::RegisterLocation::@27 m_location
lldb_private::UnwindPlan::Row::m_offset
lldb::addr_t m_offset
Definition: UnwindPlan.h:387
lldb_private::UnwindPlan::Row::RegisterLocation::inOtherRegister
@ inOtherRegister
Definition: UnwindPlan.h:69
lldb_private::UnwindPlan::Row::RegisterLocation::isAFAPlusOffset
@ isAFAPlusOffset
Definition: UnwindPlan.h:68
lldb_private::UnwindPlan::Row::RegisterLocation::atDWARFExpression
@ atDWARFExpression
Definition: UnwindPlan.h:70