From: Victor Stinner Date: Mon, 19 Dec 2011 12:47:10 +0000 (+0100) Subject: (Merge 3.2) Issue #13628: python-gdb.py is now able to retrieve more frames in X-Git-Tag: v3.3.0a1~560 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d974393419eb55ad7f483ff3c56f746446778172;p=thirdparty%2FPython%2Fcpython.git (Merge 3.2) Issue #13628: python-gdb.py is now able to retrieve more frames in 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() --- d974393419eb55ad7f483ff3c56f746446778172 diff --cc Lib/test/test_gdb.py index c6ea45c7d991,a429db95016e..82dba2e022e8 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@@ -634,12 -644,12 +644,12 @@@ Traceback \(most recent call first\) cmds_after_breakpoint=['py-bt-full']) self.assertMultilineMatches(bt, r'''^.* -#[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\) +#[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\) baz\(a, b, c\) -#[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 4, in foo \(a=1, b=2, c=3\) +#[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 4, in foo \(a=1, b=2, c=3\) bar\(a, b, c\) -#[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 12, in \(\) +#[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 12, in \(\) - foo\(1, 2, 3\) + foo\(1, 2, 3\) ''') class PyPrintTests(DebuggerTests): @@@ -667,9 -683,11 +683,11 @@@ bt = self.get_stack_trace(script=self.get_sample_script(), cmds_after_breakpoint=['py-print len']) self.assertMultilineMatches(bt, - r".*\nbuiltin 'len' = \n.*") + r".*\nbuiltin 'len' = \n.*") class PyLocalsTests(DebuggerTests): + @unittest.skipIf(python_is_optimized(), + "Python was compiled with optimizations") def test_basic_command(self): bt = self.get_stack_trace(script=self.get_sample_script(), cmds_after_breakpoint=['py-locals']) diff --cc Misc/NEWS index e04ae7aab193,956146faef09..aeb1c8996642 --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -419,11 -97,7 +419,11 @@@ Core and Builtin Library ------- +- Issue #13635: Add ssl.OP_CIPHER_SERVER_PREFERENCE, so that SSL servers + choose the cipher based on their own preferences, rather than on the + client's. + - - Issue #11813: Fix inspect.getattr_static for modules. Patch by Andreas + - Issue #11813: Fix inspect.getattr_static for modules. Patch by Andreas Stührk. - Issue #7502: Fix equality comparison for DocTestCase instances. Patch by @@@ -1692,15 -1217,8 +1692,18 @@@ IDL Tools/Demos ----------- ++- Issue #13628: python-gdb.py is now able to retrieve more frames in the Python ++ traceback if Python is optimized. ++ +- Issue #11996: libpython (gdb), replace "py-bt" command by "py-bt-full" and + add a smarter "py-bt" command printing a classic Python traceback. + - Issue #11179: Make ccbench work under Python 3.1 and 2.7 again. +- Issue #10639: reindent.py no longer converts newlines and will raise + an error if attempting to convert a file with mixed newlines. + "--newline" option added to specify new line character. + Extension Modules ----------------- diff --cc Tools/gdb/libpython.py index b6ec063c9365,8bbbb1048b61..30347cbc9320 --- a/Tools/gdb/libpython.py +++ b/Tools/gdb/libpython.py @@@ -49,12 -49,6 +49,11 @@@ import sy _type_char_ptr = gdb.lookup_type('char').pointer() # char* _type_unsigned_char_ptr = gdb.lookup_type('unsigned char').pointer() # unsigned char* _type_void_ptr = gdb.lookup_type('void').pointer() # void* - _type_size_t = gdb.lookup_type('size_t') +_type_unsigned_short_ptr = gdb.lookup_type('unsigned short').pointer() +_type_unsigned_int_ptr = gdb.lookup_type('unsigned int').pointer() + +# value computed later, see PyUnicodeObjectPtr.proxy() +_is_pep393 = None SIZEOF_VOID_P = _type_void_ptr.sizeof