This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [COMMIT] Hardware watchpoints for new inf-ttrace.c module
> 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.