[Lldb-commits] [PATCH] D127048: [lldb] Set COFF module ABI from default triple and make it an option

Martin Storsjö via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 8 00:42:26 PDT 2022


mstorsjo added a comment.

In D127048#3565557 <https://reviews.llvm.org/D127048#3565557>, @omjavaid wrote:

> I am not fully familiar with PE/COFF but lets try to get this merged. For starters I have a couple of questions here:
>
> 1. This rev apparently assumes x86_64 only but what about Arm/AArch64?

Where do you get that impression? This should all be architecture independent (or done in the same way for all architectures).

> 2. If we have DLLs what abi setting they ll follow the one set by the user or default which may be MSVC?

Here, all DLLs are expected to use the same ABI (either the implicit one based on the LLDB build). D127234 <https://reviews.llvm.org/D127234> is a follow-up that allows you to set a specific ABI choice per DLL.

> 3. Is there anything in PE/COFF header information that can serve is a good guess for the underlying ABI.

No, there's no such hint. It's possible to make heuristic guesses based on e.g. what DLLs they import, but it's all guesses, possibly brittle. Having an option allows you to get it right even for the cases where the default is wrong.

> 4. What more information can we get from debug info in this case? DWARF may not be a good guess as we can generate it for MSVC abi as well.

Exactly, one could use presence of DWARF as a heuristic hint for this, but it's not always right (you can use PDB for mingw uses too, and DWARF for msvc abi too in uncommon cases).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127048



More information about the lldb-commits mailing list