Copy lazy string handling fixes from Python.
authorDoug Evans <dje@google.com>
Wed, 15 Mar 2017 22:44:45 +0000 (15:44 -0700)
committerDoug Evans <dje@google.com>
Thu, 16 Mar 2017 16:31:29 +0000 (09:31 -0700)
commita7c0469f992721b30665ba92f4f2f74d29032a84
treea969a42f1d28f0d33360ecbdb053d947974182d3
parent34b433203b5f56149c27a8dfea21a921392cb158
Copy lazy string handling fixes from Python.

This patch keeps the Scheme side of lazy string handling in sync
with the python size, bringing over fixes for
PRs python/17728, python/18439, python/18779.

gdb/ChangeLog:

* guile/scm-lazy-string.c (lazy_string_smob): Clarify use of LENGTH
member.  Change type of TYPE member to SCM.  All uses updated.
(lsscm_make_lazy_string_smob): Add assert.
(lsscm_make_lazy_string): Flag bad length values.
(lsscm_elt_type): New function.
(gdbscm_lazy_string_to_value): Rewrite to use
lsscm_safe_lazy_string_to_value.
(lsscm_safe_lazy_string_to_value): Fix handling of TYPE_CODE_PTR.
* guile/scm-value.c (gdbscm_value_to_lazy_string): Flag bad length
values.  Fix TYPE_CODE_PTR.  Handle TYPE_CODE_ARRAY.  Handle typedefs
in incoming type.
* guile/guile-internal.h (tyscm_scm_to_type): Declare.
* guile/scm-type.c (tyscm_scm_to_type): New function.

gdb/testsuite/ChangeLog:

* gdb.guile/scm-value.c (main) Delete locals sptr, sn.
* gdb.guile/scm-lazy-string.c: New file.
* gdb.guile/scm-value.exp: Move lazy string tests to ...
* gdb.guile/scm-lazy-string.exp: ... here, new file.  Add more tests
for pointer, array, typedef lazy strings.
gdb/ChangeLog
gdb/guile/scm-lazy-string.c
gdb/guile/scm-value.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.guile/scm-lazy-string.c [new file with mode: 0644]
gdb/testsuite/gdb.guile/scm-lazy-string.exp [new file with mode: 0644]
gdb/testsuite/gdb.guile/scm-value.c
gdb/testsuite/gdb.guile/scm-value.exp
This page took 0.028502 seconds and 4 git commands to generate.