diff options
author | Doug Evans <dje@google.com> | 2017-03-15 15:35:13 -0700 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2017-03-16 09:28:11 -0700 |
commit | 34b433203b5f56149c27a8dfea21a921392cb158 (patch) | |
tree | c45039a326c7863be84bcbe3e552b2a28ee209ae /gdb/testsuite/gdb.python/py-value.c | |
parent | a3a5feccd26be653efbdf1408874b98962baaa50 (diff) | |
download | gdb-34b433203b5f56149c27a8dfea21a921392cb158.zip gdb-34b433203b5f56149c27a8dfea21a921392cb158.tar.gz gdb-34b433203b5f56149c27a8dfea21a921392cb158.tar.bz2 |
Fix various python lazy string bugs.
gdb/ChangeLog:
PR python/17728, python/18439, python/18779
* python/py-lazy-string.c (lazy_string_object): Clarify use of LENGTH
member. Change type of TYPE member to PyObject *. All uses updated.
(stpy_convert_to_value): Fix handling of TYPE_CODE_PTR.
(gdbpy_create_lazy_string_object): Flag bad length values.
Handle TYPE_CODE_ARRAY with possibly different user-provided length.
Handle typedefs in incoming type.
(stpy_lazy_string_elt_type): New function.
(gdbpy_extract_lazy_string): Call it.
* python/py-value.c (valpy_lazy_string): Flag bad length values.
Fix handling of TYPE_CODE_PTR. Handle TYPE_CODE_ARRAY. Handle
typedefs in incoming type.
gdb/testsuite/ChangeLog:
PR python/17728, python/18439, python/18779
* gdb.python/py-value.c (main) Delete locals sptr, sn.
* gdb.python/py-lazy-string.c (pointer): New typedef.
(main): New locals ptr, array, typedef_ptr.
* gdb.python/py-value.exp: Move lazy string tests to ...
* gdb.python/py-lazy-string.exp: ... here. Add more tests for pointer,
array, typedef lazy strings.
Diffstat (limited to 'gdb/testsuite/gdb.python/py-value.c')
-rw-r--r-- | gdb/testsuite/gdb.python/py-value.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.python/py-value.c b/gdb/testsuite/gdb.python/py-value.c index d90b15e..b25b8a6 100644 --- a/gdb/testsuite/gdb.python/py-value.c +++ b/gdb/testsuite/gdb.python/py-value.c @@ -90,13 +90,11 @@ main (int argc, char *argv[]) char nullst[17] = "divide\0et\0impera"; void (*fp1) (void) = &func1; int (*fp2) (int, int) = &func2; - const char *sptr = "pointer"; const char *embed = "embedded x\201\202\203\204"; int a[3] = {1,2,3}; int *p = a; int i = 2; int *ptr_i = &i; - const char *sn = 0; struct str *xstr; /* Prevent gcc from optimizing argv[] out. */ |