This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2013年10月20日 09:24 by dcoles, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| gdb_py3.patch | pitrou, 2013年10月20日 19:40 | review | ||
| gdb_py3.patch | dcoles, 2013年10月21日 01:23 | review | ||
| python27-gdb_py3.patch | dcoles, 2013年10月21日 07:26 | review | ||
| Messages (15) | |||
|---|---|---|---|
| msg200554 - (view) | Author: David Coles (dcoles) * | Date: 2013年10月20日 09:24 | |
Tools/gdb/libpython.py is currently Python 3 incompatible. Unfortunately recent versions of gdb (such as the one provided in Ubuntu 13.10) may be linked against Python 3 rather than Python 2, breaking debugging support. Most of the issues appear to be trivial issues such as the print statement syntax and removal of functions like xrange, unichr and long. |
|||
| msg200581 - (view) | Author: Matthias Klose (doko) * (Python committer) | Date: 2013年10月20日 13:35 | |
should go into 2.7 as well. |
|||
| msg200617 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2013年10月20日 19:11 | |
Do you want to provide a patch? It's hard for someone with a py2-linked gcc to make sure that the libpython pluging works properly. |
|||
| msg200619 - (view) | Author: David Coles (dcoles) * | Date: 2013年10月20日 19:17 | |
Sure thing. I've got a patch attached to https://bugs.launchpad.net/ubuntu/+source/gdb/+bug/1241668 but want to make sure that it doesn't break things on the py2-linked version. |
|||
| msg200621 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2013年10月20日 19:40 | |
Can you please try the attached updated patch? |
|||
| msg200679 - (view) | Author: David Coles (dcoles) * | Date: 2013年10月21日 01:23 | |
I ended up with a very similar looking patch - and so merged my changes into Pitrou's patch. I also had a go at fixing up the `test_gdb` unit test, which revealed a few more string/unicode issues. Finally tracked them down to the `write_unicode` function. Sadly the `write` function in GDB's Python API only accepts unicode strings, hence we must pre-backslash escape for C-string encoding (either Python's default encoding or utf-8 in Python 3.1+) then turn it back into a unicode string again to avoid a TypeError. Yuck. The patch almost applies on Python 2.7, but needs a little bit of massaging due to slight differences in Tools/gdb/libpython.py. Need to test the new unicode changes haven't broken anything and then I'll upload a patch for Python 2.7. |
|||
| msg200706 - (view) | Author: David Coles (dcoles) * | Date: 2013年10月21日 07:26 | |
And here's the patch for Python 2.7. The result of testing is as follows: - python (default) against py2-linked gdb: All tests pass - python (2.7) against py2-linked gdb: `test_long` fails. - python (default) against py3-linked gdb: All tests pass - python (2.7) against py3-linked gdb: `test_long`, `test_strings` and `test_unicode` fail. `test_long` has been removed from the default branch, in addition gdb doesn't seem to distinguish printing 0 from 0L. `test_strings` likely fails since Python 3 will print printable unicode characters (like "\xff") while Python 2 will not. `test_unicode` likely fails due to the 'u' prefix on unicode strings in Python 2. This kind of behavior is pretty much expected when cross-testing gdb. |
|||
| msg200716 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2013年10月21日 08:22 | |
I've added a review comment to the 3.3 version of the patch. |
|||
| msg202179 - (view) | Author: Julian Taylor (jtaylor) | Date: 2013年11月04日 23:45 | |
I tested the latest patch (python27-gdb_py3.patch) with ubuntu 13.10 gdb compiled against python3.3, while it fixes the syntax errors it does not fix the functionality. E.g. one gets this error on breakpoints: Python Exception <class 'gdb.error'> There is no member named length.: Breakpoint 3, PyTuple_Size (op=) at ../Objects/tupleobject.c:127 and the objects are not printed in their string representation as they should be with the plugin. |
|||
| msg202182 - (view) | Author: Julian Taylor (jtaylor) | Date: 2013年11月05日 00:11 | |
on further investigation I seem to have screwed up patching the files. Patching properly they do work. Sorry for the noise. |
|||
| msg204050 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2013年11月23日 16:40 | |
New changeset 9f2a0043396b by Antoine Pitrou in branch 'default': Issue #19308: fix the gdb plugin on gdbs linked with Python 3 http://hg.python.org/cpython/rev/9f2a0043396b |
|||
| msg204051 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2013年11月23日 16:44 | |
New changeset 752db82b7933 by Antoine Pitrou in branch '3.3': Issue #19308: fix the gdb plugin on gdbs linked with Python 3 http://hg.python.org/cpython/rev/752db82b7933 |
|||
| msg204057 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2013年11月23日 17:19 | |
New changeset ef4636faf8bd by Antoine Pitrou in branch '2.7': Issue #19308: fix the gdb plugin on gdbs linked with Python 3 http://hg.python.org/cpython/rev/ef4636faf8bd |
|||
| msg204061 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2013年11月23日 17:23 | |
I've committed updated patches to all 3 branches (+ some later fixups). Gonna wait for the buildbots' outcome. |
|||
| msg204104 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2013年11月23日 20:48 | |
The buildbots look ok now. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:52 | admin | set | github: 63507 |
| 2013年11月23日 20:48:46 | pitrou | set | status: open -> closed messages: + msg204104 |
| 2013年11月23日 17:23:50 | pitrou | set | resolution: fixed messages: + msg204061 stage: patch review -> resolved |
| 2013年11月23日 17:19:43 | python-dev | set | messages: + msg204057 |
| 2013年11月23日 16:44:14 | python-dev | set | messages: + msg204051 |
| 2013年11月23日 16:40:45 | python-dev | set | nosy:
+ python-dev messages: + msg204050 |
| 2013年11月05日 00:11:41 | jtaylor | set | messages: + msg202182 |
| 2013年11月04日 23:45:27 | jtaylor | set | nosy:
+ jtaylor messages: + msg202179 |
| 2013年10月21日 08:22:14 | pitrou | set | messages: + msg200716 |
| 2013年10月21日 07:26:22 | dcoles | set | files:
+ python27-gdb_py3.patch messages: + msg200706 |
| 2013年10月21日 01:23:50 | dcoles | set | files:
+ gdb_py3.patch messages: + msg200679 |
| 2013年10月20日 19:40:24 | pitrou | set | files:
+ gdb_py3.patch messages: + msg200621 keywords: + patch type: behavior stage: patch review |
| 2013年10月20日 19:17:20 | dcoles | set | messages: + msg200619 |
| 2013年10月20日 19:11:29 | pitrou | set | priority: normal -> high nosy: + pitrou messages: + msg200617 |
| 2013年10月20日 13:35:06 | doko | set | nosy:
+ doko messages: + msg200581 versions: + Python 2.7 |
| 2013年10月20日 09:36:02 | ned.deily | set | nosy:
+ dmalcolm |
| 2013年10月20日 09:24:14 | dcoles | create | |