@@ -2807,10 +2807,12 @@ std::optional<lldb::addr_t> SwiftLanguageRuntime::TrySkipVirtualParentProlog(
2807
2807
// Get the PC of the parent frame, i.e. the continuation pointer, which is
2808
2808
// the second field of the CFA.
2809
2809
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);
2812
2811
if (error.Fail ())
2813
2812
return {};
2813
+ // Clear any high order bits of this code address so that SetLoadAddress works
2814
+ // properly.
2815
+ pc_value = process.FixCodeAddress (pc_value);
2814
2816
2815
2817
Address pc;
2816
2818
Target &target = process.GetTarget ();
@@ -2819,11 +2821,16 @@ std::optional<lldb::addr_t> SwiftLanguageRuntime::TrySkipVirtualParentProlog(
2819
2821
return {};
2820
2822
2821
2823
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);
2826
2832
return {};
2833
+ }
2827
2834
2828
2835
auto prologue_size = sc.symbol ? sc.symbol ->GetPrologueByteSize ()
2829
2836
: sc.function ->GetPrologueByteSize ();
0 commit comments