Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <dan@codesourcery.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>,
	Philippe Waroquiers <philippe.waroquiers@skynet.be>
Cc: robert song <robertsong.japan@gmail.com>,
	gdb@sourceware.org,	Tom Tromey <tromey@redhat.com>,
	Julian Seward <jseward@acm.org>
Subject: Re: Why no hwatch command in gdb ?
Date: Fri, 11 Mar 2011 17:48:00 -0000	[thread overview]
Message-ID: <20110311174833.GA20786@caradoc.them.org> (raw)
In-Reply-To: <1EA6FE6B4A03417898402C2C707CADAB@soleil> <20110310134453.GA11068@host1.jankratochvil.net>

On Thu, Mar 10, 2011 at 02:44:53PM +0100, Jan Kratochvil wrote:
> Hi Robert,
> 
> On Thu, 10 Mar 2011 13:18:06 +0100, robert song wrote:
> > Well, I am confused with the gdb hardware watchpoint support in x86
> > arch.
> 
> x86* is special as its debug registers capabilities are complicated - it can
> watch 1/2/4/8 bytes and there are 4 of them.  GDB supports aliasing, so if you
> watch string[0] and string[1] GDB will merge it and will watch 2 bytes at
> &string[0].

FWIW, I don't consider this unusually complicated.  MIPS, Power, and
other architectures all have hardware watchpoint features that you
can't express to GDB at all.  I do consider GDB's automatic combining
of watchpoints to be unusually complicated.

On Fri, Mar 11, 2011 at 08:58:11AM +0100, Philippe Waroquiers wrote:
> >Why can't this be negotiated between gdb and the remote?
> >Then the in-valgrind gdbserver could just report unlimited and the user
> >wouldn't have to fool around.
> This is for sure the best approach. This would be a new approach,
> that would be a general solution, matching various hardware (and
> not only the "Valgrind hardware"). I suppose the same approach
> should be done for "non remote" hardware watchpoints.

I am strongly of the opinion that we should support advanced
watchpoint capabilities.  But the details of what can be watched on a
given target are complicated.  Either we need a way to tell GDB what
the requirements are, flexibly, or we need to ask the target to
validate requests.

Every architecture has unique watchpoint features.  For instance, on
MIPS you can watch an address mask, and you can choose to match a
specific ASID or globally.  A good MIPS graphical debugger ought to be
able to pop up a dialog that lets you configure these settings.  But
they share resources with GDB's expression watchpoints.

It's an interesting problem :-)

-- 
Daniel Jacobowitz
Mentor Graphics


  parent reply	other threads:[~2011-03-11 17:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-10  7:25 robert song
2011-03-10  8:12 ` Jan Kratochvil
2011-03-10 10:09   ` robert song
2011-03-10 10:34     ` Jan Kratochvil
2011-03-10 11:26       ` Eli Zaretskii
2011-03-10 11:34         ` Joel Brobecker
2011-03-10 12:27           ` Pedro Alves
2011-03-10 11:55         ` Jan Kratochvil
2011-03-10 14:47           ` Frank Ch. Eigler
2011-03-10 12:18       ` robert song
2011-03-10 13:45         ` Jan Kratochvil
2011-03-10 14:47           ` Philippe Waroquiers
2011-03-10 21:04             ` Tom Tromey
2011-03-11  7:58               ` Philippe Waroquiers
2011-03-11 17:48           ` Daniel Jacobowitz [this message]
2011-03-10  8:23 paawan oza

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=20110311174833.GA20786@caradoc.them.org \
    --to=dan@codesourcery.com \
    --cc=gdb@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=jseward@acm.org \
    --cc=philippe.waroquiers@skynet.be \
    --cc=robertsong.japan@gmail.com \
    --cc=tromey@redhat.com \
    /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