Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include function argument names as part of "function-arguments" for introspector API #1175

Open
oliverchang opened this issue Aug 1, 2023 · 1 comment

Comments

@oliverchang
Copy link
Contributor

We discussed this offline, but it would be very nice to get the function arg names returned in /api/far-reach-but-low-coverage as part of the existing "function-arguments" value.

@DavidKorczynski
Copy link
Contributor

We extract this for C/C++ in the frontend

FuncWrap.ArgNames.push_back(A.getName().str());

However, when expecting the output the values are all empty strings. It could be this is gone at the point we extract them. I need to investigate a bit more -- it may be we need to open up for a way to inspect these values at a different stage of the compilation process. Perhaps, we need to extract it from the source code itself, which we can do since we do know the location of the functions we're analysing.

DavidKorczynski added a commit that referenced this issue Aug 3, 2023
The current way we extract function names from arguments in LLVM is
rarely successful. This is because the names attached to the LLVM
Argument objects are empty, likely removed during the compilation
process. This adds an option for looking at debug information to spot
the right argument name.

Ref: #1175

Signed-off-by: David Korczynski <[email protected]>
AdamKorcz pushed a commit that referenced this issue Aug 3, 2023
* frontend: llvm: catch arg names using debug info

The current way we extract function names from arguments in LLVM is
rarely successful. This is because the names attached to the LLVM
Argument objects are empty, likely removed during the compilation
process. This adds an option for looking at debug information to spot
the right argument name.

Ref: #1175

Signed-off-by: David Korczynski <[email protected]>

* nit

Signed-off-by: David Korczynski <[email protected]>

* output argNames to summary.json

Signed-off-by: David Korczynski <[email protected]>

---------

Signed-off-by: David Korczynski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants