Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Andrew Burgess <aburgess@broadcom.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] hardware watchpoints turned off, inferior not yet started
Date: Wed, 16 Oct 2013 12:32:00 -0000	[thread overview]
Message-ID: <525E8761.8060405@redhat.com> (raw)
In-Reply-To: <525E5EB6.4070305@broadcom.com>

On 10/16/2013 10:39 AM, Andrew Burgess wrote:
> The following seems confusing to me:
> 
> $ gdb -q watch.x
> Reading symbols from /some/path/to/watch.x...done.
> (gdb) set can-use-hw-watchpoints 0
> (gdb) watch -l my_var 
> Hardware watchpoint 1: -location my_var
> (gdb) 
> 
> Notice that despite turning hardware watchpoints off
> the watchpoint created is reported to be a hardware
> watchpoint.  Once I actually start the inferior the
> watchpoint is downgraded to a software watchpoint,
> but still, this feels like it might cause confusion,
> and is pretty easy to fix.

It seems wrong to me to create it as bp_hardware_watchpoint
in the first place.  That's done in watch_command_1, with:

  if (accessflag == hw_read)
    bp_type = bp_read_watchpoint;
  else if (accessflag == hw_access)
    bp_type = bp_access_watchpoint;
  else
    bp_type = bp_hardware_watchpoint;

If "can-use-hw-watchpoints" is off, then I think it'd
be also better to prohibit creating read and access
watchpoints around here.

> @@ -1800,6 +1800,8 @@ update_watchpoint (struct watchpoint *b, int reparse)
>        /* Without execution, memory can't change.  No use to try and
>  	 set watchpoint locations.  The watchpoint will be reset when
>  	 the target gains execution, through breakpoint_re_set.  */
> +      if (!can_use_hw_watchpoints)
> +	b->base.type = bp_watchpoint;
>      }

... this change I think makes it so that access/read
watchpoints get converted to software watchpoints, which is wrong.

-- 
Pedro Alves


  reply	other threads:[~2013-10-16 12:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-16  9:39 Andrew Burgess
2013-10-16 12:32 ` Pedro Alves [this message]
2013-10-16 15:43   ` Andrew Burgess
2013-10-16 16:28     ` Pedro Alves
2013-10-18  9:14       ` Andrew Burgess
2013-10-18 14:37         ` Andrew Burgess
2013-10-18 15:33           ` Pedro Alves
2013-10-18 16:26             ` Andrew Burgess
2013-10-18 15:26         ` Pedro Alves
2013-10-18 15:43           ` Andrew Burgess
2013-11-07 12:21 Jose E. Marchesi
2013-11-08 12:03 ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=525E8761.8060405@redhat.com \
    --to=palves@redhat.com \
    --cc=aburgess@broadcom.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox