mstorsjo added a comment.

In D127048#3559866 <https://reviews.llvm.org/D127048#3559866>, @DavidSpickett 
wrote:

>> This changes the PE/COFF and PDB plugins to set the module triple according 
>> to the default target triple used to build LLDB.
>
> I'm missing some context here but using triple used when *building* lldb 
> seems to conflict with the idea that the same lldb (client at least) can be 
> used to debug many architectures.

Yes, that's true. The idea here is that when doing local debugging in either 
the mingw or msvc ecosystems, the flavour of the lldb build itself could be a 
decent hint - but it's not indeed not a correct and faultproof fix.

> Or is this not a concern because remote debugging is not a thing for Windows? 
> For instance, is it possible that I'm on Linux with some AArch64 linux 
> targeted lldb trying to remote debug a windows system. If the default triple 
> is the best signal you've got then fair enough I guess just wanted to check 
> there wasn't some more dynamic way to get it.
>
> And I assume PE/COFF have no embedded flag in them to indicate this ABI?

No, there's no flag for that. Mingw and MSVC environment binaries are quite the 
same.

(Qt Creator tries to do some similar heuristics to guess which ABI a binary 
uses, by looking at e.g. linker version numbers in the binary, to deduce 
whether a binary has been linked with GNU ld.bfd or MS link.exe - but when it 
comes to LLD, that logic falls apart. A more complex heuristic that can be used 
is e.g. looking at the list of DLLs that a binary links against, but that's 
also much more complex and also not entirely faultproof.)

@alvinhochun has got another patch in progress - 
https://reviews.llvm.org/D127053 (which isn't yet submitted for review as it 
lacks tests), which tries to decude the same based on whether a binary contains 
dwarf debug info.

That's more fault proof, but is also not an entirely complete fix - while 
finding dwarf debug sections mostly can imply using the itanium C++ ABI, you 
can also use PDB files with itanium C++ ABI (i.e. in mingw setups). It's less 
common but still a viable scenario. And reversely, I think I've heard about 
special cases where people use dwarf debug info with MSVC-ecosystem builds 
too...

So in short, what would be needed is a good enough heuristic that works for the 
vast majority of cases, and an option that lets users specify it for the cases 
that can't easily be autodetected.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127048

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

Reply via email to