Fix Python gdb.Breakpoint.location crash
authorTom Tromey <tom@tromey.com>
Tue, 18 Sep 2018 12:27:09 +0000 (06:27 -0600)
committerTom Tromey <tom@tromey.com>
Sun, 7 Oct 2018 04:17:45 +0000 (22:17 -0600)
commit2a8be20359dba9cc684fd3ffa222d985399f3b18
treecfd6e84fca0e481698a7f8ab984ae48beaac7b89
parent2fb009bbd1d65a837e5032e744ba30b49c7f472a
Fix Python gdb.Breakpoint.location crash

I noticed today that gdb.Breakpoint.location will crash when applied
to a catchpoint made with "catch throw".

The bug is that "catch throw" makes a breakpoint that is of type
bp_breakpoint, but which does not have a location.

Regression tested on x86-64 Fedora 28.

gdb/ChangeLog
2018-10-06  Tom Tromey  <tom@tromey.com>

* python/py-breakpoint.c (bppy_get_location): Handle a
bp_breakpoint without a location.

gdb/testsuite/ChangeLog
2018-10-06  Tom Tromey  <tom@tromey.com>

* gdb.python/py-breakpoint.exp (check_last_event): Check location
of a "throw" catchpoint.
gdb/ChangeLog
gdb/python/py-breakpoint.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.python/py-breakpoint.exp