This is the mail archive of the gdb@sourceware.org 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: Novice gdb question


Hi, Paul,
I'm sorry if my question was not clear enough.
Let me put some clarification on it.

-----Original Message-----
>From: Paul Pluzhnikov <ppluzhnikov@google.com>
>Sent: Jul 4, 2009 8:19 PM
>To: ikorot@earthlink.net, "gdb@sourceware.org" <gdb@sourceware.org>
>Subject: Re: Novice gdb question
>
>On Fri, Jul 3, 2009 at 3:15 PM, Daniel Jacobowitz<drow@false.org> wrote:
>> On Fri, Jul 03, 2009 at 01:04:16PM -0700, ikorot@earthlink.net wrote:
>>> Is it possible to make gdb aware of the inline-ness and make it work as MSVC
>>> debugger?
>>
>> Build GDB from CVS. ÂInline function support was added last week.
>
>It will work, but not the same way MSVC does.
>
>It's not clear from OP description whether he used debug (no actual
>inlining happening!) or optimized (AFAICT no source level debugging
>AFACT) build. In addition, at least in VC2008 there is no "next", only
>"step over" (F10) and "step into" (F11). Finally, if there actually is
>a version of MSVC which behaves as OP described, that behavior is
>arguably more broken that GDB's was before inline fixes.

Consider following code snippet:

class Foo
{
public:
       int inilineGetParam() { return m_member; };
       void Bar( int param );
private:
       int m_member;
}

int main()
{
     Foo f;
     f.Bar( f.inlineGetParam() );
    printf( "Done!");
}

In MSVC debugger and gdb, when I hit F11 standing on the line "f.Bar(....)", I will 
go to the "f.inilineFunc()" line. Now in MSVC hitting F10, brings me back to the line
"f.Bar(...)" so I can decide whether I want to go to the "printf" line or step inside "f.Bar"
In gdb saying "next", which I believe the same as F10 function in MSVC debugger, brings
me to the line with the "printf();"

If you are saying that this what will happen in the next release of gdb I will just wait for it.

Thank you.

>
>
>-- 
>Paul Pluzhnikov


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