awatch and rwatch vs watch
J.T. Conklin
jtc@redback.com
Mon Aug 9 11:46:00 GMT 1999
>>>>> "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
More information about the Gdb-patches
mailing list