From 7c9b8f73ab69574a592e481e78fa23c922b81694 Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Wed, 13 Sep 2023 17:29:03 -0700 Subject: [PATCH 1/2] improve flowgraph debug utility --- Python/flowgraph.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Python/flowgraph.c b/Python/flowgraph.c index 44858b9c527388..506d69c1675a8d 100644 --- a/Python/flowgraph.c +++ b/Python/flowgraph.c @@ -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, opcode: %d (%s) %s%s\n", + i->i_loc.lineno, i->i_opcode, _PyOpcode_OpName[i->i_opcode], arg, jump); } static inline int @@ -2661,4 +2661,3 @@ _PyCfg_OptimizedCfgToInstructionSequence(cfg_builder *g, return SUCCESS; } - From faf6cb93f0055966d84a8d8e8dab0edae43067fc Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Thu, 14 Sep 2023 07:56:17 -0600 Subject: [PATCH 2/2] Update Python/flowgraph.c Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> --- Python/flowgraph.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Python/flowgraph.c b/Python/flowgraph.c index 506d69c1675a8d..5ad49911dfbea4 100644 --- a/Python/flowgraph.c +++ b/Python/flowgraph.c @@ -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%s\n", - i->i_loc.lineno, i->i_opcode, _PyOpcode_OpName[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