| 394 | #define S(x) (int)(x),SS(x) |
| 395 | |
| 396 | static void PrintHeader(const Proto* f) |
| 397 | { |
| 398 | const char* s=f->source ? getstr(f->source) : "=?"; |
| 399 | if (*s=='@' || *s=='=') |
| 400 | s++; |
| 401 | else if (*s==LUA_SIGNATURE[0]) |
| 402 | s="(bstring)"; |
| 403 | else |
| 404 | s="(string)"; |
| 405 | printf("\n%s <%s:%d,%d> (%d instruction%s at %p)\n", |
| 406 | (f->linedefined==0)?"main":"function",s, |
| 407 | f->linedefined,f->lastlinedefined, |
| 408 | S(f->sizecode),VOID(f)); |
| 409 | printf("%d%s param%s, %d slot%s, %d upvalue%s, ", |
| 410 | (int)(f->numparams),f->is_vararg?"+":"",SS(f->numparams), |
| 411 | S(f->maxstacksize),S(f->sizeupvalues)); |
| 412 | printf("%d local%s, %d constant%s, %d function%s\n", |
| 413 | S(f->sizelocvars),S(f->sizek),S(f->sizep)); |
| 414 | } |
| 415 | |
| 416 | static void PrintDebug(const Proto* f) |
| 417 | { |