From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 445 invoked by alias); 11 Oct 2006 10:13:14 -0000 Received: (qmail 434 invoked by uid 22791); 11 Oct 2006 10:13:14 -0000 X-Spam-Check-By: sourceware.org Received: from ausmtp04.au.ibm.com (HELO ausmtp04.au.ibm.com) (202.81.18.152) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 11 Oct 2006 10:13:10 +0000 Received: from sd0208e0.au.ibm.com (d23rh904.au.ibm.com [202.81.18.202]) by ausmtp04.au.ibm.com (8.13.6/8.13.5) with ESMTP id k9BAMM3w174898 for ; Wed, 11 Oct 2006 20:22:24 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.250.237]) by sd0208e0.au.ibm.com (8.13.6/8.13.6/NCO v8.1.1) with ESMTP id k9BAGDgF169442 for ; Wed, 11 Oct 2006 20:16:14 +1000 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id k9BACjQ9013261 for ; Wed, 11 Oct 2006 20:12:46 +1000 Received: from [9.181.133.215] ([9.181.133.215]) by d23av04.au.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k9BAChYo013179 for ; Wed, 11 Oct 2006 20:12:44 +1000 Message-ID: <452CC397.5050304@cn.ibm.com> Date: Wed, 11 Oct 2006 10:13:00 -0000 From: Wu Zhou User-Agent: Thunderbird 1.5.0.4 (X11/20060614) MIME-Version: 1.0 To: gdb@sourceware.org Subject: a question about rs6k's prologue analysis Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-10/txt/msg00060.txt.bz2 In function skip_prologue of rs6000-tdep.c, when it finds an instruction like "bl foo", and that it is not within the first three instructions of the prologue, the prologue analysis will stop. else if ((op & 0xfc000001) == 0x48000001) { /* bl foo, to save fprs??? */ fdata->frameless = 0; /* Don't skip over the subroutine call if it is not within the first three instructions of the prologue. */ if ((pc - fdata->func_start) > 8) break; .... } Any specific reason for this? I encountered some prologue code like this: 61a0: 7c 08 02 a6 mflr r0 61a4: 94 21 ff f0 stwu r1,-16(r1) 61a8: 93 e1 00 0c stw r31,12(r1) 61ac: 48 01 8a 81 bl 1ec2c <__JCR_END__+0x4> 61b0: 7f e8 02 a6 mflr r31 61b4: 90 01 00 14 stw r0,20(r1) In the first instruction, lr is saved in r0, its content is saved on stack at the last instruction. But between these two instruction, a "bl foo" instruction exists, which make skip_prologue return. In this scenario, gdb won't have any way to know where lr is saved on the stack. This might make the backtrace loops at this point. Could it be possible that we delete this conditional statement? I guess this will only make prologue analysis get a little longer. Any other impact? Or that some changes in the compiler's side is needed? But now that these code are already there, and it also seems that they work ok, I guess it is not very easy for compiler to change that. Any insight? Thanks a lot! Regards - Wu Zhou