[Lldb-commits] [PATCH] D53753: [Windows] Define generic arguments registers for Windows x64
Aleksandr Urakov via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu May 16 05:44:24 PDT 2019
aleksandr.urakov added a comment.
In D53753#1504589 <https://reviews.llvm.org/D53753#1504589>, @labath wrote:
> When we evaluate an expression, we jit a bunch of opcodes into the inferior memory and then have it execute them. For that to work, we need to allocate some memory in order to store the opcodes. We cannot use the general expression engine to jit that expression, as we would be back to square one, so we manually set the PC to the entry point of the mmap function, and set the argument values as if it was being called. Then we just let the inferior loose and have it allocate the memory for us and return it. For this to work, we need abi knowledge both to correctly set the arguments of mmap, and to retrieve its result.
Got it, thanks! There's a different approach on Windows: for now we just call `VirtualAllocEx`, which can allocate memory in another process. But it will not work for the remote debugging case.
CHANGES SINCE LAST ACTION
More information about the lldb-commits