Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Paul Koning <pkoning@equallogic.com>
To: lecroart@nevrax.com
Cc: gdb@sources.redhat.com
Subject: Re: displaying source after and before the program counter
Date: Mon, 15 Dec 2003 15:47:00 -0000	[thread overview]
Message-ID: <16349.55181.215376.985034@gargle.gargle.HOWL> (raw)
In-Reply-To: <uad5u1815.fsf@elta.co.il>

>>>>> "Eli" == Eli Zaretskii <eliz@elta.co.il> writes:

 >> From: "Vianney Lecroart" <lecroart@nevrax.com> Date: Mon, 15 Dec
 >> 2003 11:50:09 +0100
 >> 
 >> The problem is that CPhrase::update() is a big function in a cpp
 >> file. I would like to know the line where the call to mpvi.h:527
 >> is made. I can't see it because the function is inlining and it's
 >> an accessor, so, it's called at least 50 times on this function.
 >> 
 >> The question is: Is it possible to know where in the function
 >> ::update() the crash happened?

 Eli> Without turning off the inlining, yes?

 Eli> Well, one way to do that is to look at the machine code in frame
 Eli> #3 (by using the `disassemble' command), then compare that with
 Eli> the assembly generated by the compiler for the source code in
 Eli> question.

Here's another approach:

Invoke the program via gdb.  Set a breakpoint at the address shown in
the call stack.  Start the program.

When the breakpoint hits, step to the next line ("n") until you're
back in the cpp file.  You're now near the inline function call you
need, most likely at the next line.  (Perhaps not quite, depending on
how much the optimizer has moved things around.

    paul


  reply	other threads:[~2003-12-15 15:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1071484872.21849.ezmlm@sources.redhat.com>
2003-12-15 10:50 ` Vianney Lecroart
2003-12-15 14:16   ` Eli Zaretskii
2003-12-15 15:47     ` Paul Koning [this message]
2003-12-15 15:53   ` 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=16349.55181.215376.985034@gargle.gargle.HOWL \
    --to=pkoning@equallogic.com \
    --cc=gdb@sources.redhat.com \
    --cc=lecroart@nevrax.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