Code in can_use_hardware_watchpoint()

Eli Zaretskii eliz@gnu.org
Sun Aug 15 05:34:00 GMT 1999


  From: jtc@redback.com (J.T. Conklin) 
  Date: 13 Aug 1999 16:49:25 -0700

> I believe the enclosed code from can_use_hardware_watchpoint() has a
> problem, but I'm unsure of the proper fix.

As long as we are talking about this function, here's another
question: shouldn't the loop below return zero as soon as the first
value is found on the value chain that is NOT okay to watch (as the
macro TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT says)?

  for (; v; v = v->next)
    {
      if (v->lval == lval_memory)
        {
          if (TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT (TYPE_LENGTH (VALUE_TYPE (v))))
            found_memory_cnt++;
        }
      else if (v->lval != not_lval && v->modifiable == 0)
        return 0;
    }


More information about the Gdb mailing list