This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Watchpoint on an unloaded shared library(1)
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Emi SUZUKI <emi-suzuki at tjsys dot co dot jp>
- Cc: gdb-patches at sourceware dot org
- Date: Sat, 13 Dec 2008 19:05:17 +0400
- Subject: Re: Watchpoint on an unloaded shared library(1)
- References: <20081120.210657.01365938.emi-suzuki@tjsys.co.jp>
Emi,
Thanks for sending this patch.
> 2008-11-20 Emi Suzuki <emi-suzuki@tjsys.co.jp>
>
> * breakpoint.c (do_enable_breakpoint): Inform the user and
> return from the function if the expression of a watchpoint is
> invalid and cannot be updated.
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?
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?
--
Joel