Skip to content

Commit b1f5e26

Browse files
GeorgeHuyuboGeorge Hu
andauthored
[lldb] Properly handle locate module callback when Target change arch (#143793)
Since this PR: #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 <[email protected]>
1 parent c19e900 commit b1f5e26

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lldb/source/Target/Target.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,6 +1706,8 @@ bool Target::SetArchitecture(const ArchSpec &arch_spec, bool set_platform,
17061706
if (PlatformSP arch_platform_sp =
17071707
GetDebugger().GetPlatformList().GetOrCreate(other, {},
17081708
&platform_arch)) {
1709+
arch_platform_sp->SetLocateModuleCallback(
1710+
platform_sp->GetLocateModuleCallback());
17091711
SetPlatform(arch_platform_sp);
17101712
if (platform_arch.IsValid())
17111713
other = platform_arch;

0 commit comments

Comments
 (0)