Add check for number of arguments
authorBrenden Blanco <bblanco@plumgrid.com>
Thu, 5 May 2016 18:37:59 +0000 (11:37 -0700)
committerBrenden Blanco <bblanco@plumgrid.com>
Thu, 5 May 2016 18:47:29 +0000 (11:47 -0700)
commit977091ec495120b79476a0d319bb109542205dee
treeda03dcd6084b81e5e5610d8ce474fc1a854ca4cf
parent86b819a3025f6e937cdbe8e75883e97336048721
Add check for number of arguments

There are two problems here:
 1. bcc is leaving the extra function parameters in the prototype, when
 these really just serve as an annotation on the method being traced.
 They aren't really passed into the function. LLVM lowering phase later
 errors out on such functions.
 2. bcc doesn't limit the size of the argument list, when currently it
 just supports up to the number of arguments held in registers (6).

Fix 1. by rewriting the arguments out of the prototype and into the
preamble where they are currently being initialized.
Fix 2. by enforcing the limit and returning a more meaningful error
message.

Added a test case.

Extra fix included for string type on python3.

Fixes: #497
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
src/cc/frontends/clang/b_frontend_action.cc
tests/python/test_clang.py
tests/python/test_stackid.py