aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.python/py-value.c2
-rw-r--r--gdb/testsuite/gdb.python/py-value.exp6
3 files changed, 13 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index b4a9dd92..2be54d7 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
2010-04-07 H.J. Lu <hongjiu.lu@intel.com>
* gdb.arch/i386-avx.c: New.
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"
}