diff options
| author | GeorgeHuyubo <113479859+GeorgeHuyubo@users.noreply.github.com> | 2025-06-12 13:23:26 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-12 13:23:26 -0700 |
| commit | b1f5e26b78a9550a22ee2f24bb3f220d396c452f (patch) | |
| tree | 1c64ddb21c36651406c1580c8ec621b502cd67d7 /lldb/source/Target/Target.cpp | |
| parent | c19e900ce8b422f6b8c028fbbd9ef7e9d3720236 (diff) | |
[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 <georgehuyubo@gmail.com>
Diffstat (limited to 'lldb/source/Target/Target.cpp')
| -rw-r--r-- | lldb/source/Target/Target.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index 9660fc97970b..45a9e1196a04 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; |
