This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: displaying source after and before the program counter


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

Without turning off the inlining, yes?

Well, one way to do that is to look at the machine code in frame #3
(by using the `disassemble' command), then compare that with the
assembly generated by the compiler for the source code in question.
For the latter, invoke GCC exactly as it is invoked to compile the cpp
file which includes mpvi.h, but with the -S switch instead of the -c
switch.  (There are also switches that you can add to cause the
generated assembly to include source lines, which will make it easier
for you to associate the assembly with the source.)

HTH


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]