[New-bugs-announce] [issue7543] RFE: introduce "enum Py_Opcode"
report at bugs.python.org
Sat Dec 19 00:06:46 CET 2009
New submission from Dave Malcolm <dmalcolm at redhat.com>:
Currently, Python's opcodes are defined as preprocessor #defines. This means that they are
invisible to the debugger.
(i) a simple script (fixup-opcode-header.py) which converts Include/opcode.h to use an
anonymous enum for the values
(ii) a diff containing the results of running the script on trunk's Include/opcode.h
(iii) a patch that converts usage of "int opcode" to "enum Py_Opcode opcode" in a few
(Is the usage of an anonymous enum acceptable on all compilers that Python supports? Is it
going to generate equal machinecode on all compilers, relative to an int?)
With this patch, if I break into PyEval_EvalFrameEx in gdb, the debugger is able to emit
symbolic values for "opcode":
(gdb) p opcode
$2 = LOAD_CONST
components: Interpreter Core
title: RFE: introduce "enum Py_Opcode"
versions: Python 2.7, Python 3.2
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce