This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Add visible flag to breakpoints.
Phil Muldoon <pmuldoon@redhat.com> writes:
> Tom Tromey <tromey@redhat.com> writes:
>
>>>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:
>>
>> Phil> In this patch iteration I removed any form of storage/tracking of
>> Phil> breakpoints. Instead, as above, I placed a reference in the breakpoint
>> Phil> struct.
>>
>> I like this better.
>>
>> Phil> + if (internal && PyObject_IsTrue (internal))
>> Phil> + internal_bp = 1;
>>
>> PyObject_IsTrue can return -1 on failure, so this code must account for
>> that.
>
> Oops done. Thanks.
>
>> Phil> + int i = 0;
>> Phil> + ALL_BREAKPOINTS (b)
>>
>> This instance of ALL_BREAKPOINTS should probably be replaced with some
>> kind of callback API, like the other iterate_over_* functions in gdb.
>
> I wrote an iterate function for this, much like the inferior iterator.
> I noticed in py-inferior.c we do not account for an error when adding to a
> list. (I'm pretty sure I wrote that too :( I'll fix this later.
>
>> Phil> + {
>> Phil> + /* Not all breakpoints will have a companion Python object.
>> Phil> + Only breakpoints that were created via bppy_new, or
>> Phil> + breakpoints that were created externally and are tracked by
>> Phil> + the Python Scripting API. */
>> Phil> + if (b->py_bp_object)
>> Phil> + {
>> Phil> + if (PyTuple_SetItem (result, i, (PyObject *) b->py_bp_object) != 0)
>>
>> I think that cast to PyObject is unnecessary.
>
> As we use an iterator, we now set a list then convert it to an iterator
> later. ^^^^^^^^
I mean tuple here. Sorry for the confusion!
Cheers,
Phil