aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2016-05-18 21:41:28 -0600
committerTom Tromey <tom@tromey.com>2016-05-24 09:55:01 -0600
commit1957f6b89f3db02d51e3e3361de6af073a03f19d (patch)
treef16c22933c767d6a756ad2c08b0f0c486de66e82 /gdb/testsuite
parent224f10c1ae5d815b6d2efddb479052b79ea4d256 (diff)
downloadgdb-1957f6b89f3db02d51e3e3361de6af073a03f19d.zip
gdb-1957f6b89f3db02d51e3e3361de6af073a03f19d.tar.gz
gdb-1957f6b89f3db02d51e3e3361de6af073a03f19d.tar.bz2
Fix PR python/17981
PR python/17981 notes that gdb.breakpoints() returns None when there are no breakpoints; whereas an empty list or tuple would be more in keeping with Python and the documentation. This patch fixes the bug by changing the no-breakpoint return to make an empty tuple. Built and regtested on x86-64 Fedora 23. 2016-05-23 Tom Tromey <tom@tromey.com> PR python/17981: * python/py-breakpoint.c (gdbpy_breakpoints): Return a new tuple when there are no breakpoints. 2016-05-23 Tom Tromey <tom@tromey.com> * python.texi (Basic Python): Document gdb.breakpoints return. 2016-05-23 Tom Tromey <tom@tromey.com> PR python/17981: * gdb.python/py-breakpoint.exp (test_bkpt_basic): Add test for no-breakpoint case.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.python/py-breakpoint.exp5
2 files changed, 10 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 16b756c..319c0f5 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2016-05-23 Tom Tromey <tom@tromey.com>
+
+ PR python/17981:
+ * gdb.python/py-breakpoint.exp (test_bkpt_basic): Add test for
+ no-breakpoint case.
+
2016-05-24 Pedro Alves <palves@redhat.com>
PR gdb/19828
diff --git a/gdb/testsuite/gdb.python/py-breakpoint.exp b/gdb/testsuite/gdb.python/py-breakpoint.exp
index d1d1b22..f501aa9 100644
--- a/gdb/testsuite/gdb.python/py-breakpoint.exp
+++ b/gdb/testsuite/gdb.python/py-breakpoint.exp
@@ -34,12 +34,15 @@ proc test_bkpt_basic { } {
# Start with a fresh gdb.
clean_restart ${testfile}
+ # We should start with no breakpoints.
+ gdb_test "python print (gdb.breakpoints())" "\\(\\)"
+
if ![runto_main] then {
fail "Cannot run to main."
return 0
}
- # Initially there should be one breakpoint: main.
+ # Now there should be one breakpoint: main.
gdb_py_test_silent_cmd "python blist = gdb.breakpoints()" \
"Get Breakpoint List" 0
gdb_test "python print (blist\[0\])" \