When compiling a C (I haven't tested other languages) function with more than 6 parameters on x86_64 (I haven't tested other architectures), its call_site will have at most 6 parameters, while the rest, which is stored on the stack (their DW_AT_location is DW_OP_fbreg), can only be seen as formal_parameters in the subprogram DIE.
I believe that this is a bug, since I can't find anything about this limitation in DWARF5 format.
Minimum example:
__attribute__((noinline)) void test(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) {
printf("%d %d %d %d %d %d %d %d\n", a1, a2, a3, a4, a5, a6, a7, a8);
}
int main(void) {
test(1,2,3,4,5,6,7,8);
return 0;
}
When compiling a C (I haven't tested other languages) function with more than 6 parameters on x86_64 (I haven't tested other architectures), its call_site will have at most 6 parameters, while the rest, which is stored on the stack (their DW_AT_location is DW_OP_fbreg), can only be seen as formal_parameters in the subprogram DIE.
I believe that this is a bug, since I can't find anything about this limitation in DWARF5 format.
Minimum example:
DWARF dump of subprogram:
Dump of call site: