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) {
87 lldb::UnwindPlanSP unwind_plan_sp) {
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();
146 if (lang_runtime_plan_sp.get()) {
159 UnwindLogMsg(
"using architectural default unwind method");
166 UnwindLogMsg(
"with pc value of 0x%" PRIx64
", symbol name is '%s'",
169 UnwindLogMsg(
"with pc value of 0x%" PRIx64
", function name is '%s'",
173 ", no symbol/function name is known.",
219 if (lang_runtime_plan_sp.get()) {
222 row_register_kind = lang_runtime_plan_sp->GetRegisterKind();
230 active_row->Dump(active_row_strm, lang_runtime_plan_sp.get(), &
m_thread,
236 "initialized async frame current pc is 0x%" PRIx64
237 " cfa is 0x%" PRIx64
" afa is 0x%" PRIx64,
250 if (active_row.get() && log) {
258 if (!active_row.get()) {
259 UnwindLogMsg(
"could not find an unwindplan row for this frame's pc");
267 FuncUnwindersSP func_unwinders_sp;
268 UnwindPlanSP call_site_unwind_plan;
269 bool cfa_status =
false;
273 pc_module_sp->GetUnwindTable().GetFuncUnwindersContainingAddress(
277 if (func_unwinders_sp.get() !=
nullptr)
278 call_site_unwind_plan = func_unwinders_sp->GetUnwindPlanAtCallSite(
281 if (call_site_unwind_plan.get() !=
nullptr) {
287 UnwindLogMsg(
"could not read CFA value for first frame.");
296 "could not read CFA or AFA values for first frame, not valid.");
301 UnwindLogMsg(
"initialized frame current pc is 0x%" PRIx64
" cfa is 0x%" PRIx64
302 " afa is 0x%" PRIx64
" using %s UnwindPlan",
316 UnwindLogMsg(
"non-zeroth frame tests positive for IsFrameZero -- that "
317 "shouldn't happen.");
323 UnwindLogMsg(
"Could not get next frame, marking this frame as invalid.");
328 UnwindLogMsg(
"Could not get register context for this thread, marking this "
329 "frame as invalid.");
345 if (lang_runtime_plan_sp.get()) {
373 bool above_trap_handler =
false;
376 above_trap_handler =
true;
378 if (
pc == 0 ||
pc == 0x1) {
379 if (!above_trap_handler) {
386 const bool allow_section_end =
true;
397 above_trap_handler ==
false) {
398 UnwindLogMsg(
"using architectural default unwind method");
404 (permissions & ePermissionsExecutable) == 0) {
412 UnwindLogMsg(
"had a pc of 0x%" PRIx64
" which is not in executable "
413 "memory but on frame 1 -- "
421 UnwindLogMsg(
"pc is in a non-executable section of memory and this "
422 "isn't the 2nd frame in the stack walk.");
463 (permissions & ePermissionsReadable) == 0) {
466 "the CFA points to a region of memory that is not readable");
470 UnwindLogMsg(
"could not find a row for function offset zero");
478 UnwindLogMsg(
"same CFA address as next frame, assuming the unwind is "
479 "looping - stopping");
485 UnwindLogMsg(
"initialized frame cfa is 0x%" PRIx64
" afa is 0x%" PRIx64,
490 UnwindLogMsg(
"could not find any symbol for this pc, or a default unwind "
491 "plan, to continue unwind.");
499 UnwindLogMsg(
"with pc value of 0x%" PRIx64
", symbol name is '%s'",
pc,
502 UnwindLogMsg(
"with pc value of 0x%" PRIx64
", function name is '%s'",
pc,
506 ", no symbol/function name is known.",
510 bool decr_pc_and_recompute_addr_range;
514 decr_pc_and_recompute_addr_range =
true;
519 decr_pc_and_recompute_addr_range =
false;
526 decr_pc_and_recompute_addr_range =
false;
528 decr_pc_and_recompute_addr_range =
true;
534 decr_pc_and_recompute_addr_range =
false;
536 decr_pc_and_recompute_addr_range =
false;
539 decr_pc_and_recompute_addr_range =
true;
548 if (decr_pc_and_recompute_addr_range) {
550 " by 1 and re-doing symbol lookup; old symbol was %s",
568 if (decr_pc_and_recompute_addr_range &&
599 if (lang_runtime_plan_sp.get()) {
602 row_register_kind = lang_runtime_plan_sp->GetRegisterKind();
610 active_row->Dump(active_row_strm, lang_runtime_plan_sp.get(), &
m_thread,
616 "initialized async frame current pc is 0x%" PRIx64
617 " cfa is 0x%" PRIx64
" afa is 0x%" PRIx64,
638 if (active_row.get() && log) {
653 if (active_row.get() && log) {
665 if (!active_row.get()) {
684 UnwindLogMsg(
"same CFA address as next frame, assuming the unwind is "
685 "looping - stopping");
691 UnwindLogMsg(
"initialized frame current pc is 0x%" PRIx64
692 " cfa is 0x%" PRIx64
" afa is 0x%" PRIx64,
715 next_frame->GetNextFrame();
717 if (next_next_frame && next_next_frame->GetCFA(next_next_frame_cfa)) {
718 if (next_next_frame_cfa ==
m_cfa) {
749 UnwindPlanSP unwind_plan_sp;
753 pc_module_sp->GetObjectFile() ==
nullptr)
754 return unwind_plan_sp;
757 return unwind_plan_sp;
759 FuncUnwindersSP func_unwinders_sp(
760 pc_module_sp->GetUnwindTable().GetFuncUnwindersContainingAddress(
762 if (!func_unwinders_sp)
763 return unwind_plan_sp;
768 return unwind_plan_sp;
770 unwind_plan_sp = func_unwinders_sp->GetUnwindPlanFastUnwind(
772 if (unwind_plan_sp) {
775 return unwind_plan_sp;
777 unwind_plan_sp.reset();
780 return unwind_plan_sp;
793 UnwindPlanSP unwind_plan_sp;
794 UnwindPlanSP arch_default_unwind_plan_sp;
797 ABI *abi = process ? process->
GetABI().get() :
nullptr;
799 arch_default_unwind_plan_sp =
804 "unable to get architectural default UnwindPlan from ABI plugin");
829 if (current_pc_addr == 0 ||
832 (permissions & ePermissionsExecutable) == 0)) {
838 return unwind_plan_sp;
846 pc_module_sp->GetObjectFile() ==
nullptr) {
848 return arch_default_unwind_plan_sp;
851 FuncUnwindersSP func_unwinders_sp;
854 pc_module_sp->GetUnwindTable().GetFuncUnwindersContainingAddress(
863 if (!func_unwinders_sp) {
866 if (!pc_module_sp || !pc_module_sp->GetObjectFile() ||
868 return arch_default_unwind_plan_sp;
873 pc_module_sp->GetUnwindTable().GetEHFrameInfo();
877 return unwind_plan_sp;
879 unwind_plan_sp.reset();
883 pc_module_sp->GetUnwindTable().GetArmUnwindInfo();
888 return unwind_plan_sp;
890 unwind_plan_sp.reset();
894 pc_module_sp->GetUnwindTable().GetObjectFileUnwindInfo();
895 if (object_file_unwind) {
898 return unwind_plan_sp;
900 unwind_plan_sp.reset();
903 return arch_default_unwind_plan_sp;
914 unwind_plan_sp = platform->GetTrapHandlerUnwindPlan(
919 return unwind_plan_sp;
923 func_unwinders_sp->GetEHFrameUnwindPlan(process->
GetTarget());
926 func_unwinders_sp->GetObjectFileUnwindPlan(process->
GetTarget());
927 if (unwind_plan_sp && unwind_plan_sp->PlanValidAtAddress(
m_current_pc) &&
928 unwind_plan_sp->GetSourcedFromCompiler() ==
eLazyBoolYes) {
929 return unwind_plan_sp;
948 func_unwinders_sp->GetEHFrameUnwindPlan(process->
GetTarget());
951 func_unwinders_sp->GetObjectFileUnwindPlan(process->
GetTarget());
952 if (unwind_plan_sp && unwind_plan_sp->PlanValidAtAddress(
m_current_pc)) {
954 "DynamicLoader suggested we prefer it",
955 unwind_plan_sp->GetSourceName().GetCString());
956 return unwind_plan_sp;
963 unwind_plan_sp = func_unwinders_sp->GetUnwindPlanAtNonCallSite(
965 if (unwind_plan_sp && unwind_plan_sp->PlanValidAtAddress(
m_current_pc)) {
966 if (unwind_plan_sp->GetSourcedFromCompiler() ==
eLazyBoolNo) {
978 UnwindPlanSP call_site_unwind_plan =
979 func_unwinders_sp->GetUnwindPlanAtCallSite(process->
GetTarget(),
981 if (call_site_unwind_plan &&
982 call_site_unwind_plan.get() != unwind_plan_sp.get() &&
983 call_site_unwind_plan->GetSourceName() !=
984 unwind_plan_sp->GetSourceName()) {
991 "is the non-call site unwind plan and this is a "
993 unwind_plan_sp->GetSourceName().GetCString());
994 return unwind_plan_sp;
1002 func_unwinders_sp->GetUnwindPlanArchitectureDefaultAtFunctionEntry(
1004 if (unwind_plan_sp) {
1006 "the first instruction of a function",
1007 unwind_plan_sp->GetSourceName().GetCString());
1008 return unwind_plan_sp;
1016 unwind_plan_sp = func_unwinders_sp->GetUnwindPlanAtCallSite(
1021 "is the call-site unwind plan",
1022 unwind_plan_sp->GetSourceName().GetCString());
1023 return unwind_plan_sp;
1030 unwind_plan_sp = func_unwinders_sp->GetUnwindPlanAtNonCallSite(
1033 if (unwind_plan_sp &&
1034 unwind_plan_sp->GetSourcedFromCompiler() ==
eLazyBoolNo) {
1045 UnwindPlanSP call_site_unwind_plan =
1046 func_unwinders_sp->GetUnwindPlanAtCallSite(process->
GetTarget(),
1048 if (call_site_unwind_plan &&
1049 call_site_unwind_plan.get() != unwind_plan_sp.get() &&
1050 call_site_unwind_plan->GetSourceName() !=
1051 unwind_plan_sp->GetSourceName()) {
1060 "failed to find a call-site unwind plan that would work",
1061 unwind_plan_sp->GetSourceName().GetCString());
1062 return unwind_plan_sp;
1067 if (arch_default_unwind_plan_sp)
1069 "frame uses %s for full UnwindPlan because we are falling back "
1070 "to the arch default plan",
1071 arch_default_unwind_plan_sp->GetSourceName().GetCString());
1074 "Unable to find any UnwindPlan for full unwind of this frame.");
1076 return arch_default_unwind_plan_sp;
1110 bool success =
false;
1112 switch (regloc.
type) {
1114 const RegisterInfo *other_reg_info =
1117 if (!other_reg_info)
1124 const RegisterInfo *other_reg_info =
1127 if (!other_reg_info)
1134 success =
GetNextFrame()->ReadRegister(other_reg_info, value);
1145 llvm_unreachable(
"FIXME debugger inferior function call unwind");
1150 success =
error.Success();
1153 llvm_unreachable(
"Unknown RegisterLocation type.");
1164 bool success =
false;
1166 switch (regloc.
type) {
1168 const RegisterInfo *other_reg_info =
1174 const RegisterInfo *other_reg_info =
1180 success =
GetNextFrame()->WriteRegister(other_reg_info, value);
1187 llvm_unreachable(
"FIXME debugger inferior function call unwind");
1192 success =
error.Success();
1195 llvm_unreachable(
"Unknown RegisterLocation type.");
1231 const std::vector<ConstString> trap_handler_names(
1232 platform_sp->GetTrapHandlerSymbolNames());
1240 const std::vector<ConstString> user_specified_trap_handler_names(
1242 for (
ConstString name : user_specified_trap_handler_names) {
1268 regloc = iterator->second;
1269 UnwindLogMsg(
"supplying caller's saved %s (%d)'s location, cached",
1278 bool have_unwindplan_regloc =
false;
1286 UnwindLogMsg(
"could not convert lldb regnum %s (%d) into %d RegisterKind "
1287 "reg numbering scheme",
1289 (
int)unwindplan_registerkind);
1300 if (active_row->GetRegisterInfo(regnum.
GetAsKind(unwindplan_registerkind),
1301 unwindplan_regloc) &&
1304 "supplying caller's saved %s (%d)'s location using FastUnwindPlan",
1306 have_unwindplan_regloc =
true;
1310 if (!have_unwindplan_regloc) {
1313 bool got_new_full_unwindplan =
false;
1316 got_new_full_unwindplan =
true;
1328 if (got_new_full_unwindplan && active_row.get() && log) {
1343 if (pc_regnum.
IsValid() && pc_regnum == regnum &&
1353 active_row->GetRegisterInfo
1354 (pc_regnum.
GetAsKind (unwindplan_registerkind), scratch)) {
1355 UnwindLogMsg(
"Providing pc register instead of rewriting to "
1356 "RA reg because this is a trap handler and there is "
1357 "a location for the saved pc register value.");
1359 return_address_reg.
init(
1362 regnum = return_address_reg;
1363 UnwindLogMsg(
"requested caller's saved PC but this UnwindPlan uses a "
1364 "RA reg; getting %s (%d) instead",
1371 UnwindLogMsg(
"could not convert lldb regnum %s (%d) into "
1372 "eRegisterKindGeneric reg numbering scheme",
1375 UnwindLogMsg(
"could not convert lldb regnum %s (%d) into %d "
1376 "RegisterKind reg numbering scheme",
1378 (
int)unwindplan_registerkind);
1385 active_row->GetRegisterInfo(regnum.
GetAsKind(unwindplan_registerkind),
1386 unwindplan_regloc)) {
1387 have_unwindplan_regloc =
true;
1389 "supplying caller's saved %s (%d)'s location using %s UnwindPlan",
1398 if (!have_unwindplan_regloc && return_address_reg.
IsValid() &&
1408 regloc = new_regloc;
1409 UnwindLogMsg(
"supplying caller's register %s (%d) from the live "
1410 "RegisterContext at frame 0, saved in %d",
1437 if (arch_default_ra_regnum.
GetAsKind(unwindplan_registerkind) !=
1441 arch_default_ra_regnum.
GetAsKind(unwindplan_registerkind) &&
1444 UnwindLogMsg(
"%s UnwindPlan tried to restore the pc from the link "
1445 "register but this is a non-zero frame",
1460 bool can_fetch_pc_value =
false;
1461 bool can_fetch_cfa =
false;
1464 if (arch_default_pc_reg.
GetAsKind(unwindplan_registerkind) !=
1466 active_row->GetRegisterInfo(
1467 arch_default_pc_reg.
GetAsKind(unwindplan_registerkind),
1468 unwindplan_regloc)) {
1469 can_fetch_pc_value =
true;
1472 active_row->GetCFAValue(), cfa_value)) {
1473 can_fetch_cfa =
true;
1477 have_unwindplan_regloc = can_fetch_pc_value && can_fetch_cfa;
1480 have_unwindplan_regloc =
false;
1488 if (!have_unwindplan_regloc) {
1493 ABI *abi = process ? process->
GetABI().get() :
nullptr;
1495 const RegisterInfo *reg_info =
1500 "supplying caller's saved %s (%d)'s location using ABI default",
1502 have_unwindplan_regloc =
true;
1507 if (!have_unwindplan_regloc) {
1516 regloc = new_regloc;
1517 UnwindLogMsg(
"supplying caller's register %s (%d) from the live "
1518 "RegisterContext at frame 0",
1522 std::string unwindplan_name;
1524 unwindplan_name +=
"via '";
1526 unwindplan_name +=
"'";
1530 unwindplan_name.c_str());
1540 UnwindLogMsg(
"save location for %s (%d) is unspecified, continue searching",
1547 "did not supply reg location for %s (%d) because it is volatile",
1552 if (unwindplan_regloc.
IsSame()) {
1556 UnwindLogMsg(
"register %s (%d) is marked as 'IsSame' - it is a pc or "
1557 "return address reg on a non-zero frame -- treat as if we "
1558 "have no information",
1566 "supplying caller's register %s (%d), saved in register %s (%d)",
1574 int offset = unwindplan_regloc.
GetOffset();
1578 UnwindLogMsg(
"supplying caller's register %s (%d), value is CFA plus "
1579 "offset %d [value is 0x%" PRIx64
"]",
1586 int offset = unwindplan_regloc.
GetOffset();
1590 UnwindLogMsg(
"supplying caller's register %s (%d) from the stack, saved at "
1591 "CFA plus offset %d [saved at 0x%" PRIx64
"]",
1601 int offset = unwindplan_regloc.
GetOffset();
1605 UnwindLogMsg(
"supplying caller's register %s (%d), value is AFA plus "
1606 "offset %d [value is 0x%" PRIx64
"]",
1616 int offset = unwindplan_regloc.
GetOffset();
1620 UnwindLogMsg(
"supplying caller's register %s (%d) from the stack, saved at "
1621 "AFA plus offset %d [saved at 0x%" PRIx64
"]",
1632 UnwindLogMsg(
"could not supply caller's %s (%d) location - was saved in "
1633 "another reg but couldn't convert that regnum",
1641 "supplying caller's register %s (%d), saved in register %s (%d)",
1653 ModuleSP opcode_ctx;
1656 unwindplan_registerkind);
1661 if (dwarfexpr.
Evaluate(&exe_ctx,
this, 0, &cfa_val,
nullptr, result,
1669 UnwindLogMsg(
"supplying caller's register %s (%d) via DWARF expression "
1670 "(IsDWARFExpression)",
1678 UnwindLogMsg(
"supplying caller's register %s (%d) via DWARF expression "
1679 "(IsAtDWARFExpression)",
1684 UnwindLogMsg(
"tried to use IsDWARFExpression or IsAtDWARFExpression for %s "
1690 UnwindLogMsg(
"no save location for %s (%d) in this stack frame",
1747 const RegisterInfo *reg_info =
1754 if (ABISP abi = process_sp->GetABI())
1755 old_caller_pc_value = abi->FixCodeAddress(old_caller_pc_value);
1787 active_row->GetCFAValue().GetValueType() !=
1791 active_row->GetCFAValue(), new_cfa) ||
1793 UnwindLogMsg(
"failed to get cfa with fallback unwindplan");
1801 active_row->GetAFAValue(),
m_afa);
1806 const RegisterInfo *reg_info =
1814 if (ABISP abi = process_sp->GetABI())
1815 new_caller_pc_value = abi->FixCodeAddress(new_caller_pc_value);
1822 UnwindLogMsg(
"failed to get a pc value for the caller frame with the "
1823 "fallback unwind plan");
1831 if (old_caller_pc_value == new_caller_pc_value &&
1834 UnwindLogMsg(
"fallback unwind plan got the same values for this frame "
1835 "CFA and caller frame pc, not using");
1841 UnwindLogMsg(
"trying to unwind from this function with the UnwindPlan '%s' "
1842 "because UnwindPlan '%s' failed.",
1844 original_full_unwind_plan_sp->GetSourceName().GetCString());
1872 active_row->GetCFAValue().GetValueType() !=
1876 active_row->GetCFAValue(), new_cfa) ||
1878 UnwindLogMsg(
"failed to get cfa with fallback unwindplan");
1884 active_row->GetAFAValue(),
m_afa);
1895 UnwindLogMsg(
"switched unconditionally to the fallback unwindplan %s",
1903 lldb::UnwindPlanSP unwind_plan) {
1904 if (unwind_plan->GetUnwindPlanForSignalTrap() !=
eLazyBoolYes) {
1928 UnwindLogMsg(
"Resetting current offset and re-doing symbol lookup; "
1929 "old symbol was %s",
1962 const RegisterInfo *reg_info =
1967 reg_info, cfa_reg_contents, reg_info->byte_size, reg_value);
1968 if (
error.Success()) {
1971 address = abi_sp->FixCodeAddress(address);
1973 "CFA value via dereferencing reg %s (%d): reg has val 0x%" PRIx64
1974 ", CFA value is 0x%" PRIx64,
1976 cfa_reg_contents, address);
1980 "] but memory read failed.",
1993 cfa_reg_contents == 1) {
1995 "Got an invalid CFA register value - reg %s (%d), value 0x%" PRIx64,
2001 address = cfa_reg_contents + fa.
GetOffset();
2003 "CFA is 0x%" PRIx64
": Register %s (%d) contents are 0x%" PRIx64
2018 ModuleSP opcode_ctx;
2024 if (dwarfexpr.
Evaluate(&exe_ctx,
this, 0,
nullptr,
nullptr, result,
2028 address = abi_sp->FixCodeAddress(address);
2030 UnwindLogMsg(
"CFA value set by DWARF expression is 0x%" PRIx64,
2034 UnwindLogMsg(
"Failed to set CFA value via DWARF expression: %s",
2043 const unsigned max_iterations = 256;
2044 for (
unsigned i = 0; i < max_iterations; ++i) {
2051 UnwindLogMsg(
"Cannot read memory at 0x%" PRIx64
": %s", candidate_addr,
2058 permissions & lldb::ePermissionsExecutable) {
2059 address = candidate_addr;
2060 UnwindLogMsg(
"Heuristically found CFA: 0x%" PRIx64, address);
2080 hint += plan_offset;
2083 if (!next->m_sym_ctx.module_sp || !next->m_sym_ctx.symbol)
2085 if (
auto expected_size =
2086 next->m_sym_ctx.module_sp->GetSymbolFile()->GetParameterStackSize(
2087 *next->m_sym_ctx.symbol))
2088 hint += *expected_size;
2091 llvm::toString(expected_size.takeError()).c_str());
2121 lldb_regnum = regnum;
2131 "Could not find RegisterInfo definition for lldb register number %d",
2147 bool pc_register =
false;
2168 if (ABISP abi = process_sp->GetABI())
2169 value = abi->FixCodeAddress(value);
2201 bool is_pc_regnum =
false;
2204 is_pc_regnum =
true;
2219 if (ABISP abi = process_sp->GetABI())
2220 value = abi->FixCodeAddress(reg_value);
2255 lldb::WritableDataBufferSP &data_sp) {
2261 const lldb::DataBufferSP &data_sp) {
2297 bool read_successfully =
ReadPC (start_pc);
2298 if (read_successfully)
2303 ABI *abi = process_sp->GetABI().get();
2308 return read_successfully;
2320 bool above_trap_handler =
false;
2323 above_trap_handler =
true;
2336 ABI *abi = process_sp->GetABI().get();
2342 above_trap_handler ==
false && (
pc == 0 ||
pc == 1));
2354 va_start(args, fmt);
2356 llvm::SmallString<0> logmsg;
2371 va_start(args, fmt);
2373 llvm::SmallString<0> logmsg;
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOGF(log,...)
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 lldb::addr_t FixCodeAddress(lldb::addr_t pc)
Some targets might use bits in a code address to indicate a mode switch.
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 ...
bool Evaluate(ExecutionContext *exe_ctx, RegisterContext *reg_ctx, lldb::addr_t func_load_addr, const Value *initial_value_ptr, const Value *object_address_ptr, Value &result, Status *error_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)
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
unsigned long long ULongLong(unsigned long long fail_value=0) 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
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
const Scalar & GetScalar() const
@ 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)
RegisterKind
Register numbering types.
@ eRegisterKindGeneric
insn ptr reg, stack ptr reg, etc not specific to any particular target
@ eRegisterKindLLDB
lldb's internal register numbers
union lldb_private::UnwindLLDB::RegisterLocation::@38 location
@ eRegisterInLiveRegisterContext
@ eRegisterSavedAtHostMemoryLocation
@ eRegisterSavedAtMemoryLocation
lldb::addr_t target_memory_location