Author: GeorgeHuyubo Date: 2025-06-12T13:23:26-07:00 New Revision: b1f5e26b78a9550a22ee2f24bb3f220d396c452f
URL: https://github.com/llvm/llvm-project/commit/b1f5e26b78a9550a22ee2f24bb3f220d396c452f DIFF: https://github.com/llvm/llvm-project/commit/b1f5e26b78a9550a22ee2f24bb3f220d396c452f.diff LOG: [lldb] Properly handle locate module callback when Target change arch (#143793) Since this PR: https://github.com/llvm/llvm-project/pull/141670/ We started to override the Platform/Arch for a target if needed. However we may have already registered locate module callback with the old platform. This PR will move the locate module callback to the new Platform whenever Target changes architecture. Co-authored-by: George Hu <georgehuy...@gmail.com> Added: Modified: lldb/source/Target/Target.cpp Removed: ################################################################################ diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index 9660fc97970b0..45a9e1196a049 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -1706,6 +1706,8 @@ bool Target::SetArchitecture(const ArchSpec &arch_spec, bool set_platform, if (PlatformSP arch_platform_sp = GetDebugger().GetPlatformList().GetOrCreate(other, {}, &platform_arch)) { + arch_platform_sp->SetLocateModuleCallback( + platform_sp->GetLocateModuleCallback()); SetPlatform(arch_platform_sp); if (platform_arch.IsValid()) other = platform_arch; _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits