浏览代码

new auxiliary function 'luaI_printinst' (to print a single instruction)

Roberto Ierusalimschy 13 年之前
父节点
当前提交
43bfb60ac8
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      ltests.c

+ 7 - 1
ltests.c

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: ltests.c,v 2.128 2012/05/30 16:40:29 roberto Exp $
+** $Id: ltests.c,v 2.129 2012/05/31 20:25:42 roberto Exp $
 ** Internal Module for Debugging of the Lua Implementation
 ** Internal Module for Debugging of the Lua Implementation
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -520,6 +520,12 @@ void luaI_printcode (Proto *pt, int size) {
   }
   }
   printf("-------\n");
   printf("-------\n");
 }
 }
+
+
+void luaI_printinst (Proto *pt, int pc) {
+  char buff[100];
+  printf("%s\n", buildop(pt, pc, buff));
+}
 #endif
 #endif