aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/py-value.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.python/py-value.exp')
-rw-r--r--gdb/testsuite/gdb.python/py-value.exp6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp
index 43de063..a052104 100644
--- a/gdb/testsuite/gdb.python/py-value.exp
+++ b/gdb/testsuite/gdb.python/py-value.exp
@@ -291,6 +291,12 @@ proc test_value_in_inferior {} {
# For the purposes of this test, use repr()
gdb_py_test_silent_cmd "python nullst = nullst.string (length = 9)" "get string beyond null" 1
gdb_test "python print (repr(nullst))" "u?'divide\\\\x00et'"
+
+ # Test fetching a string longer than its declared (in C) size.
+ # PR 16286
+ gdb_py_test_silent_cmd "python xstr = gdb.parse_and_eval('xstr')" "get xstr" 1
+ gdb_test "python print xstr\['text'\].string (length = xstr\['length'\])" "x{100}" \
+ "read string beyond declared size"
}
proc test_lazy_strings {} {