classification
Title: python-gdb.py: patch to improve support of optimized Python
Type: behavior Stage: patch review
Components: Demos and Tools Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: dmalcolm, haypo, jcea, meador.inge, python-dev
Priority: normal Keywords: patch

Created on 2011-12-18 16:30 by haypo, last changed 2011-12-19 12:59 by haypo. This issue is now closed.

Files
File name Uploaded Description Edit
gdb.patch haypo, 2011-12-18 16:30
Messages (4)
msg149778 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2011-12-18 16:30
If Python is compiled with gcc -O3, gdb is unable to get the f argument of PyEval_EvalFrameEx(). It is possible to retrieve "f" from the caller, PyEval_EvalCodeEx().

Attached patch tries to implement this idea and enable more test_gdb tests on optimized Python.

The patch has a problem because some tests fails if Python is not optimized (Python compiled in debug mode).

--

The patch fix other minor bugs in libpython.py related to optimized Python.
msg149852 - (view) Author: Roundup Robot (python-dev) Date: 2011-12-19 12:45
New changeset 0b03cb97dac0 by Victor Stinner in branch '3.2':
Issue #13628: python-gdb.py is now able to retrieve more frames in the Python
http://hg.python.org/cpython/rev/0b03cb97dac0

New changeset 5e3a172bba89 by Victor Stinner in branch 'default':
(Merge 3.2) Issue #13628: python-gdb.py is now able to retrieve more frames in
http://hg.python.org/cpython/rev/5e3a172bba89
msg149854 - (view) Author: Roundup Robot (python-dev) Date: 2011-12-19 12:58
New changeset 1cc8e9565339 by Victor Stinner in branch '2.7':
Issue #13628: python-gdb.py is now able to retrieve more frames in the Python
http://hg.python.org/cpython/rev/1cc8e9565339
msg149855 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2011-12-19 12:59
> It is possible to retrieve "f" from the caller, PyEval_EvalCodeEx()

It does not always work, but it works sometimes, so it's better to try :-)

I applied my fix to Python 2.7, 3.2 and 3.3. lipython.py of Python 2.7 is outdated, it should be resynchronized with the one of Python 3.3. I will do that later and in another issue.
History
Date User Action Args
2011-12-19 12:59:40hayposetstatus: open -> closed
resolution: fixed
messages: + msg149855
2011-12-19 12:58:24python-devsetmessages: + msg149854
2011-12-19 12:45:18python-devsetnosy: + python-dev
messages: + msg149852
2011-12-19 01:16:07jceasetnosy: + jcea
2011-12-19 00:29:47meador.ingesetnosy: + meador.inge
2011-12-19 00:26:49meador.ingesettype: behavior
components: + Demos and Tools
stage: patch review
2011-12-18 19:14:25pitrousetnosy: + dmalcolm
2011-12-18 16:30:27haypocreate