Skip to content

Commit

Permalink
dump readable opcode names in flowgraph debug utility (python#109392)
Browse files Browse the repository at this point in the history
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
  • Loading branch information
carljm and iritkatriel committed Sep 14, 2023
1 parent 9ccd2e6 commit 1ce9ea0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Python/flowgraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -2661,4 +2661,3 @@ _PyCfg_OptimizedCfgToInstructionSequence(cfg_builder *g,

return SUCCESS;
}

0 comments on commit 1ce9ea0

Please sign in to comment.