| 376 | #define S(x) (int)(x),SS(x) |
| 377 | |
| 378 | static void PrintHeader(const Proto* f) |
| 379 | { |
| 380 | const char* s=f->source ? getstr(f->source) : "=?"; |
| 381 | if (*s=='@' || *s=='=') |
| 382 | s++; |
| 383 | else if (*s==LUA_SIGNATURE[0]) |
| 384 | s="(bstring)"; |
| 385 | else |
| 386 | s="(string)"; |
| 387 | printf("\n%s <%s:%d,%d> (%d instruction%s at %p)\n", |
| 388 | (f->linedefined==0)?"main":"function",s, |
| 389 | f->linedefined,f->lastlinedefined, |
| 390 | S(f->sizecode),VOID(f)); |
| 391 | printf("%d%s param%s, %d slot%s, %d upvalue%s, ", |
| 392 | (int)(f->numparams),f->is_vararg?"+":"",SS(f->numparams), |
| 393 | S(f->maxstacksize),S(f->sizeupvalues)); |
| 394 | printf("%d local%s, %d constant%s, %d function%s\n", |
| 395 | S(f->sizelocvars),S(f->sizek),S(f->sizep)); |
| 396 | } |
| 397 | |
| 398 | static void PrintDebug(const Proto* f) |
| 399 | { |