From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6817 invoked by alias); 12 Aug 2008 18:30:31 -0000 Received: (qmail 6793 invoked by uid 22791); 12 Aug 2008 18:30:29 -0000 X-Spam-Check-By: sourceware.org Received: from igw1.br.ibm.com (HELO igw1.br.ibm.com) (32.104.18.24) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 12 Aug 2008 18:29:40 +0000 Received: from mailhub3.br.ibm.com (mailhub3 [9.18.232.110]) by igw1.br.ibm.com (Postfix) with ESMTP id 8761E32C126 for ; Tue, 12 Aug 2008 15:00:44 -0300 (BRT) Received: from d24av02.br.ibm.com (d24av02.br.ibm.com [9.18.232.47]) by mailhub3.br.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m7CITaSh1867886 for ; Tue, 12 Aug 2008 15:29:36 -0300 Received: from d24av02.br.ibm.com (loopback [127.0.0.1]) by d24av02.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m7CITTgQ004528 for ; Tue, 12 Aug 2008 15:29:29 -0300 Received: from [9.18.200.161] ([9.18.200.161]) by d24av02.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m7CITS4K004459 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 12 Aug 2008 15:29:29 -0300 Subject: Re: [commit] Fix broken watchpoints (Re: [patch-ppc] Hardware watchpoint support for 44x/BookE-based systems) From: Luis Machado Reply-To: luisgpm@linux.vnet.ibm.com To: Ulrich Weigand Cc: gdb-patches@sourceware.org In-Reply-To: <200808121823.m7CINwv1010170@d12av02.megacenter.de.ibm.com> References: <200808121823.m7CINwv1010170@d12av02.megacenter.de.ibm.com> Content-Type: text/plain Date: Tue, 12 Aug 2008 18:30:00 -0000 Message-Id: <1218565770.5813.27.camel@gargoyle> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-08/txt/msg00322.txt.bz2 Stupid typo. Thanks for fixing this. Luis On Tue, 2008-08-12 at 20:23 +0200, Ulrich Weigand wrote: > Luis Machado wrote: > > > * ppc-linux-nat.c: Include "auxv.h" and "elf/common.h". > > Define PPC_FEATURE_BOOKE. > > (ppc_linux_get_hwcap): New function. > > (ppc_linux_region_ok_for_hw_watchpoint): Handle PowerPC 440 > > 4-bytes alignment restrictions. > > (ppc_linux_insert_watchpoint): Handle PowerPC 440-specific > > positioning of the read/write flags. > > (ppc_linux_watchpoint_addr_within_range): Handle PowerPC 440 > > 4-bytes alignment. > > unfortunately this patch completely broke watchpoint support for me on Cell. > The reason is that this routine: > > >+/* Fetch the AT_HWCAP entry from the aux vector. */ > >+unsigned long ppc_linux_get_hwcap (void) > >+{ > >+ CORE_ADDR field; > >+ > >+ if (target_auxv_search (¤t_target, AT_PLATFORM, &field)) > >+ return (unsigned long) field; > > really needs to fetch AT_HWCAP, *not* AT_PLATFORM (which is a string). > > Fixed by the patch below. Tested on powerpc-linux and powerpc64-linux > (on Cell/B.E.), checked into mainline. > > Bye, > Ulrich > > > ChangeLog: > > * ppc-linux-nat.c (ppc_linux_get_hwcap): Really get AT_HWCAP. > > > diff -urNp gdb-orig/gdb/ppc-linux-nat.c gdb-head/gdb/ppc-linux-nat.c > --- gdb-orig/gdb/ppc-linux-nat.c 2008-08-12 19:13:15.793562000 +0200 > +++ gdb-head/gdb/ppc-linux-nat.c 2008-08-12 19:49:17.363981345 +0200 > @@ -835,7 +835,7 @@ unsigned long ppc_linux_get_hwcap (void) > { > CORE_ADDR field; > > - if (target_auxv_search (¤t_target, AT_PLATFORM, &field)) > + if (target_auxv_search (¤t_target, AT_HWCAP, &field)) > return (unsigned long) field; > > return 0; >