This will do that - platform_sp is the currently selected platform, and both calls to SetSelectedPlatform() are gated by !platform_sp->IsCompatibleArchitecture(), so it will only search for a new platform if the architecture is not compatible with the currently selected platform.
I took current top-of-tree and applied this patch, and built on Linux. Then I checked to see if lldb behaved as expected. First, I loaded /bin/ls, and checked the platform - host. Then I selected platform remote-linux, loaded /bin/ls, and checked the platform - remote-linux. Finally, I selected platform kalimba, loaded /bin/ls, and checked the platform - host. (lldb) target create /bin/ls Current executable set to '/bin/ls' (x86_64). (lldb) target list Current targets: - target #0: /bin/ls ( arch=x86_64-unknown-linux, platform=host ) (lldb) platform select remote-linux Platform: remote-linux Connected: no (lldb) target create /bin/ls Current executable set to '/bin/ls' (x86_64). (lldb) target list Current targets: target #0: /bin/ls ( arch=x86_64-unknown-linux, platform=host ) - target #1: /bin/ls ( arch=x86_64-unknown-linux, platform=remote-linux ) (lldb) platform select kalimba Platform: kalimba Connected: no (lldb) target create /bin/ls Current executable set to '/bin/ls' (x86_64). (lldb) target list Current targets: target #0: /bin/ls ( arch=x86_64-unknown-linux, platform=host ) target #1: /bin/ls ( arch=x86_64-unknown-linux, platform=remote-linux ) - target #2: /bin/ls ( arch=x86_64-unknown-linux, platform=host ) http://reviews.llvm.org/D8749 EMAIL PREFERENCES http://reviews.llvm.org/settings/panel/emailpreferences/ _______________________________________________ lldb-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
