public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/17981] New: gdb.breakpoints() returns None if there are no breakpoints; should return empty sequence
@ 2015-02-16 15:12 jason.heeris at gmail dot com
  0 siblings, 0 replies; only message in thread
From: jason.heeris at gmail dot com @ 2015-02-16 15:12 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17981

            Bug ID: 17981
           Summary: gdb.breakpoints() returns None if there are no
                    breakpoints; should return empty sequence
           Product: gdb
           Version: 7.7
            Status: NEW
          Severity: normal
          Priority: P2
         Component: python
          Assignee: unassigned at sourceware dot org
          Reporter: jason.heeris at gmail dot com

The docs for 'gdb.breakpoints()' say:

> Return a sequence holding all of gdb's breakpoints.

If there are no breakpoints, I'd expect an empty sequence to be returned.
Instead, I get None. If you assume the return value is always a sequence, type
errors will ensue.

Workaround: add something like 'bps = bps if (bps is not None) else []' after
calling 'gdb.breakpoints()'.

Output of 'gdb --version':

GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1

Output of "pi" then "import sys; print(sys.version)" from inside GDB:

3.4.0 (default, Apr 11 2014, 13:08:40) 
[GCC 4.8.2]

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-16  2:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-16 15:12 [Bug python/17981] New: gdb.breakpoints() returns None if there are no breakpoints; should return empty sequence jason.heeris at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).