labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

In D155117#4510512 <https://reviews.llvm.org/D155117#4510512>, @ted wrote:

> In D155117#4505538 <https://reviews.llvm.org/D155117#4505538>, @labath wrote:
>
>> I am wondering if we actually need the second step (the architecture 
>> setting) here. The main reason it exists is the usage in 
>> `GetSupportedArchitectures` (which is called before a target is created) it 
>> seems like the value derived from the target should always be more correct. 
>> WDYT? What are the values you get in steps 2 and 3 for your use case?
>
> I don't think we need to specify the architecture, because I think we can 
> always get it from the triple. There might be a case where someone is using a 
> qemu that isn't named the same as the Triple ArchName, but that case could be 
> covered by emulator-path.

Yeah, that's my thinking as well. Given this, I think we should drop the 
setting part and just go with the target value directly.

In D155117#4511968 <https://reviews.llvm.org/D155117#4511968>, @ted wrote:

> As for the GetSupportedArchitectures case, downstream I left in the code that 
> checks the property, but changed the return {}; to
>
>   return {ArchSpec(llvm::Triple("riscv32-unknown-linux")),
>           ArchSpec(llvm::Triple("riscv64-unknown-linux"))};
>
> I don't think we want that upstream, but downstream the only time we're 
> targetting riscv linux is when using qemu.
>
> That lets me run lldb, load a riscv file, then run, without setting any 
> properties.

FWIW, the way we do that is by putting something along the lines of:

  settings set platform.plugin.qemu-user.architecture aarch64
  ...
  platform select qemu-user
  platform select host

into our global lldbinit file. This causes lldb's platform selection logic to 
pick qemu-user (instead of remote-linux) when encountering an aarch64 
executable, without needing to change the source code.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155117/new/

https://reviews.llvm.org/D155117

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to