From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16061 invoked by alias); 26 Aug 2002 23:29:45 -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 16052 invoked from network); 26 Aug 2002 23:29:42 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 26 Aug 2002 23:29:42 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu.redhat.com [172.16.52.200] (may be forged)) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id g7QNEll29244 for ; Mon, 26 Aug 2002 19:14:47 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g7QNTeu16756; Mon, 26 Aug 2002 19:29:40 -0400 Received: from romulus.sfbay.redhat.com (remus.sfbay.redhat.com [172.16.27.252]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id g7QNTde12388; Mon, 26 Aug 2002 16:29:39 -0700 Received: (from kev@localhost) by romulus.sfbay.redhat.com (8.11.6/8.11.6) id g7QNTbu00582; Mon, 26 Aug 2002 16:29:37 -0700 Date: Mon, 26 Aug 2002 16:52:00 -0000 From: Kevin Buettner Message-Id: <1020826232937.ZM581@localhost.localdomain> To: gdb-patches@sources.redhat.com Subject: [PATCH] rs6000-tdep.c: Undelete altivec_register_p() Cc: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-08/txt/msg00876.txt.bz2 I've just committed the patch below. It fixes gdb/667. Thanks to Adam Fedor for reporting this problem. I considered moving altivec_register_p() into ppc-linux-nat.c, but it seems likely that this function will be useful in other files as other native ports are made altivec aware. Thus, it makes more sense to leave it in rs6000-tdep.c. * rs6000-tdep.c (altivec_register_p): Restore function inadvertently deleted in 2002-08-20 commit. This function is still used by ppc-linux-nat.c. Index: rs6000-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v retrieving revision 1.80 diff -u -p -r1.80 rs6000-tdep.c --- rs6000-tdep.c 25 Aug 2002 15:18:41 -0000 1.80 +++ rs6000-tdep.c 26 Aug 2002 23:16:25 -0000 @@ -123,6 +123,17 @@ static void frame_get_saved_regs (struct struct rs6000_framedata * fdatap); static CORE_ADDR frame_initial_stack_address (struct frame_info *); +/* Is REGNO an AltiVec register? Return 1 if so, 0 otherwise. */ +int +altivec_register_p (int regno) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + if (tdep->ppc_vr0_regnum < 0 || tdep->ppc_vrsave_regnum < 0) + return 0; + else + return (regno >= tdep->ppc_vr0_regnum && regno <= tdep->ppc_vrsave_regnum); +} + /* Read a LEN-byte address from debugged memory address MEMADDR. */ static CORE_ADDR