From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3018 invoked by alias); 24 Jan 2009 02:25:19 -0000 Received: (qmail 3003 invoked by uid 22791); 24 Jan 2009 02:25:18 -0000 X-SWARE-Spam-Status: No, hits=0.1 required=5.0 tests=BAYES_00,J_CHICKENPOX_75,RCVD_NUMERIC_HELO X-Spam-Check-By: sourceware.org Received: from cmsout01.mbox.net (HELO cmsout01.mbox.net) (165.212.64.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 24 Jan 2009 02:25:11 +0000 Received: from cmsout01.mbox.net (cmsout01-lo [127.0.0.1]) by cmsout01.mbox.net (Postfix) with ESMTP id 5C2712ACE58 for ; Sat, 24 Jan 2009 02:25:09 +0000 (GMT) Received: from cmsapps01.cms.usa.net [165.212.11.136] by cmsout01.mbox.net via smtad (C8.MAIN.3.45U) with ESMTP id XID637NaXcZJ5104X01; Sat, 24 Jan 2009 02:25:09 -0000 X-USANET-Source: 165.212.11.136 IN darin@usa.net cmsapps01.cms.usa.net X-USANET-MsgId: XID637NaXcZJ5104X01 Received: from cmsweb07.cms.usa.net [165.212.8.20] by cmsapps01.cms.usa.net (ESMTP/darin@usa.net) via mtad (C8.MAIN.3.48O) with ESMTP id 301NaXcZH1472M36; Sat, 24 Jan 2009 02:25:07 -0000 X-USANET-Auth: 165.212.8.20 AUTO darin@usa.net cmsweb07.cms.usa.net Received: from 12.40.200.88 [12.40.200.88] by cmsweb07.cms.usa.net (USANET web-mailer CM.0402.7.94); Sat, 24 Jan 2009 02:25:06 -0000 Date: Sat, 24 Jan 2009 02:25:00 -0000 From: "DARIN JOHNSON" To: Subject: breakpoint on varargs function not working with PowerPC and hard-float Mime-Version: 1.0 Message-ID: <617NaXcyg3898S07.1232763906@cmsweb07.cms.usa.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Z-USANET-MsgId: XID301NaXcZH1472X36 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: 2009-01/txt/msg00161.txt.bz2 There seems to be a problem on PowerPC when setting a breakpoint on some functions. The breakpoint is placed on an address that will never be reached, so that GDB will not stop when stepping into that function. This occurs with PowerPC EABI (or SVR4), using hardware floating point, and with functions that have a variable number of arguments. This is using GDB 6.8.50 and GCC 3.4.4. I believe the problem is that this is a special case not handled by rs6000_skip_prologue(). Consider this function: void VarTest(const char* fmt, ...) { va_list argp; va_start( argp, fmt ); vfprintf(stdout, fmt, argp); } The following PowerPC code is generated as the preamble: .globl VarTest .type VarTest, @function VarTest: .loc 1 8 0 stwu %r1,-144(%r1) mflr %r0 stw %r31,140(%r1) stw %r0,148(%r1) mr %r31,%r1 stw %r4,12(%r31) stw %r5,16(%r31) stw %r6,20(%r31) stw %r7,24(%r31) stw %r8,28(%r31) stw %r9,32(%r31) stw %r10,36(%r31) bne %cr1,.L2 .loc 1 8 0 stfd %f1,40(%r31) stfd %f2,48(%r31) stfd %f3,56(%r31) stfd %f4,64(%r31) stfd %f5,72(%r31) stfd %f6,80(%r31) stfd %f7,88(%r31) stfd %f8,96(%r31) .L2: stw %r3,128(%r31) .LBB2: .LBB3: .loc 1 11 0 In this case, when I do "b VarTest" in GDB it puts the breakpoint at the first "stfd" instruction. But that instruction will never be executed if no floating point arguments were passed. SVR4 will only set that condition code if a floating point argument was passed. What seems to be happening is that skip_prologue_using_sal() assumes the second line number marker is the end of the prologue. Which is true normally, but not in this particular case. I suspect GCC is sticking the extra line marker here because of the branch. The rs6000_skip_prologue() function accepts the result from skip_prologue_using_sal(). But it probably should be checking for this special case. -- Darin Johnson