Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Eli Zaretskii" <eliz@gnu.org>
To: Mark Kettenis <kettenis@gnu.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [COMMIT] Hardware watchpoints for new inf-ttrace.c module
Date: Sat, 04 Dec 2004 15:44:00 -0000	[thread overview]
Message-ID: <01c4da15$Blat.v2.2.2$6fb640c0@zahav.net.il> (raw)
In-Reply-To: <200412041336.iB4Da3RB000849@elgar.sibelius.xs4all.nl> (message from Mark Kettenis on Sat, 4 Dec 2004 14:36:03 +0100 (CET))

> Date: Sat, 4 Dec 2004 14:36:03 +0100 (CET)
> From: Mark Kettenis <kettenis@gnu.org>
> CC: gdb-patches@sources.redhat.com
> 
> In principle, the HP-UX way of implementing watchpoints is pretty
> generic, and could work on any system that allows GDB to fiddle with
> memory page protetections.  As such, I think this would indeed be
> good information to have in the internals manual.

Indeed.

> (Note that this code is just a clean re-implementation of code that's
> already present in infttrace.c.)

Right.  infttrace.c had much more elaborate commentary, though.
However, if we will have the necessary explanations in the manual, I
think your current comments are enough; I, for one, had no trouble
figuring out what the code does.

>    Hmmm... wouldn't it be better to have just one function that adds an
>    address's page to the dictionary?  Or do you see a situation where a
>    call to inf_ttrace_add_page will not be immediately followed by
>    incrementing page->refcount?  I generally find it undesirable to have
>    two or more functions whose names and purpose comments are synonyms
>    ("add page" and "insert page").  It is confusing for a programmer who
>    needs to use the functionality, and usually forces to read the code to
>    understand how to DTRT.
> 
> Yes, it is somewhat confusing, although I don't really see how I can
> avoid having two functions without duplicating code.

Well, I thought about simply putting the code of inf_ttrace_add_page
inline into inf_ttrace_insert_page.  Any reasons why not?

>    I was going to ask why not try to support rwatch and awatch, but then
>    I realized that you cannot implement target_stopped_data_address, and
>    that in turn made it clear that gdbint.texinfo is inaccurate when it
>    describes the watchpoint-related primitives.  I will fix the manual
>    shortly.
> 
> Didn't realize that.  I might be able to implement
> target_stopped_data_address though, although there are some 32x64-bit
> cross-debugging issues here.  I haven't really looked into it yet
> though, since my primary goal is to implement everything that the
> current HP-UX native GDB supports.

If awatch and rwatch can be supported, I think that would be a
valuable addition to the HP-UX port.


      reply	other threads:[~2004-12-04 15:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-03 22:31 Mark Kettenis
2004-12-04 13:36 ` Eli Zaretskii
2004-12-04 14:07   ` Mark Kettenis
2004-12-04 15:44     ` Eli Zaretskii [this message]

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='01c4da15$Blat.v2.2.2$6fb640c0@zahav.net.il' \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kettenis@gnu.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