Code in can_use_hardware_watchpoint()

Michael Snyder msnyder@cygnus.com
Thu Aug 19 22:45:00 GMT 1999


J.T. Conklin wrote:
> 
> The problem is that a expression containing a register variable will
> not cause this function to fail (return 0).  This seems to result in
> GDB forging ahead and placing a hardware watchpoint at a random
> address for the register variable.  An example of this is something
> like 'watch mem[reg] != 0'.
> [...]
> One solution is to add an:
> 
>       else if (v->lval == lval_register)
>         return 0;

I'm leaning toward agreeing with this...

> 
> But I'm wondering if instead the v->modifiable == 0 should be == 1
> instead.

Could you elaborate on that thought?
I'm not sure I understand why the function should give a negative
return if a subexpression is not_lval and !modifiable.  Is it 
trying to detect constants?  Or what?

				Michael


More information about the Gdb mailing list