From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10336 invoked by alias); 21 Jul 2005 22:55:27 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 10305 invoked by uid 22791); 21 Jul 2005 22:55:20 -0000 Received: from e31.co.us.ibm.com (HELO e31.co.us.ibm.com) (32.97.110.129) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 21 Jul 2005 22:55:20 +0000 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e31.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j6LMtIU6485266 for ; Thu, 21 Jul 2005 18:55:18 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VERS6.7) with ESMTP id j6LMtIvD403616 for ; Thu, 21 Jul 2005 16:55:18 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.13.3) with ESMTP id j6LMtI59022365 for ; Thu, 21 Jul 2005 16:55:18 -0600 Received: from austin.ibm.com (netmail2.austin.ibm.com [9.41.248.176]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j6LMtHDD022351; Thu, 21 Jul 2005 16:55:17 -0600 Received: from lazy.austin.ibm.com (lazy.austin.ibm.com [9.53.94.97]) by austin.ibm.com (8.12.10/8.12.10) with ESMTP id j6LMtHkg120612; Thu, 21 Jul 2005 17:55:17 -0500 Date: Thu, 21 Jul 2005 22:55:00 -0000 From: Manoj Iyer X-X-Sender: manjo@lazy To: Daniel Jacobowitz cc: gdb@sources.redhat.com Subject: Re: gdb unable to print fn argument correctly In-Reply-To: <20050721201010.GA18155@nevyn.them.org> Message-ID: References: <20050721201010.GA18155@nevyn.them.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2005-07/txt/msg00219.txt.bz2 > Check what instruction ($pc) GDB has stopped on. The debug info is > valid only at or after 0x10000458. What does the line table look like? > > > ==== Disassembly of void fn3(double c){} ======================= > > fn3() > > [5] 10000448: 94 21 ff e0 stwu r1, -32(r1) > > 1000044c: 93 e1 00 1c stw r31, 28(r1) > > 10000450: 7c 3f 0b 78 mr r31, r1 > > 10000454: d8 3f 00 08 stfd fr1, 8(r31) > > 10000458: 81 61 00 00 lwz r11, 0(r1) > > 1000045c: 83 eb ff fc lwz r31, -4(r11) > > 10000460: 7d 61 5b 78 mr r1, r11 > > 10000464: 4e 80 00 20 blr > > ================================================================== > GDB stopped on the instruction at 0x...10000544, which is 10000544: d8 3f 00 70 stfd f1,112(r31). Here is what my line table looks like: ================ line table ================= Compilation Unit Number 6: length 58, version 2, prolog length 27 Minimum instruction length: 4 Default is statement: 1 Line base: -5 Line range: 14 Opcode base: 10 Opcode lengths: 0 1 1 1 1 0 0 0 1 Include Directories: File Names Table: File Directory Last Modified Size Name 1 0 Dec 31 18:00:00 1969 0 test1.c Line Column Address File ---- ------ ------- ---- 1 3 0 0x100004e4 test1.c 2 4 0 0x10000510 test1.c 3 5 0 0x10000538 test1.c 4 9 0 0x10000560 test1.c 5 10 0 0x10000574 test1.c 6 11 0 0x1000057c test1.c 7 12 0 0x10000588 test1.c 8 13 0 0x10000594 test1.c 9 14 0 0x10000598 test1.c ================== enf of line table =========================== ================ GDB output ==================================== (gdb) br main Breakpoint 1 at 0x10000574: file test1.c, line 10. (gdb) br fn3 Breakpoint 2 at 0x10000544: file test1.c, line 5. (gdb) r Starting program: /tmp/test1.gdb Breakpoint 1, main () at test1.c:10 10 fn1(1234); (gdb) c Continuing. Breakpoint 2, 0x0000000010000544 in fn3 (c=6.0995758190771502e-316) at test1.c:5 5 void fn3(double c){} ================================================================ =========== disassembly of fn3 ================================= 0000000010000538 <.fn3>: 10000538: fb e1 ff f8 std r31,-8(r1) 1000053c: f8 21 ff c1 stdu r1,-64(r1) 10000540: 7c 3f 0b 78 mr r31,r1 10000544: d8 3f 00 70 stfd f1,112(r31) 10000548: e8 21 00 00 ld r1,0(r1) 1000054c: eb e1 ff f8 ld r31,-8(r1) 10000550: 4e 80 00 20 blr ... 1000055c: 80 01 00 01 lwz r0,1(r1) =======================================================