This is the mail archive of the gdb@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: Code in can_use_hardware_watchpoint()


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

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