Lines Matching +full:d +full:-
56 if (*message=='-') in usage()
63 " -l list (use -l -l for full listing)\n" in usage()
64 " -o name output to file 'name' (default is \"%s\")\n" in usage()
65 " -p parse only\n" in usage()
66 " -s strip debug information\n" in usage()
67 " -v show version information\n" in usage()
68 " -- stop handling options\n" in usage()
69 " - stop handling options and process stdin\n" in usage()
83 if (*argv[i]!='-') /* end of options; keep it */ in doargs()
85 else if (IS("--")) /* end of options; skip it */ in doargs()
91 else if (IS("-")) /* end of options; use stdin */ in doargs()
93 else if (IS("-l")) /* list */ in doargs()
95 else if (IS("-o")) /* output file */ in doargs()
98 if (output==NULL || *output==0 || (*output=='-' && output[1]!=0)) in doargs()
99 usage("'-o' needs argument"); in doargs()
100 if (IS("-")) output=NULL; in doargs()
102 else if (IS("-p")) /* parse only */ in doargs()
104 else if (IS("-s")) /* strip debug information */ in doargs()
106 else if (IS("-v")) /* show version */ in doargs()
114 argv[--i]=Output; in doargs()
119 if (version==argc-1) exit(EXIT_SUCCESS); in doargs()
129 if ((*(int*)ud)--) in reader()
131 *size=sizeof(FUNCTION)-1; in reader()
141 #define toproto(L,i) getproto(s2v(L->top.p+(i)))
146 return toproto(L,-1); in combine()
151 if (lua_load(L,reader,&i,"=(" PROGNAME ")",NULL)!=LUA_OK) fatal(lua_tostring(L,-1)); in combine()
152 f=toproto(L,-1); in combine()
155 f->p[i]=toproto(L,i-n-1); in combine()
156 if (f->p[i]->sizeupvalues>0) f->p[i]->upvalues[0].instack=0; in combine()
174 tmname=G(L)->tmname; in pmain()
178 const char* filename=IS("-") ? NULL : argv[i]; in pmain()
179 if (luaL_loadfile(L,filename)!=LUA_OK) fatal(lua_tostring(L,-1)); in pmain()
185 FILE* D= (output==NULL) ? stdout : fopen(output,"wb"); in pmain() local
186 if (D==NULL) cannot("open"); in pmain()
188 luaU_dump(L,f,writer,D,stripping); in pmain()
190 if (ferror(D)) cannot("write"); in pmain()
191 if (fclose(D)) cannot("close"); in pmain()
200 argc-=i; argv+=i; in main()
207 if (lua_pcall(L,2,0,0)!=LUA_OK) fatal(lua_tostring(L,-1)); in main()
216 #define UPVALNAME(x) ((f->upvalues[x].name) ? getstr(f->upvalues[x].name) : "-")
258 if (isprint(c)) printf("%c",c); else printf("\\%03d",c); in PrintString()
267 const TValue* o=&f->k[i]; in PrintType()
288 printf("?%d",ttypetag(o)); in PrintType()
296 const TValue* o=&f->k[i]; in PrintConstant()
313 if (buff[strspn(buff,"-0123456789")]=='\0') printf(".0"); in PrintConstant()
324 printf("?%d",ttypetag(o)); in PrintConstant()
336 const Instruction* code=f->code; in PrintCode()
337 int pc,n=f->sizecode; in PrintCode()
352 printf("\t%d\t",pc+1); in PrintCode()
353 if (line>0) printf("[%d]\t",line); else printf("[-]\t"); in PrintCode()
354 printf("%-9s\t",opnames[o]); in PrintCode()
358 printf("%d %d",a,b); in PrintCode()
361 printf("%d %d",a,sbx); in PrintCode()
364 printf("%d %d",a,sbx); in PrintCode()
367 printf("%d %d",a,bx); in PrintCode()
371 printf("%d",a); in PrintCode()
375 printf("%d",a); in PrintCode()
378 printf("%d",a); in PrintCode()
381 printf("%d",a); in PrintCode()
384 printf("%d %d",a,b); in PrintCode()
385 printf(COMMENT "%d out",b+1); in PrintCode()
388 printf("%d %d",a,b); in PrintCode()
392 printf("%d %d",a,b); in PrintCode()
396 printf("%d %d %d",a,b,c); in PrintCode()
401 printf("%d %d %d",a,b,c); in PrintCode()
404 printf("%d %d %d",a,b,c); in PrintCode()
407 printf("%d %d %d",a,b,c); in PrintCode()
411 printf("%d %d %d%s",a,b,c,ISK); in PrintCode()
417 printf("%d %d %d%s",a,b,c,ISK); in PrintCode()
421 printf("%d %d %d%s",a,b,c,ISK); in PrintCode()
425 printf("%d %d %d%s",a,b,c,ISK); in PrintCode()
430 printf("%d %d %d",a,b,c); in PrintCode()
431 printf(COMMENT "%d",c+EXTRAARGC); in PrintCode()
434 printf("%d %d %d%s",a,b,c,ISK); in PrintCode()
438 printf("%d %d %d",a,b,sc); in PrintCode()
441 printf("%d %d %d",a,b,c); in PrintCode()
445 printf("%d %d %d",a,b,c); in PrintCode()
449 printf("%d %d %d",a,b,c); in PrintCode()
453 printf("%d %d %d",a,b,c); in PrintCode()
457 printf("%d %d %d",a,b,c); in PrintCode()
461 printf("%d %d %d",a,b,c); in PrintCode()
465 printf("%d %d %d",a,b,c); in PrintCode()
469 printf("%d %d %d",a,b,c); in PrintCode()
473 printf("%d %d %d",a,b,c); in PrintCode()
477 printf("%d %d %d",a,b,c); in PrintCode()
481 printf("%d %d %d",a,b,sc); in PrintCode()
484 printf("%d %d %d",a,b,sc); in PrintCode()
487 printf("%d %d %d",a,b,c); in PrintCode()
490 printf("%d %d %d",a,b,c); in PrintCode()
493 printf("%d %d %d",a,b,c); in PrintCode()
496 printf("%d %d %d",a,b,c); in PrintCode()
499 printf("%d %d %d",a,b,c); in PrintCode()
502 printf("%d %d %d",a,b,c); in PrintCode()
505 printf("%d %d %d",a,b,c); in PrintCode()
508 printf("%d %d %d",a,b,c); in PrintCode()
511 printf("%d %d %d",a,b,c); in PrintCode()
514 printf("%d %d %d",a,b,c); in PrintCode()
517 printf("%d %d %d",a,b,c); in PrintCode()
520 printf("%d %d %d",a,b,c); in PrintCode()
523 printf("%d %d %d",a,b,c); in PrintCode()
527 printf("%d %d %d %d",a,sb,c,isk); in PrintCode()
532 printf("%d %d %d %d",a,b,c,isk); in PrintCode()
537 printf("%d %d",a,b); in PrintCode()
540 printf("%d %d",a,b); in PrintCode()
543 printf("%d %d",a,b); in PrintCode()
546 printf("%d %d",a,b); in PrintCode()
549 printf("%d %d",a,b); in PrintCode()
552 printf("%d",a); in PrintCode()
555 printf("%d",a); in PrintCode()
558 printf("%d",GETARG_sJ(i)); in PrintCode()
559 printf(COMMENT "to %d",GETARG_sJ(i)+pc+2); in PrintCode()
562 printf("%d %d %d",a,b,isk); in PrintCode()
565 printf("%d %d %d",a,b,isk); in PrintCode()
568 printf("%d %d %d",a,b,isk); in PrintCode()
571 printf("%d %d %d",a,b,isk); in PrintCode()
575 printf("%d %d %d",a,sb,isk); in PrintCode()
578 printf("%d %d %d",a,sb,isk); in PrintCode()
581 printf("%d %d %d",a,sb,isk); in PrintCode()
584 printf("%d %d %d",a,sb,isk); in PrintCode()
587 printf("%d %d %d",a,sb,isk); in PrintCode()
590 printf("%d %d",a,isk); in PrintCode()
593 printf("%d %d %d",a,b,isk); in PrintCode()
596 printf("%d %d %d",a,b,c); in PrintCode()
598 if (b==0) printf("all in "); else printf("%d in ",b-1); in PrintCode()
599 if (c==0) printf("all out"); else printf("%d out",c-1); in PrintCode()
602 printf("%d %d %d%s",a,b,c,ISK); in PrintCode()
603 printf(COMMENT "%d in",b-1); in PrintCode()
606 printf("%d %d %d%s",a,b,c,ISK); in PrintCode()
608 if (b==0) printf("all out"); else printf("%d out",b-1); in PrintCode()
613 printf("%d",a); in PrintCode()
616 printf("%d %d",a,bx); in PrintCode()
617 printf(COMMENT "to %d",pc-bx+2); in PrintCode()
620 printf("%d %d",a,bx); in PrintCode()
621 printf(COMMENT "exit to %d",pc+bx+3); in PrintCode()
624 printf("%d %d",a,bx); in PrintCode()
625 printf(COMMENT "to %d",pc+bx+2); in PrintCode()
628 printf("%d %d",a,c); in PrintCode()
631 printf("%d %d",a,bx); in PrintCode()
632 printf(COMMENT "to %d",pc-bx+2); in PrintCode()
635 printf("%d %d %d",a,b,c); in PrintCode()
636 if (isk) printf(COMMENT "%d",c+EXTRAARGC); in PrintCode()
639 printf("%d %d",a,bx); in PrintCode()
640 printf(COMMENT "%p",VOID(f->p[bx])); in PrintCode()
643 printf("%d %d",a,c); in PrintCode()
645 if (c==0) printf("all out"); else printf("%d out",c-1); in PrintCode()
648 printf("%d",a); in PrintCode()
651 printf("%d",ax); in PrintCode()
655 printf("%d %d %d",a,b,c); in PrintCode()
670 const char* s=f->source ? getstr(f->source) : "=?"; in PrintHeader()
677 printf("\n%s <%s:%d,%d> (%d instruction%s at %p)\n", in PrintHeader()
678 (f->linedefined==0)?"main":"function",s, in PrintHeader()
679 f->linedefined,f->lastlinedefined, in PrintHeader()
680 S(f->sizecode),VOID(f)); in PrintHeader()
681 printf("%d%s param%s, %d slot%s, %d upvalue%s, ", in PrintHeader()
682 (int)(f->numparams),f->is_vararg?"+":"",SS(f->numparams), in PrintHeader()
683 S(f->maxstacksize),S(f->sizeupvalues)); in PrintHeader()
684 printf("%d local%s, %d constant%s, %d function%s\n", in PrintHeader()
685 S(f->sizelocvars),S(f->sizek),S(f->sizep)); in PrintHeader()
691 n=f->sizek; in PrintDebug()
692 printf("constants (%d) for %p:\n",n,VOID(f)); in PrintDebug()
695 printf("\t%d\t",i); in PrintDebug()
700 n=f->sizelocvars; in PrintDebug()
701 printf("locals (%d) for %p:\n",n,VOID(f)); in PrintDebug()
704 printf("\t%d\t%s\t%d\t%d\n", in PrintDebug()
705 i,getstr(f->locvars[i].varname),f->locvars[i].startpc+1,f->locvars[i].endpc+1); in PrintDebug()
707 n=f->sizeupvalues; in PrintDebug()
708 printf("upvalues (%d) for %p:\n",n,VOID(f)); in PrintDebug()
711 printf("\t%d\t%s\t%d\t%d\n", in PrintDebug()
712 i,UPVALNAME(i),f->upvalues[i].instack,f->upvalues[i].idx); in PrintDebug()
718 int i,n=f->sizep; in PrintFunction()
722 for (i=0; i<n; i++) PrintFunction(f->p[i],full); in PrintFunction()