58 uint32_t frame_number,
61 m_fast_unwind_plan_sp(), m_full_unwind_plan_sp(),
62 m_fallback_unwind_plan_sp(), m_all_registers_available(false),
65 m_current_offset(0), m_current_offset_backed_up_one(0),
66 m_behaves_like_zeroth_frame(false), m_sym_ctx(sym_ctx),
67 m_sym_ctx_valid(false), m_frame_number(frame_number), m_registers(),
68 m_parent_unwind(unwind_lldb) {
104 if (unwind_plan_sp->PlanValidAtAddress(pc_minus_one)) {
119 if (reg_ctx_sp.get() ==
nullptr) {
125 addr_t current_pc = reg_ctx_sp->GetPC();
145 if (lang_runtime_plan_sp.get()) {
158 UnwindLogMsg(
"using architectural default unwind method");
165 UnwindLogMsg(
"with pc value of 0x%" PRIx64
", symbol name is '%s'",
168 UnwindLogMsg(
"with pc value of 0x%" PRIx64
", function name is '%s'",
172 ", no symbol/function name is known.",
218 if (lang_runtime_plan_sp.get()) {
221 row_register_kind = lang_runtime_plan_sp->GetRegisterKind();
229 active_row->Dump(active_row_strm, lang_runtime_plan_sp.get(), &
m_thread,
235 "initialized async frame current pc is 0x%" PRIx64
236 " cfa is 0x%" PRIx64
" afa is 0x%" PRIx64,
249 if (active_row.get() && log) {
257 if (!active_row.get()) {
258 UnwindLogMsg(
"could not find an unwindplan row for this frame's pc");
268 bool cfa_status =
false;
272 pc_module_sp->GetUnwindTable().GetFuncUnwindersContainingAddress(
276 if (func_unwinders_sp.get() !=
nullptr)
277 call_site_unwind_plan = func_unwinders_sp->GetUnwindPlanAtCallSite(
280 if (call_site_unwind_plan.get() !=
nullptr) {
286 UnwindLogMsg(
"could not read CFA value for first frame.");
295 "could not read CFA or AFA values for first frame, not valid.");
300 UnwindLogMsg(
"initialized frame current pc is 0x%" PRIx64
" cfa is 0x%" PRIx64
301 " afa is 0x%" PRIx64
" using %s UnwindPlan",
315 UnwindLogMsg(
"non-zeroth frame tests positive for IsFrameZero -- that "
316 "shouldn't happen.");
322 UnwindLogMsg(
"Could not get next frame, marking this frame as invalid.");
327 UnwindLogMsg(
"Could not get register context for this thread, marking this "
328 "frame as invalid.");
344 if (lang_runtime_plan_sp.get()) {
359 pc = abi_sp->FixCodeAddress(
pc);
366 reg_val = abi_sp->FixDataAddress(reg_val);
371 reg_val = abi_sp->FixDataAddress(reg_val);
378 bool above_trap_handler =
false;
381 above_trap_handler =
true;
383 if (
pc == 0 ||
pc == 0x1) {
384 if (!above_trap_handler) {
391 const bool allow_section_end =
true;
402 above_trap_handler ==
false) {
403 UnwindLogMsg(
"using architectural default unwind method");
407 uint32_t permissions;
409 (permissions & ePermissionsExecutable) == 0) {
417 UnwindLogMsg(
"had a pc of 0x%" PRIx64
" which is not in executable "
418 "memory but on frame 1 -- "
426 UnwindLogMsg(
"pc is in a non-executable section of memory and this "
427 "isn't the 2nd frame in the stack walk.");
468 (permissions & ePermissionsReadable) == 0) {
471 "the CFA points to a region of memory that is not readable");
475 UnwindLogMsg(
"could not find a row for function offset zero");
483 UnwindLogMsg(
"same CFA address as next frame, assuming the unwind is "
484 "looping - stopping");
490 UnwindLogMsg(
"initialized frame cfa is 0x%" PRIx64
" afa is 0x%" PRIx64,
495 UnwindLogMsg(
"could not find any symbol for this pc, or a default unwind "
496 "plan, to continue unwind.");
504 UnwindLogMsg(
"with pc value of 0x%" PRIx64
", symbol name is '%s'",
pc,
507 UnwindLogMsg(
"with pc value of 0x%" PRIx64
", function name is '%s'",
pc,
511 ", no symbol/function name is known.",
515 bool decr_pc_and_recompute_addr_range;
519 decr_pc_and_recompute_addr_range =
true;
524 decr_pc_and_recompute_addr_range =
false;
531 decr_pc_and_recompute_addr_range =
false;
533 decr_pc_and_recompute_addr_range =
true;
539 decr_pc_and_recompute_addr_range =
false;
541 decr_pc_and_recompute_addr_range =
false;
544 decr_pc_and_recompute_addr_range =
true;
553 if (decr_pc_and_recompute_addr_range) {
555 " by 1 and re-doing symbol lookup; old symbol was %s",
573 if (decr_pc_and_recompute_addr_range &&
604 if (lang_runtime_plan_sp.get()) {
607 row_register_kind = lang_runtime_plan_sp->GetRegisterKind();
615 active_row->Dump(active_row_strm, lang_runtime_plan_sp.get(), &
m_thread,
621 "initialized async frame current pc is 0x%" PRIx64
622 " cfa is 0x%" PRIx64
" afa is 0x%" PRIx64,
643 if (active_row.get() && log) {
658 if (active_row.get() && log) {
670 if (!active_row.get()) {
689 UnwindLogMsg(
"same CFA address as next frame, assuming the unwind is "
690 "looping - stopping");
696 UnwindLogMsg(
"initialized frame current pc is 0x%" PRIx64
697 " cfa is 0x%" PRIx64
" afa is 0x%" PRIx64,
720 next_frame->GetNextFrame();
722 if (next_next_frame && next_next_frame->GetCFA(next_next_frame_cfa)) {
723 if (next_next_frame_cfa ==
m_cfa) {
758 pc_module_sp->GetObjectFile() ==
nullptr)
759 return unwind_plan_sp;
762 return unwind_plan_sp;
765 pc_module_sp->GetUnwindTable().GetFuncUnwindersContainingAddress(
767 if (!func_unwinders_sp)
768 return unwind_plan_sp;
773 return unwind_plan_sp;
775 unwind_plan_sp = func_unwinders_sp->GetUnwindPlanFastUnwind(
777 if (unwind_plan_sp) {
780 return unwind_plan_sp;
782 unwind_plan_sp.reset();
785 return unwind_plan_sp;
802 ABI *abi = process ? process->
GetABI().get() :
nullptr;
804 arch_default_unwind_plan_sp =
809 "unable to get architectural default UnwindPlan from ABI plugin");
831 uint32_t permissions;
834 if (current_pc_addr == 0 ||
837 (permissions & ePermissionsExecutable) == 0)) {
843 return unwind_plan_sp;
851 pc_module_sp->GetObjectFile() ==
nullptr) {
853 return arch_default_unwind_plan_sp;
859 pc_module_sp->GetUnwindTable().GetFuncUnwindersContainingAddress(
868 if (!func_unwinders_sp) {
871 if (!pc_module_sp || !pc_module_sp->GetObjectFile() ||
873 return arch_default_unwind_plan_sp;
878 pc_module_sp->GetUnwindTable().GetEHFrameInfo();
882 return unwind_plan_sp;
884 unwind_plan_sp.reset();
888 pc_module_sp->GetUnwindTable().GetArmUnwindInfo();
893 return unwind_plan_sp;
895 unwind_plan_sp.reset();
899 pc_module_sp->GetUnwindTable().GetObjectFileUnwindInfo();
900 if (object_file_unwind) {
903 return unwind_plan_sp;
905 unwind_plan_sp.reset();
908 return arch_default_unwind_plan_sp;
919 unwind_plan_sp = platform->GetTrapHandlerUnwindPlan(
924 return unwind_plan_sp;
928 func_unwinders_sp->GetEHFrameUnwindPlan(process->
GetTarget());
931 func_unwinders_sp->GetObjectFileUnwindPlan(process->
GetTarget());
932 if (unwind_plan_sp && unwind_plan_sp->PlanValidAtAddress(
m_current_pc) &&
933 unwind_plan_sp->GetSourcedFromCompiler() ==
eLazyBoolYes) {
934 return unwind_plan_sp;
953 func_unwinders_sp->GetEHFrameUnwindPlan(process->
GetTarget());
956 func_unwinders_sp->GetObjectFileUnwindPlan(process->
GetTarget());
957 if (unwind_plan_sp && unwind_plan_sp->PlanValidAtAddress(
m_current_pc)) {
959 "DynamicLoader suggested we prefer it",
960 unwind_plan_sp->GetSourceName().GetCString());
961 return unwind_plan_sp;
968 unwind_plan_sp = func_unwinders_sp->GetUnwindPlanAtNonCallSite(
970 if (unwind_plan_sp && unwind_plan_sp->PlanValidAtAddress(
m_current_pc)) {
971 if (unwind_plan_sp->GetSourcedFromCompiler() ==
eLazyBoolNo) {
984 func_unwinders_sp->GetUnwindPlanAtCallSite(process->
GetTarget(),
986 if (call_site_unwind_plan &&
987 call_site_unwind_plan.get() != unwind_plan_sp.get() &&
988 call_site_unwind_plan->GetSourceName() !=
989 unwind_plan_sp->GetSourceName()) {
996 "is the non-call site unwind plan and this is a "
998 unwind_plan_sp->GetSourceName().GetCString());
999 return unwind_plan_sp;
1007 func_unwinders_sp->GetUnwindPlanArchitectureDefaultAtFunctionEntry(
1009 if (unwind_plan_sp) {
1011 "the first instruction of a function",
1012 unwind_plan_sp->GetSourceName().GetCString());
1013 return unwind_plan_sp;
1021 unwind_plan_sp = func_unwinders_sp->GetUnwindPlanAtCallSite(
1026 "is the call-site unwind plan",
1027 unwind_plan_sp->GetSourceName().GetCString());
1028 return unwind_plan_sp;
1035 unwind_plan_sp = func_unwinders_sp->GetUnwindPlanAtNonCallSite(
1038 if (unwind_plan_sp &&
1039 unwind_plan_sp->GetSourcedFromCompiler() ==
eLazyBoolNo) {
1051 func_unwinders_sp->GetUnwindPlanAtCallSite(process->
GetTarget(),
1053 if (call_site_unwind_plan &&
1054 call_site_unwind_plan.get() != unwind_plan_sp.get() &&
1055 call_site_unwind_plan->GetSourceName() !=
1056 unwind_plan_sp->GetSourceName()) {
1065 "failed to find a call-site unwind plan that would work",
1066 unwind_plan_sp->GetSourceName().GetCString());
1067 return unwind_plan_sp;
1072 if (arch_default_unwind_plan_sp)
1074 "frame uses %s for full UnwindPlan because we are falling back "
1075 "to the arch default plan",
1076 arch_default_unwind_plan_sp->GetSourceName().GetCString());
1079 "Unable to find any UnwindPlan for full unwind of this frame.");
1081 return arch_default_unwind_plan_sp;
1115 bool success =
false;
1117 switch (regloc.
type) {
1122 if (!other_reg_info)
1132 if (!other_reg_info)
1139 success =
GetNextFrame()->ReadRegister(other_reg_info, value);
1150 llvm_unreachable(
"FIXME debugger inferior function call unwind");
1155 success =
error.Success();
1158 llvm_unreachable(
"Unknown RegisterLocation type.");
1169 bool success =
false;
1171 switch (regloc.
type) {
1185 success =
GetNextFrame()->WriteRegister(other_reg_info, value);
1192 llvm_unreachable(
"FIXME debugger inferior function call unwind");
1197 success =
error.Success();
1200 llvm_unreachable(
"Unknown RegisterLocation type.");
1236 const std::vector<ConstString> trap_handler_names(
1237 platform_sp->GetTrapHandlerSymbolNames());
1245 const std::vector<ConstString> user_specified_trap_handler_names(
1247 for (
ConstString name : user_specified_trap_handler_names) {
1273 regloc = iterator->second;
1274 UnwindLogMsg(
"supplying caller's saved %s (%d)'s location, cached",
1283 bool have_unwindplan_regloc =
false;
1291 UnwindLogMsg(
"could not convert lldb regnum %s (%d) into %d RegisterKind "
1292 "reg numbering scheme",
1294 (
int)unwindplan_registerkind);
1305 if (active_row->GetRegisterInfo(regnum.
GetAsKind(unwindplan_registerkind),
1306 unwindplan_regloc) &&
1309 "supplying caller's saved %s (%d)'s location using FastUnwindPlan",
1311 have_unwindplan_regloc =
true;
1315 if (!have_unwindplan_regloc) {
1318 bool got_new_full_unwindplan =
false;
1321 got_new_full_unwindplan =
true;
1333 if (got_new_full_unwindplan && active_row.get() && log) {
1348 if (pc_regnum.
IsValid() && pc_regnum == regnum &&
1358 active_row->GetRegisterInfo
1359 (pc_regnum.
GetAsKind (unwindplan_registerkind), scratch)) {
1360 UnwindLogMsg(
"Providing pc register instead of rewriting to "
1361 "RA reg because this is a trap handler and there is "
1362 "a location for the saved pc register value.");
1364 return_address_reg.
init(
1367 regnum = return_address_reg;
1368 UnwindLogMsg(
"requested caller's saved PC but this UnwindPlan uses a "
1369 "RA reg; getting %s (%d) instead",
1376 UnwindLogMsg(
"could not convert lldb regnum %s (%d) into "
1377 "eRegisterKindGeneric reg numbering scheme",
1380 UnwindLogMsg(
"could not convert lldb regnum %s (%d) into %d "
1381 "RegisterKind reg numbering scheme",
1383 (
int)unwindplan_registerkind);
1390 active_row->GetRegisterInfo(regnum.
GetAsKind(unwindplan_registerkind),
1391 unwindplan_regloc)) {
1392 have_unwindplan_regloc =
true;
1394 "supplying caller's saved %s (%d)'s location using %s UnwindPlan",
1403 if (!have_unwindplan_regloc && return_address_reg.
IsValid() &&
1413 regloc = new_regloc;
1414 UnwindLogMsg(
"supplying caller's register %s (%d) from the live "
1415 "RegisterContext at frame 0, saved in %d",
1442 if (arch_default_ra_regnum.
GetAsKind(unwindplan_registerkind) !=
1446 arch_default_ra_regnum.
GetAsKind(unwindplan_registerkind) &&
1449 UnwindLogMsg(
"%s UnwindPlan tried to restore the pc from the link "
1450 "register but this is a non-zero frame",
1465 bool can_fetch_pc_value =
false;
1466 bool can_fetch_cfa =
false;
1469 if (arch_default_pc_reg.
GetAsKind(unwindplan_registerkind) !=
1471 active_row->GetRegisterInfo(
1472 arch_default_pc_reg.
GetAsKind(unwindplan_registerkind),
1473 unwindplan_regloc)) {
1474 can_fetch_pc_value =
true;
1477 active_row->GetCFAValue(), cfa_value)) {
1478 can_fetch_cfa =
true;
1482 have_unwindplan_regloc = can_fetch_pc_value && can_fetch_cfa;
1485 have_unwindplan_regloc =
false;
1493 if (!have_unwindplan_regloc) {
1498 ABI *abi = process ? process->
GetABI().get() :
nullptr;
1505 "supplying caller's saved %s (%d)'s location using ABI default",
1507 have_unwindplan_regloc =
true;
1512 if (!have_unwindplan_regloc) {
1521 regloc = new_regloc;
1522 UnwindLogMsg(
"supplying caller's register %s (%d) from the live "
1523 "RegisterContext at frame 0",
1527 std::string unwindplan_name;
1529 unwindplan_name +=
"via '";
1531 unwindplan_name +=
"'";
1535 unwindplan_name.c_str());
1545 UnwindLogMsg(
"save location for %s (%d) is unspecified, continue searching",
1552 "did not supply reg location for %s (%d) because it is volatile",
1557 if (unwindplan_regloc.
IsSame()) {
1561 UnwindLogMsg(
"register %s (%d) is marked as 'IsSame' - it is a pc or "
1562 "return address reg on a frame which does not have all "
1563 "registers available -- treat as if we have no information",
1571 "supplying caller's register %s (%d), saved in register %s (%d)",
1579 int offset = unwindplan_regloc.
GetOffset();
1583 UnwindLogMsg(
"supplying caller's register %s (%d), value is CFA plus "
1584 "offset %d [value is 0x%" PRIx64
"]",
1591 int offset = unwindplan_regloc.
GetOffset();
1595 UnwindLogMsg(
"supplying caller's register %s (%d) from the stack, saved at "
1596 "CFA plus offset %d [saved at 0x%" PRIx64
"]",
1606 int offset = unwindplan_regloc.
GetOffset();
1610 UnwindLogMsg(
"supplying caller's register %s (%d), value is AFA plus "
1611 "offset %d [value is 0x%" PRIx64
"]",
1621 int offset = unwindplan_regloc.
GetOffset();
1625 UnwindLogMsg(
"supplying caller's register %s (%d) from the stack, saved at "
1626 "AFA plus offset %d [saved at 0x%" PRIx64
"]",
1637 UnwindLogMsg(
"could not supply caller's %s (%d) location - was saved in "
1638 "another reg but couldn't convert that regnum",
1646 "supplying caller's register %s (%d), saved in register %s (%d)",
1661 unwindplan_registerkind);
1664 llvm::Expected<Value> result =
1665 dwarfexpr.
Evaluate(&exe_ctx,
this, 0, &cfa_val,
nullptr);
1668 "DWARF expression failed to evaluate: {0}");
1671 val = result->GetScalar().ULongLong();
1676 UnwindLogMsg(
"supplying caller's register %s (%d) via DWARF expression "
1677 "(IsDWARFExpression)",
1685 UnwindLogMsg(
"supplying caller's register %s (%d) via DWARF expression "
1686 "(IsAtDWARFExpression)",
1691 UnwindLogMsg(
"tried to use IsDWARFExpression or IsAtDWARFExpression for %s "
1701 UnwindLogMsg(
"supplying caller's register %s (%d) via constant value",
1706 UnwindLogMsg(
"no save location for %s (%d) in this stack frame",
1770 if (
ABISP abi_sp = process_sp->GetABI())
1771 old_caller_pc_value = abi_sp->FixCodeAddress(old_caller_pc_value);
1803 active_row->GetCFAValue().GetValueType() !=
1807 active_row->GetCFAValue(), new_cfa) ||
1809 UnwindLogMsg(
"failed to get cfa with fallback unwindplan");
1817 active_row->GetAFAValue(),
m_afa);
1830 if (
ABISP abi_sp = process_sp->GetABI())
1831 new_caller_pc_value = abi_sp->FixCodeAddress(new_caller_pc_value);
1838 UnwindLogMsg(
"failed to get a pc value for the caller frame with the "
1839 "fallback unwind plan");
1847 if (old_caller_pc_value == new_caller_pc_value &&
1850 UnwindLogMsg(
"fallback unwind plan got the same values for this frame "
1851 "CFA and caller frame pc, not using");
1857 UnwindLogMsg(
"trying to unwind from this function with the UnwindPlan '%s' "
1858 "because UnwindPlan '%s' failed.",
1860 original_full_unwind_plan_sp->GetSourceName().GetCString());
1888 active_row->GetCFAValue().GetValueType() !=
1892 active_row->GetCFAValue(), new_cfa) ||
1894 UnwindLogMsg(
"failed to get cfa with fallback unwindplan");
1900 active_row->GetAFAValue(),
m_afa);
1911 UnwindLogMsg(
"switched unconditionally to the fallback unwindplan %s",
1920 if (unwind_plan->GetUnwindPlanForSignalTrap() !=
eLazyBoolYes) {
1944 UnwindLogMsg(
"Resetting current offset and re-doing symbol lookup; "
1945 "old symbol was %s",
1984 cfa_reg_contents = abi_sp->FixDataAddress(cfa_reg_contents);
1986 reg_info, cfa_reg_contents, reg_info->
byte_size, reg_value);
1987 if (
error.Success()) {
1990 address = abi_sp->FixCodeAddress(address);
1992 "CFA value via dereferencing reg %s (%d): reg has val 0x%" PRIx64
1993 ", CFA value is 0x%" PRIx64,
1995 cfa_reg_contents, address);
1999 "] but memory read failed.",
2012 cfa_reg_contents = abi_sp->FixDataAddress(cfa_reg_contents);
2014 cfa_reg_contents == 1) {
2016 "Got an invalid CFA register value - reg %s (%d), value 0x%" PRIx64,
2022 address = cfa_reg_contents + fa.
GetOffset();
2024 "CFA is 0x%" PRIx64
": Register %s (%d) contents are 0x%" PRIx64
2043 llvm::Expected<Value> result =
2044 dwarfexpr.
Evaluate(&exe_ctx,
this, 0,
nullptr,
nullptr);
2046 address = result->GetScalar().ULongLong();
2048 address = abi_sp->FixCodeAddress(address);
2050 UnwindLogMsg(
"CFA value set by DWARF expression is 0x%" PRIx64,
2054 UnwindLogMsg(
"Failed to set CFA value via DWARF expression: %s",
2055 llvm::toString(result.takeError()).c_str());
2063 const unsigned max_iterations = 256;
2064 for (
unsigned i = 0; i < max_iterations; ++i) {
2071 UnwindLogMsg(
"Cannot read memory at 0x%" PRIx64
": %s", candidate_addr,
2076 uint32_t permissions;
2078 permissions & lldb::ePermissionsExecutable) {
2079 address = candidate_addr;
2080 UnwindLogMsg(
"Heuristically found CFA: 0x%" PRIx64, address);
2100 hint = abi_sp->FixCodeAddress(hint);
2102 hint += plan_offset;
2105 if (!next->m_sym_ctx.module_sp || !next->m_sym_ctx.symbol)
2107 if (
auto expected_size =
2108 next->m_sym_ctx.module_sp->GetSymbolFile()->GetParameterStackSize(
2109 *next->m_sym_ctx.symbol))
2110 hint += *expected_size;
2113 llvm::toString(expected_size.takeError()).c_str());
2137 uint32_t regnum,
addr_t &value) {
2141 uint32_t lldb_regnum;
2143 lldb_regnum = regnum;
2153 "Could not find RegisterInfo definition for lldb register number %d",
2160 generic_regnum = regnum;
2175 value = abi_sp->FixCodeAddress(value);
2178 value = abi_sp->FixDataAddress(value);
2185 bool pc_register =
false;
2200 value = abi_sp->FixCodeAddress(value);
2232 bool is_pc_regnum =
false;
2235 is_pc_regnum =
true;
2250 value = abi_sp->FixCodeAddress(reg_value);
2326 bool read_successfully =
ReadPC (start_pc);
2327 if (read_successfully)
2332 if (
ABISP abi_sp = process_sp->GetABI())
2333 start_pc = abi_sp->FixCodeAddress(start_pc);
2336 return read_successfully;
2348 bool above_trap_handler =
false;
2351 above_trap_handler =
true;
2362 pc = abi_sp->FixCodeAddress(
pc);
2365 above_trap_handler ==
false && (
pc == 0 ||
pc == 1));
2377 va_start(args, fmt);
2379 llvm::SmallString<0> logmsg;
2394 va_start(args, fmt);
2396 llvm::SmallString<0> logmsg;
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOGF(log,...)
#define LLDB_LOG_ERROR(log, error,...)
static ConstString GetSymbolOrFunctionName(const SymbolContext &sym_ctx)
A class to represent register numbers, and able to convert between different register numbering schem...
uint32_t GetAsKind(lldb::RegisterKind kind)
lldb::RegisterKind GetRegisterKind() const
uint32_t GetRegisterNumber() const
void init(lldb_private::Thread &thread, lldb::RegisterKind kind, uint32_t num)
virtual bool GetFallbackRegisterLocation(const RegisterInfo *reg_info, UnwindPlan::Row::RegisterLocation &unwind_regloc)
virtual bool CreateDefaultUnwindPlan(UnwindPlan &unwind_plan)=0
virtual bool CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan)=0
A section + offset based address range class.
Address & GetBaseAddress()
Get accessor for the base address of the range.
A section + offset based address class.
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
bool SetLoadAddress(lldb::addr_t load_addr, Target *target, bool allow_section_end=false)
Set the address to represent load_addr.
lldb::SectionSP GetSection() const
Get const accessor for the section.
bool ResolveFunctionScope(lldb_private::SymbolContext &sym_ctx, lldb_private::AddressRange *addr_range_ptr=nullptr)
Resolve this address to its containing function and optionally get that function's address range.
lldb::ModuleSP GetModule() const
Get accessor for the module for this address.
lldb::addr_t GetFileAddress() const
Get the file address.
lldb::addr_t GetOffset() const
Get the section relative offset value.
bool IsValid() const
Check if the object state is valid.
bool SetOffset(lldb::addr_t offset)
Set accessor for the offset.
llvm::Triple & GetTriple()
Architecture triple accessor.
bool GetUnwindPlan(Target &target, const Address &addr, UnwindPlan &unwind_plan)
virtual bool GetUnwindPlan(const Address &addr, UnwindPlan &unwind_plan)=0
A uniqued constant string class.
bool GetUnwindPlan(const Address &addr, UnwindPlan &unwind_plan)
Return an UnwindPlan based on the call frame information encoded in the FDE of this DWARFCallFrameInf...
"lldb/Expression/DWARFExpressionList.h" Encapsulates a range map from file address range to a single ...
llvm::Expected< Value > Evaluate(ExecutionContext *exe_ctx, RegisterContext *reg_ctx, lldb::addr_t func_load_addr, const Value *initial_value_ptr, const Value *object_address_ptr) const
DWARFExpression * GetMutableExpressionAtAddress(lldb::addr_t func_load_addr=LLDB_INVALID_ADDRESS, lldb::addr_t load_addr=0)
void SetRegisterKind(lldb::RegisterKind reg_kind)
Set the call-frame-info style register kind.
virtual bool AlwaysRelyOnEHUnwindInfo(SymbolContext &sym_ctx)
Ask if the eh_frame information for the given SymbolContext should be relied on even when it's the fi...
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
Target * GetTargetPtr() const
Returns a pointer to the target object.
Target & GetTargetRef() const
Returns a reference to the target object.
Process * GetProcessPtr() const
Returns a pointer to the process object.
ConstString GetName() const
static lldb::UnwindPlanSP GetRuntimeUnwindPlan(lldb_private::Thread &thread, lldb_private::RegisterContext *regctx, bool &behaves_like_zeroth_frame)
A language runtime may be able to provide a special UnwindPlan for the frame represented by the regis...
A plug-in interface definition class for debugging a process.
virtual bool GetLoadAddressPermissions(lldb::addr_t load_addr, uint32_t &permissions)
Attempt to get the attributes for a region of memory in the process.
lldb::ByteOrder GetByteOrder() const
lldb::addr_t ReadPointerFromMemory(lldb::addr_t vm_addr, Status &error)
lldb::addr_t FixCodeAddress(lldb::addr_t pc)
Some targets might use bits in a code address to indicate a mode switch, ARM uses bit zero to signify...
uint32_t GetAddressByteSize() const
virtual DynamicLoader * GetDynamicLoader()
Get the dynamic loader plug-in for this process.
const lldb::ABISP & GetABI()
Target & GetTarget()
Get the target object pointer for this module.
bool WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override
bool CheckIfLoopingStack()
bool GetCFA(lldb::addr_t &cfa)
void InitializeZerothFrame()
lldb_private::Thread & m_thread
void UnwindLogMsg(const char *fmt,...) __attribute__((format(printf
bool WriteRegisterValueToRegisterLocation(lldb_private::UnwindLLDB::RegisterLocation regloc, const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &value)
lldb_private::Address m_start_pc
bool ReadRegisterValueFromRegisterLocation(lldb_private::UnwindLLDB::RegisterLocation regloc, const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value)
void void UnwindLogMsgVerbose(const char *fmt,...) __attribute__((format(printf
const lldb_private::RegisterInfo * GetRegisterInfoAtIndex(size_t reg) override
void InitializeNonZerothFrame()
const lldb_private::RegisterSet * GetRegisterSet(size_t reg_set) override
bool m_behaves_like_zeroth_frame
std::shared_ptr< RegisterContextUnwind > SharedPtr
void PropagateTrapHandlerFlagFromUnwindPlan(lldb::UnwindPlanSP unwind_plan)
Check if the given unwind plan indicates a signal trap handler, and update frame type and symbol cont...
bool ReadAllRegisterValues(lldb::WritableDataBufferSP &data_sp) override
lldb::UnwindPlanSP GetFullUnwindPlanForFrame()
bool WriteRegister(const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &value) override
void InvalidateAllRegisters() override
RegisterContextUnwind(lldb_private::Thread &thread, const SharedPtr &next_frame, lldb_private::SymbolContext &sym_ctx, uint32_t frame_number, lldb_private::UnwindLLDB &unwind_lldb)
bool ReadPC(lldb::addr_t &start_pc)
lldb_private::UnwindLLDB::RegisterSearchResult SavedLocationForRegister(uint32_t lldb_regnum, lldb_private::UnwindLLDB::RegisterLocation ®loc)
lldb::UnwindPlanSP m_fast_unwind_plan_sp
bool ForceSwitchToFallbackUnwindPlan()
Switch to the fallback unwind plan unconditionally without any safety checks that it is providing bet...
std::map< uint32_t, lldb_private::UnwindLLDB::RegisterLocation > m_registers
size_t GetRegisterSetCount() override
bool IsTrapHandlerFrame() const
bool ReadGPRValue(lldb::RegisterKind register_kind, uint32_t regnum, lldb::addr_t &value)
lldb_private::UnwindLLDB & m_parent_unwind
void void bool IsUnwindPlanValidForCurrentPC(lldb::UnwindPlanSP unwind_plan_sp)
bool m_all_registers_available
bool TryFallbackUnwindPlan()
If the unwind has to the caller frame has failed, try something else.
lldb_private::Address m_current_pc
bool ReadRegister(const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value) override
int m_current_offset_backed_up_one
bool ReadFrameAddress(lldb::RegisterKind register_kind, UnwindPlan::Row::FAValue &fa, lldb::addr_t &address)
lldb::addr_t GetReturnAddressHint(int32_t plan_offset)
bool IsTrapHandlerSymbol(lldb_private::Process *process, const lldb_private::SymbolContext &m_sym_ctx) const
Determines if a SymbolContext is a trap handler or not.
uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) override
Convert from a given register numbering scheme to the lldb register numbering scheme.
lldb::UnwindPlanSP GetFastUnwindPlanForFrame()
lldb_private::SymbolContext & m_sym_ctx
bool BehavesLikeZerothFrame() const override
Indicates that this frame is currently executing code, that the PC value is not a return-pc but an ac...
SharedPtr GetPrevFrame() const
lldb::UnwindPlanSP m_full_unwind_plan_sp
SharedPtr GetNextFrame() const
size_t GetRegisterCount() override
bool GetStartPC(lldb::addr_t &start_pc)
lldb::UnwindPlanSP m_fallback_unwind_plan_sp
virtual Status ReadRegisterValueFromMemory(const lldb_private::RegisterInfo *reg_info, lldb::addr_t src_addr, uint32_t src_len, RegisterValue ®_value)
lldb::TargetSP CalculateTarget() override
virtual Status WriteRegisterValueToMemory(const lldb_private::RegisterInfo *reg_info, lldb::addr_t dst_addr, uint32_t dst_len, const RegisterValue ®_value)
bool SetUInt(uint64_t uint, uint32_t byte_size)
uint64_t GetAsUInt64(uint64_t fail_value=UINT64_MAX, bool *success_ptr=nullptr) const
RegisterValue::Type GetType() const
bool Fail() const
Test for error condition.
const char * AsCString(const char *default_error_str="unknown error") const
Get the error string associated with the current error.
const char * GetData() const
Defines a symbol context baton that can be handed other debug core functions.
Function * function
The Function for a given query.
lldb::ModuleSP module_sp
The Module for a given query.
void Clear(bool clear_target)
Clear the object's state.
Symbol * symbol
The Symbol for a given query.
ConstString GetName() const
lldb::PlatformSP GetPlatform()
const ArchSpec & GetArchitecture() const
virtual lldb::RegisterContextSP GetRegisterContext()=0
uint32_t GetIndexID() const
lldb::TargetSP CalculateTarget() override
lldb::ProcessSP GetProcess() const
const std::vector< ConstString > & GetUserSpecifiedTrapHandlerFunctionNames()
Provide the list of user-specified trap handler functions.
RegisterContextLLDBSP GetRegisterContextForFrameNum(uint32_t frame_num)
bool SearchForSavedLocationForRegister(uint32_t lldb_regnum, lldb_private::UnwindLLDB::RegisterLocation ®loc, uint32_t starting_frame_num, bool pc_register)
const uint8_t * GetDWARFExpressionBytes()
int32_t GetOffset() const
int GetDWARFExpressionLength()
ValueType GetValueType() const
uint32_t GetRegisterNumber() const
bool IsInOtherRegister() const
uint32_t GetRegisterNumber() const
bool IsCFAPlusOffset() const
uint64_t GetConstant() const
bool IsAtCFAPlusOffset() const
bool IsAFAPlusOffset() const
bool IsUnspecified() const
int32_t GetOffset() const
bool IsAtAFAPlusOffset() const
const uint8_t * GetDWARFExpressionBytes()
int GetDWARFExpressionLength()
bool IsDWARFExpression() const
bool IsAtDWARFExpression() const
std::shared_ptr< Row > RowSP
@ LoadAddress
A load address value.
void SetValueType(ValueType value_type)
#define LLDB_REGNUM_GENERIC_RA
#define LLDB_REGNUM_GENERIC_SP
#define LLDB_INVALID_ADDRESS
#define LLDB_INVALID_REGNUM
#define LLDB_REGNUM_GENERIC_PC
#define LLDB_REGNUM_GENERIC_FP
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
bool VASprintf(llvm::SmallVectorImpl< char > &buf, const char *fmt, va_list args)
std::shared_ptr< lldb_private::ABI > ABISP
std::shared_ptr< lldb_private::Platform > PlatformSP
std::shared_ptr< lldb_private::FuncUnwinders > FuncUnwindersSP
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::UnwindPlan > UnwindPlanSP
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
std::shared_ptr< lldb_private::WritableDataBuffer > WritableDataBufferSP
std::shared_ptr< lldb_private::RegisterContext > RegisterContextSP
std::shared_ptr< lldb_private::Module > ModuleSP
RegisterKind
Register numbering types.
@ eRegisterKindGeneric
insn ptr reg, stack ptr reg, etc not specific to any particular target
@ eRegisterKindLLDB
lldb's internal register numbers
Every register is described in detail including its name, alternate name (optional),...
uint32_t byte_size
Size in bytes of the register.
uint32_t kinds[lldb::kNumRegisterKinds]
Holds all of the various register numbers for all register kinds.
Registers are grouped into register sets.
@ eRegisterInLiveRegisterContext
@ eRegisterSavedAtHostMemoryLocation
@ eRegisterSavedAtMemoryLocation
lldb::addr_t target_memory_location
union lldb_private::UnwindLLDB::RegisterLocation::@37 location