@@ -2807,10 +2807,12 @@ std::optional<lldb::addr_t> SwiftLanguageRuntime::TrySkipVirtualParentProlog(
28072807 // Get the PC of the parent frame, i.e. the continuation pointer, which is
28082808 // the second field of the CFA.
28092809 addr_t pc_location = cfa + ptr_size;
2810- addr_t pc_value = LLDB_INVALID_ADDRESS;
2811- process.ReadMemory (pc_location, &pc_value, ptr_size, error);
2810+ addr_t pc_value = process.ReadPointerFromMemory (pc_location, error);
28122811 if (error.Fail ())
28132812 return {};
2813+ // Clear any high order bits of this code address so that SetLoadAddress works
2814+ // properly.
2815+ pc_value = process.FixCodeAddress (pc_value);
28142816
28152817 Address pc;
28162818 Target &target = process.GetTarget ();
@@ -2819,11 +2821,16 @@ std::optional<lldb::addr_t> SwiftLanguageRuntime::TrySkipVirtualParentProlog(
28192821 return {};
28202822
28212823 SymbolContext sc;
2822- if (!pc.CalculateSymbolContext (&sc,
2823- eSymbolContextFunction | eSymbolContextSymbol))
2824- return {};
2825- if (!sc.symbol && !sc.function )
2824+ bool sc_ok = pc.CalculateSymbolContext (&sc, eSymbolContextFunction |
2825+ eSymbolContextSymbol);
2826+ if (!sc_ok || (!sc.symbol && !sc.function )) {
2827+ Log *log = GetLog (LLDBLog::Unwind);
2828+ LLDB_LOGF (log,
2829+ " SwiftLanguageRuntime::%s Failed to find a symbol context for "
2830+ " address 0x%" PRIx64,
2831+ __FUNCTION__, pc_value);
28262832 return {};
2833+ }
28272834
28282835 auto prologue_size = sc.symbol ? sc.symbol ->GetPrologueByteSize ()
28292836 : sc.function ->GetPrologueByteSize ();
0 commit comments