From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13444 invoked by alias); 28 Jul 2008 20:10:33 -0000 Received: (qmail 13434 invoked by uid 22791); 28 Jul 2008 20:10:32 -0000 X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 28 Jul 2008 20:10:12 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KNZ2k-0005vz-6S for gdb@sources.redhat.com; Mon, 28 Jul 2008 20:10:06 +0000 Received: from entropy.qnx.com ([209.226.137.107]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 28 Jul 2008 20:10:06 +0000 Received: from aristovski by entropy.qnx.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 28 Jul 2008 20:10:06 +0000 To: gdb@sources.redhat.com From: Aleksandar Ristovski Subject: PowerPC prologue analysis Date: Mon, 28 Jul 2008 20:13:00 -0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-07/txt/msg00280.txt.bz2 Hello, In the code, in rs6000-tdep.c around line 3334, there is a comment stating: /* if != -1, fdata.saved_gpr is the smallest number of saved_gpr. All gpr's from saved_gpr to gpr31 are saved. */ I am, however, witnessing a function that appears to be saving r30, but not r31 (see the disassembly below). This, in turn, causes gdb to unwind r31 from a 'saved' area even though the area does not exist. I am not very familiar with PowerPC ABI, but from what I gather reading the "function call" section, but can not see where is it stated that if r30 is saved, then r31 must be saved too? But again, I haven't studied the ABI very thoroughly and might be missing that line. Just for the reference, here is the disassembly of the function: (gdb) disassemble foo Dump of assembler code for function foo 0xfe346aa0 : stwu r1,-16(r1) 0xfe346aa4 : mflr r0 0xfe346aa8 : bl 0xfe37ca18 0xfe346aac : mr r4,r3 0xfe346ab0 : stw r30,8(r1) 0xfe346ab4 : mflr r30 0xfe346ab8 : li r5,0 0xfe346abc : li r6,0 0xfe346ac0 : stw r0,20(r1) 0xfe346ac4 : lwz r3,-176(r30) 0xfe346ac8 : bl 0xfe37d738 0xfe346acc : lwz r0,20(r1) 0xfe346ad0 : lwz r30,8(r1) 0xfe346ad4 : addi r1,r1,16 0xfe346ad8 : mtlr r0 0xfe346adc : blr End of assembler dump. Thanks, Aleksandar Ristovski QNX Software Systems