This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: gdb unable to print fn argument correctly
> 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
>