aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python
diff options
context:
space:
mode:
authorPhil Muldoon <pmuldoon@redhat.com>2010-04-08 10:28:42 +0000
committerPhil Muldoon <pmuldoon@redhat.com>2010-04-08 10:28:42 +0000
commitfff5cc649e7498fe4618557c13b1f98692c2d1f7 (patch)
tree60b6492f3238f47765eb57efa905b6a230dc250c /gdb/testsuite/gdb.python
parentf8c4f480201a0ec57a9b9597c0ed91e7594c462a (diff)
downloadgdb-fff5cc649e7498fe4618557c13b1f98692c2d1f7.zip
gdb-fff5cc649e7498fe4618557c13b1f98692c2d1f7.tar.gz
gdb-fff5cc649e7498fe4618557c13b1f98692c2d1f7.tar.bz2
2010-04-08 Phil Muldoon <pmuldoon@redhat.com>
PR python/11417 * python/py-lazy-string.c (stpy_convert_to_value): Check for a NULL address. (gdbpy_create_lazy_string_object): Allow strings with a NULL address and a zero length. 2010-04-08 Phil Muldoon <pmuldoon@redhat.com> * gdb.python/py-value: Add null string variable. (test_lazy_string): Test zero length, NULL address lazy strings.
Diffstat (limited to 'gdb/testsuite/gdb.python')
-rw-r--r--gdb/testsuite/gdb.python/py-value.c2
-rw-r--r--gdb/testsuite/gdb.python/py-value.exp6
2 files changed, 7 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.python/py-value.c b/gdb/testsuite/gdb.python/py-value.c
index 80bc1e9..be933b3 100644
--- a/gdb/testsuite/gdb.python/py-value.c
+++ b/gdb/testsuite/gdb.python/py-value.c
@@ -59,7 +59,7 @@ main (int argc, char *argv[])
int *p = a;
int i = 2;
int *ptr_i = &i;
-
+ const char *sn = 0;
s.a = 3;
s.b = 5;
u.a = 7;
diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp
index 2b18e02..3bfa173 100644
--- a/gdb/testsuite/gdb.python/py-value.exp
+++ b/gdb/testsuite/gdb.python/py-value.exp
@@ -267,6 +267,12 @@ proc test_lazy_strings {} {
gdb_py_test_silent_cmd "python lstr = sptr.lazy_string()" "Aquire lazy string" 1
gdb_test "python print lstr.type" "const char \*." "Test type name equality"
gdb_test "python print sptr.type" "const char \*." "Test type name equality"
+ gdb_test "print sn" "0x0"
+ gdb_py_test_silent_cmd "python snptr = gdb.history (0)" "Get value from history" 1
+ gdb_test "python snstr = snptr.lazy_string(length=5)" ".*Cannot create a lazy string with address.*" "Test lazy string"
+ gdb_py_test_silent_cmd "python snstr = snptr.lazy_string(length=0)" "Succesfully create a lazy string" 1
+ gdb_test "python print snstr.length" "0" "Test lazy string length"
+ gdb_test "python print snstr.address" "0" "Test lazy string address"
}