Fix PR python/17981
authorTom Tromey <tom@tromey.com>
Thu, 19 May 2016 03:41:28 +0000 (21:41 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 24 May 2016 15:55:01 +0000 (09:55 -0600)
commit1957f6b89f3db02d51e3e3361de6af073a03f19d
treef16c22933c767d6a756ad2c08b0f0c486de66e82
parent224f10c1ae5d815b6d2efddb479052b79ea4d256
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.
gdb/ChangeLog
gdb/doc/ChangeLog
gdb/doc/python.texi
gdb/python/py-breakpoint.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.python/py-breakpoint.exp