diff options
Diffstat (limited to 'gdb/python/py-breakpoint.c')
-rw-r--r-- | gdb/python/py-breakpoint.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c index e1db674..94afd50 100644 --- a/gdb/python/py-breakpoint.c +++ b/gdb/python/py-breakpoint.c @@ -391,7 +391,12 @@ bppy_get_location (PyObject *self, void *closure) if (obj->bp->type != bp_breakpoint) Py_RETURN_NONE; - str = event_location_to_string (obj->bp->location.get ()); + struct event_location *location = obj->bp->location.get (); + /* "catch throw" makes a breakpoint of type bp_breakpoint that does + not have a location. */ + if (location == nullptr) + Py_RETURN_NONE; + str = event_location_to_string (location); if (! str) str = ""; return host_string_to_python_string (str); |