From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6402 invoked by alias); 26 Jul 2005 18:44:23 -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 6172 invoked by uid 22791); 26 Jul 2005 18:44:11 -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; Tue, 26 Jul 2005 18:44:11 +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 j6QIi77K260328 for ; Tue, 26 Jul 2005 14:44:07 -0400 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VERS6.7) with ESMTP id j6QIi79v372114 for ; Tue, 26 Jul 2005 12:44:07 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.12.11/8.13.3) with ESMTP id j6QIi7f1008729 for ; Tue, 26 Jul 2005 12:44:07 -0600 Received: from austin.ibm.com (netmail2.austin.ibm.com [9.41.248.176]) by d03av03.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j6QIi6gW008683; Tue, 26 Jul 2005 12:44:06 -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 j6QIi5Zi047508; Tue, 26 Jul 2005 13:44:05 -0500 Date: Tue, 26 Jul 2005 18:44: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: <20050721225943.GA22858@nevyn.them.org> Message-ID: References: <20050721201010.GA18155@nevyn.them.org> <20050721225943.GA22858@nevyn.them.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2005-07/txt/msg00245.txt.bz2 > On Thu, Jul 21, 2005 at 05:29:10PM -0500, Manoj Iyer wrote: > > GDB stopped on the instruction at 0x...10000544, which is 10000544: d8 > > 3f 00 70 stfd f1,112(r31). > > The prologue analyzer must have been invoked. One way to fix the > problem would be to find out why the prologue analyzer stopped before > this instruction. Search for skip_prologue. > Looks like skip_prolog was called consistantly on both working and non-working cases. Below is the output from GDB... Also, another question I have is, in utils.c, wrap_here(), where does the wrap_buffer gets initialized? if (wrap_buffer[0]) { *wrap_pointer = '\0'; fputs_unfiltered (wrap_buffer, gdb_stdout); } prints the arguments to the function among other things, so I am trying to identify who fills the wrap_buffer with information. ===================== non-working case ============== (gdb) br main rs6000-tdep.c: rs6000_skip_prologue(): 501 :: pc = 0x10000560 Breakpoint 1 at 0x10000574: file /tmp/test1.c, line 10. (gdb) br fn3 rs6000-tdep.c: rs6000_skip_prologue(): 501 :: pc = 0x10000538 Breakpoint 2 at 0x10000544: file /tmp/test1.c, line 5. (gdb) r Starting program: /tmp/test1 rs6000-tdep.c: rs6000_skip_prologue(): 501 :: pc = 0x10000560 rs6000-tdep.c: rs6000_skip_prologue(): 501 :: pc = 0x10000538 rs6000-tdep.c: rs6000_skip_prologue(): 501 :: pc = 0x10000560 rs6000-tdep.c: rs6000_skip_prologue(): 501 :: pc = 0x10000538 Breakpoint 1, main () at /tmp/test1.c:10 10 fn1(1234); (gdb) c Continuing. Breakpoint 2, 0x0000000010000544 in fn3 (c=6.0995758190771502e-316) at /tmp/test1.c:5 5 void fn3(double c){} (gdb) q The program is running. Exit anyway? (y or n) y ============================================================== ========== working case =================== (gdb) br main rs6000-tdep.c: rs6000_skip_prologue(): 501 :: pc = 0x100004ac Breakpoint 1 at 0x100004c0: file test.c, line 9. (gdb) br fn3 rs6000-tdep.c: rs6000_skip_prologue(): 501 :: pc = 0x10000470 Breakpoint 2 at 0x10000488: file test.c, line 5. (gdb) r Starting program: /tmp/test rs6000-tdep.c: rs6000_skip_prologue(): 501 :: pc = 0x100004ac rs6000-tdep.c: rs6000_skip_prologue(): 501 :: pc = 0x10000470 rs6000-tdep.c: rs6000_skip_prologue(): 501 :: pc = 0x100004ac rs6000-tdep.c: rs6000_skip_prologue(): 501 :: pc = 0x10000470 Breakpoint 1, main () at test.c:9 warning: Source file is more recent than executable. 9 fn1(1234); (gdb) c Continuing. Breakpoint 2, fn3 (c=1234.4567) at test.c:5 5 void fn3(double c){printf("hello world %lf\n", c);} (gdb) ========================================================= > > 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 > > If this is GCC output, then there ought to be two lines in each > function, the second marking the end of the prologue. Figure out why > there's only one in each of your small functions. > > -- > Daniel Jacobowitz > CodeSourcery, LLC >