From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27558 invoked by alias); 13 Oct 2004 16:42:52 -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 27506 invoked from network); 13 Oct 2004 16:42:49 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 13 Oct 2004 16:42:49 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.10) with ESMTP id i9DGgnel001087 for ; Wed, 13 Oct 2004 12:42:49 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i9DGgnr15423 for ; Wed, 13 Oct 2004 12:42:49 -0400 Received: from localhost.localdomain (vpn50-43.rdu.redhat.com [172.16.50.43]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id i9DGgm2m007973 for ; Wed, 13 Oct 2004 12:42:49 -0400 Received: from saguaro (saguaro.lan [192.168.64.2]) by localhost.localdomain (8.12.11/8.12.10) with SMTP id i9DGgh0F020062 for ; Wed, 13 Oct 2004 09:42:43 -0700 Date: Wed, 13 Oct 2004 16:42:00 -0000 From: Kevin Buettner To: gdb-patches@sources.redhat.com Subject: [PATCH] rs6000-tdep.c: Eliminate references to deprecated_registers[] Message-Id: <20041013094243.718fb9bd@saguaro> Organization: Red Hat Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2004-10/txt/msg00231.txt.bz2 I've just committed the patch below. Tested on powerpc-ibm-aix4.3.3.0 with no observed change to any of the results. * rs6000-tdep.c (rs6000_push_dummy_call): Replace references to ``deprecated_registers'' with equivalent code. Use gdb_assert() instead of explicit test and print statement. Index: rs6000-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v retrieving revision 1.229 diff -u -p -r1.229 rs6000-tdep.c --- rs6000-tdep.c 9 Aug 2004 18:43:21 -0000 1.229 +++ rs6000-tdep.c 13 Oct 2004 16:24:40 -0000 @@ -1478,14 +1478,11 @@ rs6000_push_dummy_call (struct gdbarch * There are 13 fpr's reserved for passing parameters. At this point there is no way we would run out of them. */ - if (len > 8) - printf_unfiltered ("Fatal Error: a floating point parameter " - "#%d with a size > 8 is found!\n", argno); - - memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE - (tdep->ppc_fp0_regnum + 1 + f_argno)], - VALUE_CONTENTS (arg), - len); + gdb_assert (len <= 8); + + regcache_cooked_write (regcache, + tdep->ppc_fp0_regnum + 1 + f_argno, + VALUE_CONTENTS (arg)); ++f_argno; } @@ -1495,12 +1492,15 @@ rs6000_push_dummy_call (struct gdbarch * /* Argument takes more than one register. */ while (argbytes < len) { - memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)], 0, - reg_size); - memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)], + char word[MAX_REGISTER_SIZE]; + memset (word, 0, reg_size); + memcpy (word, ((char *) VALUE_CONTENTS (arg)) + argbytes, (len - argbytes) > reg_size ? reg_size : len - argbytes); + regcache_cooked_write (regcache, + tdep->ppc_gp0_regnum + 3 + ii, + word); ++ii, argbytes += reg_size; if (ii >= 8) @@ -1513,9 +1513,11 @@ rs6000_push_dummy_call (struct gdbarch * { /* Argument can fit in one register. No problem. */ int adj = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? reg_size - len : 0; - memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)], 0, reg_size); - memcpy ((char *)&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)] + adj, - VALUE_CONTENTS (arg), len); + char word[MAX_REGISTER_SIZE]; + + memset (word, 0, reg_size); + memcpy (word, VALUE_CONTENTS (arg), len); + regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3 +ii, word); } ++argno; } @@ -1592,15 +1594,11 @@ ran_out_of_registers_for_arguments: if (TYPE_CODE (type) == TYPE_CODE_FLT && f_argno < 13) { - if (len > 8) - printf_unfiltered ("Fatal Error: a floating point parameter" - " #%d with a size > 8 is found!\n", argno); - - memcpy (&(deprecated_registers - [DEPRECATED_REGISTER_BYTE - (tdep->ppc_fp0_regnum + 1 + f_argno)]), - VALUE_CONTENTS (arg), - len); + gdb_assert (len <= 8); + + regcache_cooked_write (regcache, + tdep->ppc_fp0_regnum + 1 + f_argno, + VALUE_CONTENTS (arg)); ++f_argno; }