Re: Watchpoint on an unloaded shared library(1)

Joel Brobecker
2008-12-13T15:06:04Z

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