From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3576 invoked by alias); 21 Apr 2002 03:25:32 -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 3568 invoked from network); 21 Apr 2002 03:25:31 -0000 Received: from unknown (HELO localhost.redhat.com) (24.112.240.27) by sources.redhat.com with SMTP; 21 Apr 2002 03:25:31 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 863FE3D1A for ; Sat, 20 Apr 2002 23:25:29 -0400 (EDT) Message-ID: <3CC23129.3080700@cygnus.com> Date: Sat, 20 Apr 2002 20:25:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.9) Gecko/20020328 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [patch:arm] Don't use NUM_PSEUDO_REGS in arm_gdbarch_init() Content-Type: multipart/mixed; boundary="------------010001040102030409000504" X-SW-Source: 2002-04/txt/msg00709.txt.bz2 This is a multi-part message in MIME format. --------------010001040102030409000504 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 464 Hello, The macro NUM_PSEUDO_REGS refers to ``current_gdbarch'' and not ``gdbarch''. Hence the equation in the patch was picking up the number of pseudo-registers from the previously selected architecture (which may not even be ARM), outch! No wonder macro's are bad :-) The attached calls gdbarch_num_pseudo_regs() directly with the correct architecture. (It also fixes a core dump that my next patch will cause ...) Committed as fairly obvious. Andrew --------------010001040102030409000504 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 675 2002-04-20 Andrew Cagney * arm-tdep.c (arm_gdbarch_init): Use gdbarch_num_pseudo_regs instead of NUM_PSEUDO_REGS. Index: arm-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/arm-tdep.c,v retrieving revision 1.48 diff -u -r1.48 arm-tdep.c --- arm-tdep.c 19 Feb 2002 19:20:31 -0000 1.48 +++ arm-tdep.c 21 Apr 2002 03:15:38 -0000 @@ -3015,7 +3015,8 @@ prologue_cache.saved_regs = (CORE_ADDR *) xcalloc (1, (sizeof (CORE_ADDR) - * (gdbarch_num_regs (gdbarch) + NUM_PSEUDO_REGS))); + * (gdbarch_num_regs (gdbarch) + + gdbarch_num_pseudo_regs (gdbarch)))); return gdbarch; } --------------010001040102030409000504--