From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30428 invoked by alias); 19 Mar 2002 14:59:06 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 30207 invoked from network); 19 Mar 2002 14:58:55 -0000 Received: from unknown (HELO localhost.redhat.com) (24.112.135.44) by sources.redhat.com with SMTP; 19 Mar 2002 14:58:55 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 100683DAB; Tue, 19 Mar 2002 09:58:55 -0500 (EST) Message-ID: <3C97522E.8090407@cygnus.com> Date: Tue, 19 Mar 2002 06:59:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.8) Gecko/20020210 X-Accept-Language: en-us MIME-Version: 1.0 To: Peter Jansen Cc: gdb@sources.redhat.com Subject: Re: Hardware Breakpoints References: <3C953BAE.897F8105@klaxoniqa.com> <3C953E59.7060708@cygnus.com> <3C954349.B1B5B446@klaxoniqa.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-03/txt/msg00176.txt.bz2 > Hi, > > >> > I'm trying to use hardware breakpoints in gdb (in the new >> > gdbarchitecture stuff) and cannot figure out how it all works. Are their >> > any gdbarch things for hardware breakpoints and watchpoints? >> > >> > Are there any targets that use hardware breakpoints and watchpoints in >> > the new gdbarch stuff? > >> >> No. But there is a reason. >> >> The existing h/w breakpoint macros should be moved to the target vector >> and not the architecture vector. This is because the target, and not >> the architecture, determines the presence of a breakpoint mechanism. >> >> Unfortunatly, so far, no one has made this change, sigh! >> >> Interested? > > > hmm, I have an embedded target and I connect to it via a JTAG box, so > the target has hardware breakpoints, I assume we need to define them in > avr-tdep.c and put the hooks in the correct place to tie it together? > > What I see at the moment is the breakpoint.c stuff has no connection to > the avr-tdep.c file and I cannot see how to define something in avr-tdep > and let breakpoint.c use it. > > Do you have some ideas about how this is supposed to work? At this point, things get confusing. I'll answer the ``supposed to work'' question (how it works, is people define those macros). Two possabilities: a. You're connecting to a remote target that supports the hardware breakpoint/watchpoint mechanism. GDB just sends h/w breakpoint requests through to the target. For this to work you need to hardwire (:-() up the hw_* functions in remote.c. (This shouldn't be hardwired. Instead it should be part of the target vector.) b. Your target doesn't have a remote h/w breakpoint mechanism but does have access to the h/w breakpoint registers. Implements h/w breakpoints locally by directly manipulating the relevant registers (i386 does this). For this to work you hardwire (:-() code in your *-tdep.c file to those macros. (This shouldn't be hardwired either. Instead, the target vector, realising that it can't implement h/w breakpoints directly should ask the architecture vector for assistance.) Andrew