static qcint prog_enterfunction(qc_program *prog, prog_section_function *func)
{
qc_exec_stack st;
- size_t p, parampos;
+ size_t parampos;
+ int32_t p;
/* back up locals */
st.localsp = vec_size(prog->localstack);
size_t xflags = VMXF_DEFAULT;
bool opts_printfields = false;
bool opts_printdefs = false;
+ bool opts_printfuns = false;
bool opts_disasm = false;
bool opts_info = false;
++argv;
opts_printdefs = true;
}
+ else if (!strcmp(argv[1], "-printfuns")) {
+ --argc;
+ ++argv;
+ opts_printfuns = true;
+ }
else if (!strcmp(argv[1], "-printfields")) {
--argc;
++argv;
(unsigned int)prog->fields[i].offset);
}
}
+ else if (opts_printfuns) {
+ for (i = 0; i < vec_size(prog->functions); ++i) {
+ int32_t a;
+ printf("Function: %-16s taking %i parameters:",
+ prog_getstring(prog, prog->functions[i].name),
+ (unsigned int)prog->functions[i].nargs);
+ for (a = 0; a < prog->functions[i].nargs; ++a) {
+ printf(" %i", prog->functions[i].argsize[a]);
+ }
+ printf("\n");
+ }
+ }
else
{
if (fnmain > 0)
uint32_t profile; /* Always zero (engine uses this) */
uint32_t name; /* name of function in string table */
uint32_t file; /* file of the source file */
- uint32_t nargs; /* number of arguments */
+ int32_t nargs; /* number of arguments */
uint8_t argsize[8]; /* size of arguments (keep 8 always?) */
} prog_section_function;