Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Emi SUZUKI <emi-suzuki@tjsys.co.jp>
To: brobecker@adacore.com
Cc: gdb-patches@sourceware.org
Subject: Re: Watchpoint on an unloaded shared library(1)
Date: Tue, 16 Dec 2008 12:16:00 -0000	[thread overview]
Message-ID: <20081216.211520.207584606.emi-suzuki@tjsys.co.jp> (raw)
In-Reply-To: <20081213150517.GE6866@adacore.com>

Hello Joel,

Thank you for reviewing!

From: Joel Brobecker <brobecker at adacore.com>
Subject: Re: Watchpoint on an unloaded shared library(1)
Date: Sat, 13 Dec 2008 19:05:17 +0400

> How about replace all the code that's inside
> 
>   if (bpt->type == bp_watchpoint || 
>       bpt->type == bp_hardware_watchpoint ||
>       bpt->type == bp_read_watchpoint ||
>       bpt->type == bp_access_watchpoint)
>     {
>       [re-create a lot of stuff for our watchpoint...]
> 
> by a call to update_watchpoint (bpt, 1)?  Would that work in your case? 

It works without merging the missing code each other, as long as we
don't have to care the hardware watchpoint resource count here: if the
user sets other watchpoints while the disabled hardware watchpoints
exist, re-enabling the disabled ones might fail out of the shortage of
resources.  

Actually, calling update_watchpoint without resource checking works on
almost all the target which has the hardware watchpoint resources,
since TARGET_CAN_USE_HARDWARE_WATCHPOINT always returns 1 on those
targets.  Instead of stop enabling watchpoints in do_enable_breakpoint, 
out of the watchpoint resources would be reported to the user when GDB
actually address to them by target_insert_watchpoint.  

This mechanism does not work on ppc-linux native target which has
DABR: it would just overwrite the register value each time when
target_insert_watchpoint is called.  However, I've found that the
watchpoint resource count checking feature itself does not work at all
on that target...  ppc_linux_check_watch_resources, which replaces
TARGET_CAN_USE_HARDWARE_WATCHPOINT on a ppc-linux target build, never
return the negative value.  

Maybe we should revise them separately...

> When I looked at what update_watchpoint does and what do_enable_breakpoint
> does for watchpoints, it seemed to me that do_enable_breakpoint was trying
> to do the same, except that it was missing a few pieces. Does anybody see
> a reason for the code almost-duplication here?

I know at least when `update_watchpoint' was introduced:

  http://sourceware.org/ml/gdb-patches/2008-01/msg00543.html

In the thread includes the above mail, Jim Blandy and Vladmir Plus
discussed about the timing of refreshing watchpoint expressions and
changed some of them.  I guess that those codes have got more smilar
along with they rebuild the logic.  


My best regards, 
-- 
Emi SUZUKI / emi-suzuki at tjsys.co.jp


  reply	other threads:[~2008-12-16 12:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-20 18:25 Emi SUZUKI
2008-12-13 15:06 ` Joel Brobecker
2008-12-16 12:16   ` Emi SUZUKI [this message]
2008-12-21 13:11     ` Joel Brobecker
2008-12-22  3:28       ` Joel Brobecker
2008-12-25 11:28         ` Emi SUZUKI
2008-12-26  6:11           ` Joel Brobecker
2008-12-26  7:09             ` Emi SUZUKI
2008-12-28 11:48               ` Joel Brobecker
2009-01-06  1:47                 ` Emi SUZUKI
2009-01-06  4:28                   ` Joel Brobecker
2009-01-06  5:16                     ` Emi SUZUKI
2009-01-08  4:02                     ` [commit] " Emi SUZUKI

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=20081216.211520.207584606.emi-suzuki@tjsys.co.jp \
    --to=emi-suzuki@tjsys.co.jp \
    --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