This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH 1/2] Implement breakpoint_find_if
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: GDB Patches <gdb-patches at sourceware dot org>
- Date: Wed, 11 Mar 2015 14:14:42 -0400
- Subject: Re: [PATCH 1/2] Implement breakpoint_find_if
- Authentication-results: sourceware.org; auth=none
- References: <1426030105-15485-1-git-send-email-sergiodj at redhat dot com> <1426030105-15485-2-git-send-email-sergiodj at redhat dot com> <86mw3jhj78 dot fsf at gmail dot com>
On Wednesday, March 11 2015, Yao Qi wrote:
> Sergio Durigan Junior <email@example.com> writes:
>> My first thought was to share the ALL_BREAKPOINTS* macros on
>> gdb/breakpoint.h, but they use a global variable local to
>> gdb/breakpoint.c, and I did not want to share that variable. So, in
>> order to keep the minimal separation, I decided to implement this
>> way of iterating through the existing 'struct breakpoint *'.
> Yeah, I agree that we should keep these variables private.
>> This function was based on BFD's bfd_sections_find_if. If the
>> user-provided function returns 0, the iteration proceeds. Otherwise,
>> the iteration stops and the function returns the 'struct breakpoint *'
>> that is being processed. This means that the return value of this
>> function can be either NULL or a pointer to a 'struct breakpoint'.
> This is fine by me. breakpoint_find_if can be more widely used so that
> some other code in breakpoint.c can be moved out.
GPG key ID: 0x65FC5E36
Please send encrypted e-mail if possible