From: Pedro Alves <palves@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: Pedro Alves <palves@redhat.com>,
gdb-patches@sourceware.org, Eli Zaretskii <eliz@gnu.org>
Subject: Re: [PATCH] breakpoint always inserted in record target
Date: Tue, 24 Apr 2012 13:18:00 -0000 [thread overview]
Message-ID: <4F96A708.6060804@redhat.com> (raw)
In-Reply-To: <4F94FB8C.2020906@codesourcery.com>
On 04/23/2012 07:49 AM, Yao Qi wrote:>
> +static void
> +record_sync_record_breakpoints (struct bp_location *loc, void *data)
> +{
> + /* Catchpoints and tracepoints should be skipped.
> + TODO: something else should be done for watchpoints, and test cases
> + are needed in testsuite/gdb.reverse for tracepoints, catchpoints, and
> + watchpoints. */
It's not clear to me that something _is_ indeed needed. If it is, best
would be a PR. If not needed, then it's better not to add this comment
in the first place, as these tend to remain in the sources forever, misleading.
IOW, please drop the comment.
> + if (is_tracepoint (loc->owner) || is_catchpoint (loc->owner)
> + || is_watchpoint (loc->owner))
> + return;
This function should only concert itself about what it knows to handle, instead
of skip what it doesn't know about. We don't want to need to add handling for
other types here if/when they're added to breakpoint.c in the future.
But also, it's really the location's type that matters, not the breakpoint's.
target_insert_breakpoint concerns itself with software breakpoints, so this
would be better:
if (loc->loc_type != bp_loc_software_breakpoint)
return;
Okay with these changes.
> +
> + if (loc->inserted)
> + {
> + struct record_breakpoint *bp = XNEW (struct record_breakpoint);
> +
> + bp->addr = loc->target_info.placed_address;
> + bp->address_space = loc->target_info.placed_address_space;
> +
> + bp->in_target_beneath = 1;
> +
> + VEC_safe_push (record_breakpoint_p, record_breakpoints, bp);
> + }
> +}
--
Pedro Alves
next prev parent reply other threads:[~2012-04-24 13:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-11 13:16 Yao Qi
2012-04-11 18:15 ` Keith Seitz
2012-04-13 2:03 ` Yao Qi
2012-04-13 9:47 ` Eli Zaretskii
2012-04-13 16:00 ` Pedro Alves
2012-04-23 6:57 ` Yao Qi
2012-04-24 13:18 ` Pedro Alves [this message]
2012-04-24 15:00 ` [committed]: " Yao Qi
2012-04-12 5:16 ` Doug Evans
2012-04-12 5:33 ` Yao Qi
2012-04-12 19:40 ` Doug Evans
2012-04-12 20:22 ` Tom Tromey
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=4F96A708.6060804@redhat.com \
--to=palves@redhat.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=yao@codesourcery.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