Fix gdb/libpython.py for not ready Unicode strings

_PyUnicode_CheckConsistency() checks also hash and length value for not ready
Unicode strings.
This commit is contained in:
Victor Stinner 2011-11-04 20:54:05 +01:00
parent 2fc507fe45
commit e30c0a1014
3 changed files with 10 additions and 10 deletions

View file

@ -231,22 +231,24 @@ typedef struct {
* utf8_length = 0 if utf8 is NULL
* wstr is shared with data and wstr_length=length
if kind=PyUnicode_2BYTE_KIND and sizeof(wchar_t)=2
or if kind=PyUnicode_4BYTE_KIND and sizeof(wchar_4)=4
or if kind=PyUnicode_4BYTE_KIND and sizeof(wchar_t)=4
* wstr_length = 0 if wstr is NULL
* (data starts just after the structure)
- legacy string, not ready:
* structure = PyUnicodeObject
* length = 0 (use wstr_length)
* hash = -1
* kind = PyUnicode_WCHAR_KIND
* compact = 0
* ascii = 0
* ready = 0
* interned = SSTATE_NOT_INTERNED
* wstr is not NULL
* data.any is NULL
* utf8 is NULL
* utf8_length = 0
* interned = SSTATE_NOT_INTERNED
- legacy string, ready:
@ -258,7 +260,7 @@ typedef struct {
* data.any is not NULL
* utf8 is shared and utf8_length = length with data.any if ascii = 1
* utf8_length = 0 if utf8 is NULL
* wstr is shared and wstr_length = length with data.any
* wstr is shared with data.any and wstr_length = length
if kind=PyUnicode_2BYTE_KIND and sizeof(wchar_t)=2
or if kind=PyUnicode_4BYTE_KIND and sizeof(wchar_4)=4
* wstr_length = 0 if wstr is NULL