help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: About debugging constructors


From: Paul Pluzhnikov
Subject: Re: About debugging constructors
Date: Sun, 23 Sep 2007 21:09:42 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

"parag_paul@hotmail.com" <parag_paul@hotmail.com> writes:

> I have problem debugging the constructor of a class. The debugger does
> not step into it, it gets into some other line number,

This is usually the result of buggy compiler (incorrect line info
in the object), of optimization (inlining in particular can produce
very strange results), or of buggy debugger.

If I were you, I'd first insure that *all* sources that #include
the header for the "problem class" are compiled with '-g -O0'
(this is only important if the "problem ctor" is inlined), and then
try different version of gdb.

> I have changed the dir settings too. But it still shows some other
> line number.

The 'dir' has absolutely nothing to do with line number info; it
only helps gdb to find source (necessary only if source has moved
since the program was compiled, or on platforms where full pathname
to source is not recorded in the object file).

> Where does GDB fetch the line number information

Generic answer: from the info that compiler embedded into the
object files.

Specific answer: depends on your platform, which you didn't reveal.

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]