This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Watchpoint on an unloaded shared library(1)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]