gdb: remove bp_location_pointer_iterator

Remove the bp_location_pointer_iterator layer.  Adjust all users of
breakpoint::locations to use references instead of pointers.

Change-Id: Iceed34f5e0f5790a9cf44736aa658be6d1ba1afa
Reviewed-By: Andrew Burgess <aburgess@redhat.com>
This commit is contained in:
Simon Marchi 2023-05-10 11:30:34 -04:00
parent 20afe380e8
commit b00b30b298
10 changed files with 172 additions and 181 deletions

View file

@ -752,14 +752,14 @@ bppy_get_locations (PyObject *self, void *closure)
if (list == nullptr)
return nullptr;
for (bp_location *loc : self_bp->bp->locations ())
for (bp_location &loc : self_bp->bp->locations ())
{
gdbpy_ref<py_bploc_t> py_bploc
(PyObject_New (py_bploc_t, &breakpoint_location_object_type));
if (py_bploc == nullptr)
return nullptr;
bp_location_ref_ptr ref = bp_location_ref_ptr::new_reference (loc);
bp_location_ref_ptr ref = bp_location_ref_ptr::new_reference (&loc);
/* The location takes a reference to the owner breakpoint.
Decrements when they are de-allocated in bplocpy_dealloc */
Py_INCREF (self);