[PATCH] D53753: [Windows] Define generic arguments registers for Windows x64

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 02:34:17 PDT 2019


labath added a comment.

In D53753#1504320 <https://reviews.llvm.org/D53753#1504320>, @aleksandr.urakov wrote:

> @lanza Hello! AFAIU, these values have nothing to do with the Microsoft x64 calling convention. They are used by `ABISysV_x86_64`, which specifies ABI for working with code injectable into a process being debugged. It requires six arguments to be passed through registers (see `GetArgumentValues`).
>
> If I understand right, `SymbolFile` retrieves the information about arguments location on the stack, so there's no need to support different calling conventions in LLDB for this purpose. Please, correct me if I'm wrong.


That definitely doesn't sound right. The reason ABISysV_x86_64 requires 6 registers is because the "SysV" x86_64 ABI specifies 6 argument registers. If the microsoft ABI is different, then you probably need a new ABI plugin to correctly describe it. (Also, we use the abi plugin to call mmap, and mmap takes 6 arguments).

I'm not sure what exactly are the consequences of not using the correct ABI definition here. I think the case where the difference may start to become obvious is if you try to get argument values of a function for which you don't have debug info for. Probably the reason that expression evaluation works for you is that we only ever pass one argument into the generated expression (by arranging all inputs into a struct and then passing the struct pointer as an argument), and the first register argument happens to be the same for SysV and microsoft ABIs.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D53753





More information about the llvm-commits mailing list