public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Manoj Iyer <manjo@austin.ibm.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb@sources.redhat.com
Subject: Re: gdb unable to print fn argument correctly
Date: Tue, 26 Jul 2005 18:44:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.58.0507261310420.21929@lazy> (raw)
In-Reply-To: <20050721225943.GA22858@nevyn.them.org>




> 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
>

  reply	other threads:[~2005-07-26 18:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-21 20:06 Manoj Iyer
2005-07-21 20:10 ` Daniel Jacobowitz
2005-07-21 22:55   ` Manoj Iyer
2005-07-21 22:59     ` Daniel Jacobowitz
2005-07-26 18:44       ` Manoj Iyer [this message]
2005-07-27 18:10         ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.58.0507261310420.21929@lazy \
    --to=manjo@austin.ibm.com \
    --cc=drow@false.org \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).