public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Sergio Durigan Junior <sergiodj@redhat.com>
Cc: GDB Patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH 1/2] Implement breakpoint_find_if
Date: Wed, 11 Mar 2015 11:22:00 -0000	[thread overview]
Message-ID: <86mw3jhj78.fsf@gmail.com> (raw)
In-Reply-To: <1426030105-15485-2-git-send-email-sergiodj@redhat.com> (Sergio	Durigan Junior's message of "Tue, 10 Mar 2015 19:28:24 -0400")

Sergio Durigan Junior <sergiodj@redhat.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.

-- 
Yao (齐尧)

  reply	other threads:[~2015-03-11 11:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-10 23:28 [PATCH 0/2] Separate syscall catchpoint code from gdb/breakpoint.c Sergio Durigan Junior
2015-03-10 23:28 ` [PATCH 1/2] Implement breakpoint_find_if Sergio Durigan Junior
2015-03-11 11:22   ` Yao Qi [this message]
2015-03-11 18:18     ` Sergio Durigan Junior
2015-03-10 23:28 ` [PATCH 2/2] Create gdb/break-catch-syscall.c Sergio Durigan Junior
2015-03-11 11:32   ` Yao Qi
2015-03-11 18:15     ` Sergio Durigan Junior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86mw3jhj78.fsf@gmail.com \
    --to=qiyaoltc@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sergiodj@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).