mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 09:58:19 +08:00
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.
This commit is contained in:
@ -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\])" \
|
||||
|
Reference in New Issue
Block a user