From: Thiago Jung Bauermann <bauerman@br.ibm.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch 1/2] Convert hardware watchpoints to use breakpoint_ops
Date: Mon, 08 Nov 2010 21:39:00 -0000 [thread overview]
Message-ID: <1289252326.11397.11.camel@hactar> (raw)
In-Reply-To: <20101108184335.GG2933@adacore.com>
On Mon, 2010-11-08 at 10:43 -0800, Joel Brobecker wrote:
> Just for the record, I've started looking at both patches, and already
> spent a good hour on them. But I think that I should give myself some
> time to to let every piece sink in, before I make an official review.
Thank you very much! I'll be glad to clarify any question that may come
up during your review of the patch. No need to think too hard about what
the patch does in some obscure part, I'll be glad to explain. :-)
> I urge another one of us to look at this change, because it's not
> completely obvious. In particular, I think it was my suggestion
> that prompted the move to using breakpoint_ops for watchpoints.
> But it's not obvious that there is a gain. I think the gain shows up
> in the second patch, where we avoid having:
Yes, I think the 2nd patch became cleaner when I modified it to use
breakpoint_ops. And yes, it was your idea. :-)
IMHO the code would be even cleaner if I/we ported the existing
breakpoints and watchpoints code completely to breakpoint_ops,
eliminating functions like print_it_typical. It would make this part of
GDB more object-oriented. Though it would perhaps increase the total
line count instead of decreasing it, so it's not a clear win.
> 1. To define new kinds for range and mask watchpoints
>
> 2. To program dispatching manually, Eg:
>
> if (bp->print_one)
> bp->print_one (...)
> else if (bp->type == hw_watchpoint)
> print_one_normal_watchpoint (...)
> else if (bp->type == range_watchpoint)
> print_one_range_watchpoint (...)
> else if (bp->type == mask_watchpoint)
> [...]
It also avoids adding special cases just for masked and ranged
watchpoints. Instead, I added a method to breakpoints_op and if it's
defined, I just call it. For instance, in update_watchpoint:
+ if (b->ops && b->ops->extra_resources_needed)
+ mem_cnt += b->ops->extra_resources_needed (b);
--
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center
next prev parent reply other threads:[~2010-11-08 21:39 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-17 19:41 Thiago Jung Bauermann
2010-10-07 14:47 ` Thiago Jung Bauermann
2010-10-16 17:43 ` Pedro Alves
2010-10-20 0:31 ` Thiago Jung Bauermann
2010-11-04 21:17 ` Thiago Jung Bauermann
2010-11-08 18:43 ` Joel Brobecker
2010-11-08 21:39 ` Thiago Jung Bauermann [this message]
2010-11-15 22:23 ` Joel Brobecker
2010-11-16 19:03 ` Thiago Jung Bauermann
2010-11-18 17:18 ` Joel Brobecker
2010-11-19 20:10 ` Thiago Jung Bauermann
2010-12-23 19:06 ` Thiago Jung Bauermann
2011-01-11 19:31 ` Thiago Jung Bauermann
2011-04-29 15:51 ` "Cannot remove breakpoints because program is no longer writable" & catchpoints (was: Re: [patch 1/2] Convert hardware watchpoints to use breakpoint_ops) Pedro Alves
2010-11-16 4:06 ` [patch 1/2] Convert hardware watchpoints to use breakpoint_ops Jan Kratochvil
2010-11-16 8:07 ` Joel Brobecker
2010-11-16 18:51 ` Jan Kratochvil
2010-11-17 3:47 ` [patch] Renaming: {insert,remove} += _location [Re: [patch 1/2] Convert hardware watchpoints to use breakpoint_ops] Jan Kratochvil
2010-11-18 17:13 ` Joel Brobecker
[not found] ` <20101117034556.GA12159@host0.dyn.jankratochvil.net>
2010-11-18 17:15 ` [patch] renaming: bp_location: b->bl &co. " Joel Brobecker
2010-12-23 18:50 ` Thiago Jung Bauermann
2010-12-24 5:14 ` Joel Brobecker
2010-12-27 20:04 ` Thiago Jung Bauermann
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=1289252326.11397.11.camel@hactar \
--to=bauerman@br.ibm.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
/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