From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3536 invoked by alias); 28 Sep 2005 07:41:33 -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 3472 invoked by uid 22791); 28 Sep 2005 07:41:21 -0000 Received: from omta03ps.mx.bigpond.com (HELO omta03ps.mx.bigpond.com) (144.140.82.155) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 28 Sep 2005 07:41:21 +0000 Received: from grove.modra.org ([144.136.167.90]) by omta03ps.mx.bigpond.com with ESMTP id <20050928074118.CGD12238.omta03ps.mx.bigpond.com@grove.modra.org> for ; Wed, 28 Sep 2005 07:41:18 +0000 Received: by bubble.grove.modra.org (Postfix, from userid 500) id 1BECB1CAF37; Wed, 28 Sep 2005 17:11:18 +0930 (CST) Date: Wed, 28 Sep 2005 07:41:00 -0000 From: Alan Modra To: gdb-patches@sources.redhat.com Subject: Fix PR1659 Message-ID: <20050928074118.GL29044@bubble.grove.modra.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-SW-Source: 2005-09/txt/msg00272.txt.bz2 Obvious fixes. OK to apply? PR 1659 * rs6000-tdep.c (rs6000_push_dummy_call): Correct size of backchain write. (rs6000_convert_from_func_ptr_addr): Correct comment Index: gdb/rs6000-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v retrieving revision 1.243 diff -u -p -r1.243 rs6000-tdep.c --- gdb/rs6000-tdep.c 19 Sep 2005 17:38:03 -0000 1.243 +++ gdb/rs6000-tdep.c 28 Sep 2005 07:36:48 -0000 @@ -1629,8 +1629,8 @@ ran_out_of_registers_for_arguments: regcache_raw_write_signed (regcache, SP_REGNUM, sp); /* Set back chain properly. */ - store_unsigned_integer (tmp_buffer, 4, saved_sp); - write_memory (sp, tmp_buffer, 4); + store_unsigned_integer (tmp_buffer, wordsize, saved_sp); + write_memory (sp, tmp_buffer, wordsize); /* Point the inferior function call's return address at the dummy's breakpoint. */ @@ -2241,13 +2241,13 @@ rs6000_create_inferior (int pid) Usually a function pointer's representation is simply the address of the function. On the RS/6000 however, a function pointer is - represented by a pointer to a TOC entry. This TOC entry contains + represented by a pointer to an OPD entry. This OPD entry contains three words, the first word is the address of the function, the second word is the TOC pointer (r2), and the third word is the static chain value. Throughout GDB it is currently assumed that a function pointer contains the address of the function, which is not easy to fix. In addition, the conversion of a function address to - a function pointer would require allocation of a TOC entry in the + a function pointer would require allocation of an OPD entry in the inferior's memory space, with all its drawbacks. To be able to call C++ virtual methods in the inferior (which are called via function pointers), find_function_addr uses this function to get the -- Alan Modra IBM OzLabs - Linux Technology Centre