Files
clang-p2996/lldb/test/API/functionalities/unused-inlined-parameters/main.c
Jaroslav Sevcik 5a3556aa55 [lldb] Add omitted abstract formal parameters in DWARF symbol files
This patch fixes a problem introduced by clang change
https://reviews.llvm.org/D95617 and described by
https://bugs.llvm.org/show_bug.cgi?id=50076#c6, where inlined functions
omit unused parameters both in the stack trace and in `frame var`
command. With this patch, the parameters are listed correctly in the
stack trace and in `frame var` command.

Specifically, we parse formal parameters from the abstract version of
inlined functions and use those formal parameters if they are missing
from the concrete version.

Differential Revision: https://reviews.llvm.org/D110571
2021-10-21 12:33:42 +02:00

12 lines
266 B
C

#include <stdio.h>
__attribute__((optnone)) __attribute__((nodebug)) void use(int used) {}
__attribute__((always_inline)) void f(void *unused1, int used, int unused2) {
use(used); // break here
}
int main(int argc, char **argv) {
f(argv, 42, 1);
return 0;
}