This is the mail archive of the gdb-patches@sourceware.cygnus.com 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]

Re: awatch and rwatch vs watch


>>>>> "Eli" == Eli Zaretskii <eliz@delorie.com> writes:
Eli> Here's a fragment from watch_command_1:
Eli>   if (accessflag == 1) bp_type = bp_read_watchpoint;
Eli>   else if (accessflag == 2) bp_type = bp_access_watchpoint;
Eli>   else bp_type = bp_hardware_watchpoint;
Eli>
Eli>   mem_cnt = can_use_hardware_watchpoint (val);
Eli>   if (mem_cnt == 0 && bp_type != bp_hardware_watchpoint)
Eli>     error ("Expression cannot be implemented with read/access watchpoint.");

Eli> Why is bp_hardware_watchpoint treated specially here?  

A hardware watchpoint, which triggers if an expression has changed (ie
a value is written), is the only type of watchpoint that can currently
be demoted to a software watchpoint.  To implement awatch or rwatch in
software, you'd have to examine each instruction as it is stepped to 
determine if a value in a watchpoint expression was accessed or read.

        --jtc

-- 
J.T. Conklin
RedBack Networks

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