]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
dump readable opcode names in flowgraph debug utility (#109392)
authorCarl Meyer <carl@oddbird.net>
Thu, 14 Sep 2023 14:28:21 +0000 (08:28 -0600)
committerGitHub <noreply@github.com>
Thu, 14 Sep 2023 14:28:21 +0000 (14:28 +0000)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Python/flowgraph.c

index 44858b9c5273889587fcbbab373ba6b48058026d..5ad49911dfbea4fa87d381f6f8342e15a39def02 100644 (file)
@@ -261,8 +261,8 @@ dump_instr(cfg_instr *i)
     if (HAS_TARGET(i->i_opcode)) {
         sprintf(arg, "target: %p [%d] ", i->i_target, i->i_oparg);
     }
-    fprintf(stderr, "line: %d, opcode: %d %s%s\n",
-                    i->i_loc.lineno, i->i_opcode, arg, jump);
+    fprintf(stderr, "line: %d, %s (%d)  %s%s\n",
+                    i->i_loc.lineno, _PyOpcode_OpName[i->i_opcode], i->i_opcode, arg, jump);
 }
 
 static inline int
@@ -2661,4 +2661,3 @@ _PyCfg_OptimizedCfgToInstructionSequence(cfg_builder *g,
 
     return SUCCESS;
 }
-