cpython: 6425728d8dc6 (original) (raw)

Mercurial > cpython

changeset 101081:6425728d8dc6

Merge 3.5: Issue #26799 [#26799]

Victor Stinner victor.stinner@gmail.com
date Wed, 20 Apr 2016 18:12:38 +0200
parents 7530caa5ed1a(current diff)e1c6f8895fd8(diff)
children b6d7645e4b0c
files Misc/ACKS Misc/NEWS
diffstat 3 files changed, 39 insertions(+), 14 deletions(-)[+] [-] Misc/ACKS 1 Misc/NEWS 5 Tools/gdb/libpython.py 47

line wrap: on

line diff

--- a/Misc/ACKS +++ b/Misc/ACKS @@ -651,6 +651,7 @@ Catalin Iacob Mihai Ibanescu Ali Ikinci Aaron Iles +Thomas Ilsche Lars Immisch Bobby Impollonia Naoki Inada

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -1065,6 +1065,11 @@ Windows Tools/Demos ----------- +- Issue #26799: Fix python-gdb.py: don't get once C types when the Python code

--- a/Tools/gdb/libpython.py +++ b/Tools/gdb/libpython.py @@ -56,16 +56,35 @@ if sys.version_info[0] >= 3: long = int

Look up the gdb.Type for some standard types:

-_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_unsigned_short_ptr = gdb.lookup_type('unsigned short').pointer() -_type_unsigned_int_ptr = gdb.lookup_type('unsigned int').pointer() +# Those need to be refreshed as types (pointer sizes) may change when +# gdb loads different executables + + +def _type_char_ptr():

+ + +def _type_unsigned_char_ptr():

+ + +def _type_void_ptr():

+ + +def _type_unsigned_short_ptr():

+ + +def _type_unsigned_int_ptr():

value computed later, see PyUnicodeObjectPtr.proxy()

_is_pep393 = None -SIZEOF_VOID_P = _type_void_ptr.sizeof + +def _sizeof_void_p():

Py_TPFLAGS_HEAPTYPE = (1 << 9) @@ -460,8 +479,8 @@ def _PyObject_VAR_SIZE(typeobj, nitems): return ( ( typeobj.field('tp_basicsize') + nitems * typeobj.field('tp_itemsize') +

_PyObject_VAR_SIZE._type_size_t = None @@ -485,9 +504,9 @@ class HeapTypeObjectPtr(PyObjectPtr): size = _PyObject_VAR_SIZE(typeobj, tsize) dictoffset += size assert dictoffset > 0

@@ -1004,7 +1023,7 @@ class PyBytesObjectPtr(PyObjectPtr): def str(self): field_ob_size = self.field('ob_size') field_ob_sval = self.field('ob_sval')

def proxyval(self, visited): @@ -1135,11 +1154,11 @@ class PyUnicodeObjectPtr(PyObjectPtr): field_str = self.field('data')['any'] repr_kind = int(state['kind']) if repr_kind == 1: