Skip to content

Commit 1ce9ea0

Browse files
carljmiritkatriel
andauthored
dump readable opcode names in flowgraph debug utility (#109392)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
1 parent 9ccd2e6 commit 1ce9ea0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Python/flowgraph.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,8 @@ dump_instr(cfg_instr *i)
261261
if (HAS_TARGET(i->i_opcode)) {
262262
sprintf(arg, "target: %p [%d] ", i->i_target, i->i_oparg);
263263
}
264-
fprintf(stderr, "line: %d, opcode: %d %s%s\n",
265-
i->i_loc.lineno, i->i_opcode, arg, jump);
264+
fprintf(stderr, "line: %d, %s (%d) %s%s\n",
265+
i->i_loc.lineno, _PyOpcode_OpName[i->i_opcode], i->i_opcode, arg, jump);
266266
}
267267

268268
static inline int
@@ -2661,4 +2661,3 @@ _PyCfg_OptimizedCfgToInstructionSequence(cfg_builder *g,
26612661

26622662
return SUCCESS;
26632663
}
2664-

0 commit comments

Comments
 (0)