summaryrefslogtreecommitdiffstats
path: root/Tools/gdb/libpython.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.6] bpo-30983: [gdb] Fix py-bt, etc. for non-debug shared builds (GH-3153) ↵Łukasz Langa2017-08-221-9/+11
| | | | | | | | | | | | | | | (#3192) PEP 523 introduced _PyEval_EvalFrameDefault which inlines PyEval_EvalFrameEx on non-debug shared builds. This breaks the ability to use py-bt, py-up, and a few other Python-specific gdb integrations. This patch fixes the problem by only looking for _PyEval_EvalFrameDefault frames. test_gdb passes on both a debug and a non-debug build. Original patch by Bruno "Polaco" Penteado. (cherry picked from commit 5fe59f8e3a0a56a155c18f9d581205ec533764b6)
* Revert "[3.6] bpo-30983: eval frame rename in pep 0523 broke gdb's python ↵Victor Stinner2017-08-161-4/+2
| | | | | extension (GH-2803) (#3090)" (#3101) This reverts commit 09b77165e3fffa7b7ff160ad06042cdcfa004bf5.
* [3.6] bpo-30983: eval frame rename in pep 0523 broke gdb's python extension ↵Łukasz Langa2017-08-141-2/+4
| | | | | | | | | | (GH-2803) (#3090) pep 0523 renames PyEval_EvalFrameEx to _PyEval_EvalFrameDefault while the gdb python extension only looks for PyEval_EvalFrameEx to understand if it is dealing with a frame. Final effect is that attaching gdb to a python3.6 process doesnt resolve python objects. Eg. py-list and py-bt dont work properly. This patch fixes that. Tested locally on python3.6 (cherry picked from commit 2e0f4db114)
* [3.6] bpo-30345: Update test_gdb.py and python-gdb.py from master (#1549)Victor Stinner2017-05-121-12/+52
| | | | | | | | | | | | | | * python-gdb.py supports method-wrapper bpo-29367: python-gdb.py now supports also method-wrapper (wrapperobject) objects. (cherry picked from commit 611083331d534481ca7956a376e38fb0e9ef3854) * Update and enhance python-gdb.py bpo-29259: Detect PyCFunction is the current frame, not only in the older frame.
* Fixes bpo-29680: Older gdb does not have gdb.error. (GH-363) (GH-534)Mariatta2017-03-071-1/+1
| | | | This change is required to make python-dbg.py compatible with GDB versions before 7.3. (cherry picked from commit 661ca8843fed1183e38db06e52d59ac300bf1c2a)
* Merge 3.5Victor Stinner2016-12-161-2/+18
|\
| * python-gdb.py: catch gdb.error on gdb.selected_frame()Victor Stinner2016-12-161-2/+18
| |
* | Issue #28770: Update python-gdb.py for fastcallsVictor Stinner2016-11-221-16/+31
| | | | | | | | | | | | | | | | Frame.is_other_python_frame() now also handles _PyCFunction_FastCallDict() frames. Thanks to the new code to handle fast calls, python-gdb.py is now also able to detect the <built-in id method of module ...> frame.
* | Issue #28023: Fix python-gdb.py on old GDB versionsVictor Stinner2016-11-221-2/+6
| | | | | | | | | | | | Replace int(value.address)+offset with value.cast(unsigned char*)+offset. It seems like int(value.address) fails on old versions of GDB.
* | Issue #28023: Fix python-gdb.py didn't support new dict implementationINADA Naoki2016-11-221-2/+26
| |
* | Remove legacy "from __future__ import with_statement" lines.Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)2016-09-081-1/+1
|/
* gdb/libpython.py: inline _type_void_ptr()Victor Stinner2016-04-201-10/+4
| | | | The function was only called in _sizeof_void_p()
* python-gdb.py: get C types at runtimeVictor Stinner2016-04-201-14/+33
| | | | | | | | Issue #26799: Fix python-gdb.py: don't get once C types when the Python code is loaded, but get C types on demande. The C types can change if python-gdb.py is loaded before the Python executable. Patch written by Thomas Ilsche.
* Issue #25523: Correct "a" article to "an" articleMartin Panter2015-11-021-2/+2
| | | | | | This changes the main documentation, doc strings, source code comments, and a couple error messages in the test suite. In some cases the word was removed or edited some other way to fix the grammar.
* Issue #19936: Added executable bits or shebang lines to Python scripts whichSerhiy Storchaka2014-01-161-0/+0
|\ | | | | | | | | | | | | requires them. Disable executable bits and shebang lines in test and benchmark files in order to prevent using a random system python, and in source files of modules which don't provide command line interface. Fixed shebang lines in the unittestgui and checkpip scripts.
| * Issue #19936: Added executable bits or shebang lines to Python scripts whichSerhiy Storchaka2014-01-161-0/+0
| | | | | | | | | | | | | | requires them. Disable executable bits and shebang lines in test and benchmark files in order to prevent using a random system python, and in source files of modules which don't provide command line interface. Fixed shebang line to use python3 executable in the unittestgui script.
* | Undo (hopefully) buildbot failuresAntoine Pitrou2013-11-231-1/+1
|\ \ | |/
| * Undo (hopefully) buildbot failuresAntoine Pitrou2013-11-231-1/+1
| |
| * Issue #19308: fix the gdb plugin on gdbs linked with Python 3Antoine Pitrou2013-11-231-52/+69
| |
* | Issue #19308: fix the gdb plugin on gdbs linked with Python 3Antoine Pitrou2013-11-231-52/+69
| |
* | Issue #18743: Fix references to non-existant "StringIO" moduleSerhiy Storchaka2013-08-291-1/+1
|\ \ | |/ | | | | in docstrings and comments.
| * Issue #18743: Fix references to non-existant "StringIO" moduleSerhiy Storchaka2013-08-291-1/+1
| | | | | | | | in docstrings and comments.
* | #18803: merge with 3.3.Ezio Melotti2013-08-251-1/+1
|\ \ | |/
| * #18803: fix more typos. Patch by Févry Thibault.Ezio Melotti2013-08-251-1/+1
| |
* | Issue #18772: fix the gdb plugin after the set implementation changesAntoine Pitrou2013-08-241-21/+19
| |
* | #17833: merge with 3.3David Malcolm2013-05-061-1/+1
|\ \ | |/
| * #17833: fix test_gdb failures seen on PPC64 Linux in test_threads ↵David Malcolm2013-05-061-1/+1
| | | | | | | | (test.test_gdb.PyBtTests)
* | python-gdb.py: Replace invalid Unicode character with U+FFFD to be able toVictor Stinner2013-04-111-1/+3
|/ | | | | | display invalid strings. Such strings can be found while Python is creating a new string, in a text decoder for example, when Python is compiled in debug mode.
* Fix a few typos and a double semicolon. Patch by Eitan Adler.Ezio Melotti2013-01-271-1/+1
|
* compare singletons by identity not equality (closes #16712)Benjamin Peterson2012-10-091-1/+1
| | | | Patch from Serhiy Storchaka.
* Issue #12605: Show information on more C frames within gdb backtracesDavid Malcolm2012-06-271-9/+92
| | | | | | | | | The gdb hooks for debugging CPython (within Tools/gdb) have been enhanced to show information on more C frames relevant to CPython within the "py-bt" and "py-bt-full" commands: * C frames that are waiting on the GIL * C frames that are garbage-collecting * C frames that are due to the invocation of a PyCFunction
* Implement PEP 412: Key-sharing dictionaries (closes #13903)Benjamin Peterson2012-04-231-3/+8
| | | | Patch from Mark Shannon.
* (Merge 3.2) Issue #13628: python-gdb.py is now able to retrieve more frames inVictor Stinner2011-12-191-13/+32
|\ | | | | | | | | | | | | | | | | | | | | | | | | the Python traceback if Python is optimized. * delay the lookup of the size_t type, it is not available at startup * The second argument of the PyFrameObjectPtr constructor is optional, as done in other constructors * iter_builtins() and iter_globals() methods of PyFrameObjectPtr returns an empty tuple instead of None if Python is optimized * Fix py-bt and py-bt-full to handle correctly "optimized" frames * Frame.get_pyop() tries to get the frame pointer from PyEval_EvalCodeEx() if the pointer is optimized out in PyEval_EvalFrameEx()
| * Issue #13628: python-gdb.py is now able to retrieve more frames in the PythonVictor Stinner2011-12-191-13/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | traceback if Python is optimized. * delay the lookup of the size_t type, it is not available at startup * The second argument of the PyFrameObjectPtr constructor is optional, as done in other constructors * iter_builtins() and iter_globals() methods of PyFrameObjectPtr returns an empty tuple instead of None if Python is optimized * Fix py-bt and py-bt-full to handle correctly "optimized" frames * Frame.get_pyop() tries to get the frame pointer from PyEval_EvalCodeEx() if the pointer is optimized out in PyEval_EvalFrameEx()
* | Fix test_gdb failureAntoine Pitrou2011-12-121-1/+0
| |
* | Issue #13575: there is only one class type.Florent Xicluna2011-12-121-41/+3
| |
* | libpython.py: defer call to gdb.lookup_type('PyUnicodeObject')Victor Stinner2011-12-071-1/+6
| | | | | | | | The lookup fails at startup if Python is linked to a shared library.
* | Oops, really fix gdb/libpython.py for not ready Unicode stringsVictor Stinner2011-11-041-1/+2
| |
* | Fix gdb/libpython.py for not ready Unicode stringsVictor Stinner2011-11-041-5/+0
| | | | | | | | | | _PyUnicode_CheckConsistency() checks also hash and length value for not ready Unicode strings.
* | Fix test_gdb following the small unicode struct change in c25262e97304 ↵Antoine Pitrou2011-10-081-1/+1
| | | | | | | | (issue #13130)
* | PyUnicode_Ready() now sets ascii=1 if maxchar < 128Victor Stinner2011-10-031-2/+3
| | | | | | | | | | ascii=1 is no more reserved to PyASCIIObject. Use PyUnicode_IS_COMPACT_ASCII(obj) to check if obj is a PyASCIIObject (as before).
* | Update for PEP 393.Martin v. Löwis2011-09-281-12/+25
| |
* | Implement PEP 393.Martin v. Löwis2011-09-281-3/+24
|/
* libpython.py (gdb) now catchs IOError in py-list and py-bt commandsVictor Stinner2011-07-011-4/+18
| | | | | py-list displays the error. py-bt ignores the error (the filename and line number is already displayed).
* Issue #11996: libpython (gdb), replace "py-bt" command by "py-bt-full" and addVictor Stinner2011-05-131-1/+40
| | | | a smarter "py-bt" command printing a classic Python traceback.
* libpython: implementation of os.fsencode() with surrogateescape error handlerVictor Stinner2010-10-171-2/+20
|
* gdb: fix representation of non-printable surrogate pairs, and workaroundAntoine Pitrou2010-09-081-8/+11
| | | | a bug in ascii().
* Add a safety limit to the number of unicode characters we fetchAntoine Pitrou2010-09-081-1/+2
| | | | (followup to r84635, suggested by Dave Malcolm).
* Issue #9188: The gdb extension now handles correctly narrow (UCS2) as wellAntoine Pitrou2010-09-081-13/+43
| | | | | as wide (UCS4) unicode builds for both the host interpreter (embedded inside gdb) and the interpreter under test.
* libpython.py: py-bt commands escape unencodable charactersVictor Stinner2010-08-171-1/+9
| | | | | | | Encode unicode strings to the terminal encoding with backslashreplace error (as Python does for sys.stderr) before writing them to sys.stdout. It fixes UnicodeEncodeError on writing non-ascii characters in an ascii terminal (C locale: ASCII encoding).