[Lldb-commits] [PATCH] Fix selecting the Platform in TargetList::CreateTargetInternal()

Ted Woodward ted.woodward at codeaurora.org
Tue Mar 31 15:36:45 PDT 2015

It should use the current Platform, but only if it is compatible with the target's architecture, right? I believe it does this already, because any change of platform_sp is gated by if(platform_sp->IsCompatibleArchitecture()).

What I'm trying to solve with this is the case where the Host Platform isn't compatible with the target - for example, LLDB built on Linux, but loading a Windows binary:

(lldb) target list
Current targets:

  target #0: /usr2/tedwood/lldb_test/infinite_win_x86 ( arch=x86_64-pc-windows-msvc, platform=host )

- target #1: /usr2/tedwood/lldb_test/infinite_x86.elf ( arch=x86_64-unknown-linux, platform=host )

platform=host is incorrect for target 0, but correct for target 1. Since LLDB on Linux comes up with the host (Linux) platform selected, platform_sp is valid and a new platform will never be selected, even though the Linux platform isn't compatible with x86_64-pc-windows.



More information about the lldb-commits mailing list