This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Re: Code in can_use_hardware_watchpoint()
- To: gdb@sourceware.cygnus.com
- Subject: Re: Code in can_use_hardware_watchpoint()
- From: Michael Snyder <msnyder@cygnus.com>
- Date: Thu, 19 Aug 1999 22:30:26 -0700
- DJ-Gateway: from newsgroup cygnus.gdb
- Newsgroups: cygnus.gdb
- Organization: Cygnus Solutions
- References: <5mu2q3jl6i.fsf@jtc.redbacknetworks.com>
- Reply-To: msnyder@cygnus.com
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