[Lldb-commits] [lldb] [lldb] fix step in AArch64 trampoline (PR #90783)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu May 2 01:44:20 PDT 2024


================
@@ -506,9 +506,29 @@ DynamicLoaderPOSIXDYLD::GetStepThroughTrampolinePlan(Thread &thread,
   Target &target = thread.GetProcess()->GetTarget();
   const ModuleList &images = target.GetImages();
 
-  images.FindSymbolsWithNameAndType(sym_name, eSymbolTypeCode, target_symbols);
-  if (!target_symbols.GetSize())
-    return thread_plan_sp;
+  llvm::StringRef target_name = sym_name.GetStringRef();
+  // On AArch64, the trampoline name has a prefix (__AArch64ADRPThunk_ or
+  // __AArch64AbsLongThunk_) added to the function name. If we detect a
+  // trampoline with the prefix, we need to remove the prefix to find the
+  // function symbol.
+  if (target_name.consume_front("__AArch64ADRPThunk_")) {
----------------
labath wrote:

How about `if (target_name.consume_front("__AArch64ADRPThunk_") || target_name.consume_front("__AArch64AbsLongThunk_"))`

https://github.com/llvm/llvm-project/pull/90783


More information about the lldb-commits mailing list