aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/py-lazy-string.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.python/py-lazy-string.exp')
-rw-r--r--gdb/testsuite/gdb.python/py-lazy-string.exp9
1 files changed, 8 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.python/py-lazy-string.exp b/gdb/testsuite/gdb.python/py-lazy-string.exp
index a00f47b..7e7272e 100644
--- a/gdb/testsuite/gdb.python/py-lazy-string.exp
+++ b/gdb/testsuite/gdb.python/py-lazy-string.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2015-2024 Free Software Foundation, Inc.
+# Copyright (C) 2015-2025 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -48,6 +48,8 @@ gdb_test "python print(null.lazy_string(length=3).value())" \
gdb_test "python print(null.lazy_string(length=-2))" \
"ValueError.*: Invalid length.*Error occurred in Python.*" \
"bad length"
+gdb_py_test_silent_cmd "python nullstr = null.lazy_string()" \
+ "create null lazy string with default length" 1
foreach var_spec { { "ptr" "pointer" "const char \\*" -1 } \
{ "array" "array" "const char \\[6\\]" 6 } \
@@ -73,3 +75,8 @@ foreach var_spec { { "ptr" "pointer" "const char \\*" -1 } \
#gdb_test "python print ($var.lazy_string(length=0).value())" "\"\"" "empty lazy string value"
}
}
+
+gdb_py_test_silent_cmd "python nas = gdb.parse_and_eval('not_a_string')" \
+ "get not_a_string" 1
+gdb_test "python print(nas.lazy_string())" \
+ "Cannot make lazy string from this object"