Skip to content

LLDB should have an API that returns if LLDB_REGNUM_GENERIC_ARGX registers can be used to get function call arguments #168602

@delcypher

Description

@delcypher

In swiftlang#11835 an instrumentation plugin is being added that inspects the LLDB_REGNUM_GENERIC_ARG register when stopped at a breakpoint set on a function call. The instrumentation plugin reads from the register to find the value of the argument passed to the function call. It can do this because the plugin knows the signature of the function ahead of time.

However, it is a little bit hacky because not all target+calling convention combination will pass the first argument in a function call via LLDB_REGNUM_GENERIC_ARG. For example for x86 (32-bit) some calling conventions do not use the eax register.

Ideally LLDB would have an API that would that would state if LLDB_REGNUM_GENERIC_ARGN can be used to get the Nth argument. I'm not sure how feasible this is in all situations because I don't know how LLDB would know which calling convention is being used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions