From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32340 invoked by alias); 4 Dec 2004 15:27:43 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 32265 invoked from network); 4 Dec 2004 15:27:37 -0000 Received: from unknown (HELO balder.inter.net.il) (192.114.186.15) by sourceware.org with SMTP; 4 Dec 2004 15:27:37 -0000 Received: from zaretski (pns03-205-134.inter.net.il [80.230.205.134]) by balder.inter.net.il (Mirapoint Messaging Server MOS 3.3.7-GR) with ESMTP id DWU96194 (AUTH halo1); Sat, 4 Dec 2004 17:27:29 +0200 (IST) Date: Sat, 04 Dec 2004 15:44:00 -0000 From: "Eli Zaretskii" To: Mark Kettenis Message-ID: <01c4da15$Blat.v2.2.2$6fb640c0@zahav.net.il> Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=ISO-8859-1 CC: gdb-patches@sources.redhat.com In-reply-to: <200412041336.iB4Da3RB000849@elgar.sibelius.xs4all.nl> (message from Mark Kettenis on Sat, 4 Dec 2004 14:36:03 +0100 (CET)) Subject: Re: [COMMIT] Hardware watchpoints for new inf-ttrace.c module Reply-to: Eli Zaretskii References: <200412032224.iB3MOqUr021181@elgar.sibelius.xs4all.nl> <01c4d9fe$Blat.v2.2.2$30abc2e0@zahav.net.il> <200412041336.iB4Da3RB000849@elgar.sibelius.xs4all.nl> X-SW-Source: 2004-12/txt/msg00111.txt.bz2 > Date: Sat, 4 Dec 2004 14:36:03 +0100 (CET) > From: Mark Kettenis > 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.