From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5203 invoked by alias); 12 Jul 2004 23:14:59 -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 5162 invoked from network); 12 Jul 2004 23:14:55 -0000 Received: from unknown (HELO gizmo10ps.bigpond.com) (144.140.71.20) by sourceware.org with SMTP; 12 Jul 2004 23:14:55 -0000 Received: (qmail 15724 invoked from network); 12 Jul 2004 22:51:01 -0000 Received: from unknown (HELO psmam01.bigpond.com) (144.135.25.69) by gizmo10ps.bigpond.com with SMTP; 12 Jul 2004 22:51:01 -0000 Received: from cpe-203-51-249-49.qld.bigpond.net.au ([203.51.249.49]) by psmam01.bigpond.com(MAM REL_3_4_2a 65/15337916) with SMTP id 15337916; Tue, 13 Jul 2004 09:14:52 +1000 Message-ID: <40F31B6B.2070204@neurizon.net> Date: Mon, 12 Jul 2004 23:15:00 -0000 From: Steven Johnson User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.6) Gecko/20040115 MIME-Version: 1.0 To: Wolfgang Schmieder CC: cerickson@mvista.com, gdb@sources.redhat.com Subject: Re: hardware watchpoints for ppc References: <200407041103.55619.wolfgang.schmieder@onlinehome.de> <200407062229.18395.wolfgang.schmieder@onlinehome.de> <40EB0C0D.8020806@mvista.com> <200407122203.27610.wolfgang.schmieder@onlinehome.de> In-Reply-To: <200407122203.27610.wolfgang.schmieder@onlinehome.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-07/txt/msg00118.txt.bz2 Wolfgang, Are you running GDB on your PowerPC Target? Or are you using a stub of some kind? The Stub isnt GDB. What PowerPC chip are you talking about, they all have different features when it comes to debug units, there is no standard "watchpoint" unit that all PowerPC's have. I would guess you are using GDB on you PC, and it is talking to your target using the Remote Serial Protocol. If so, the place for your watchpoint code is in the stub, not in GDB. The remote serial protocol already has support for hardware watchpoints, my stub on PowerPC uses it to implement them for an MPC860 Family processor. You need to add the support to your stub, alternatively write some macros in GDB to manually set up the watchpoint units, using register read/write operations. GDB wont know you have done this, but if when they hit its causes your stub to stop you have achieved what you want. As for the know how, the MPC860 documentation details that family of processor's watchpoint unit, and what it does. Its cryptic, and you have to trial and error it a bit, but that is usually the way with these things. Your processor should have a document that describes if it has a hardware watchpoint unit, and if so how to set it up. Then it is a matter of implementing the Remote Serial protocol watchpoint commands. Steven. Wolfgang Schmieder wrote: >Hello Cal, > >thanks for the hint. I caught the problem in the meanwhile by checking the >respective address in piece of code which is called very often. It took a lot >of time and luck. >This way of catching bugs is really hard. Do you know how I could >obtain the know how to implement hardware watchpoints into the gdb ? > >Regards > Wolfgang > > >Am Dienstag, 6. Juli 2004 22:31 schrieben Sie: > > >>Wolfgang, >>We had a similar problem here with some benchmarks we were doing. A >>particular address was being changed at random and we had to find >>what was doing it. So we put a watchpoint on the address and when >>it changed we stopped the process and did a bt to find the culprit. >>It took a while but it worked. This was on a PPC 860 target board >>using a cross built gdb and gdbserver. So it can be done it just >>takes time and patience. >> >>The only processor family that I know that has hardware watchpoints is >>x86. We work here with x86, ppc, mips, arm, xscale, crusoe, and sh. >> >>Cal >> >>Wolfgang Schmieder wrote: >> >> >>>Hello Cal, >>> >>>thanks for your anwer, even if it's bad news for me ! >>> >>> >>>Regards >>> Wolfgang >>> >>>Am Dienstag, 6. Juli 2004 16:45 schrieb Cal Erickson: >>> >>> >>>>Wolfgang, >>>>>From what I know there are no hardware watchpoints available on the PPC >>>>target boards. You might just try watch which will create a software >>>>watchpoint. These do work on PPC processors. >>>> >>>>Cal >>>> >>>>Wolfgang Schmieder wrote: >>>> >>>> >>>>>Hello, >>>>> >>>>>is there anybody who knows how I can set hardware watchpoints on ppc >>>>>boards ? I have a mpc855 board running a multithreaded application. It >>>>>appears that one thread (always the same thread) has a corrupted stack >>>>>(always at the same address). I guess I need to set a hardware >>>>>watchpoint in a remote debugging session to find the piece of code >>>>>which is corrupting the stack. >>>>> >>>>>There is one gdb mailing list thread about "supporting hw break/watch >>>>>for embedded ppc", which makes me think that there is at least a patch >>>>>or workaround available to set hardware watchpoints on a ppc board. >>>>> >>>>>Thanks, >>>>> >>>>>Wolfgang >>>>> >>>>> > > > > >