* Novice gdb question
@ 2009-07-03 20:04 ikorot
2009-07-03 22:15 ` Daniel Jacobowitz
0 siblings, 1 reply; 5+ messages in thread
From: ikorot @ 2009-07-03 20:04 UTC (permalink / raw)
To: gdb
Hi, ALL
When I try to debug a program that has inline function (C++) with gdb
and MSVC debugger I get an incnsistent behavior.
Scenario:
I am stepping in the function that is inline:
class Foo
{
void inlineFunc( int param ) { m_member = param; };
void nonInlineFunc();
private:
int m_member;
};
Calling code:
Foo f;
...........
f.inlineFunc( 5 );
f.noninlineFunc();
Then I hit next.
Result:
In MSVC debugger, when I hit next standing on the inline function call
I will end up on the line "f.inlineFunc( 5 );"
In gdb when I hit next standing on the inline function call I will end up
on the line "f.noninlineFunc();"
Is it possible to make gdb aware of the inline-ness and make it work as MSVC
debugger?
Thank you.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Novice gdb question
2009-07-03 20:04 Novice gdb question ikorot
@ 2009-07-03 22:15 ` Daniel Jacobowitz
2009-07-05 0:19 ` Paul Pluzhnikov
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2009-07-03 22:15 UTC (permalink / raw)
To: ikorot; +Cc: gdb
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.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Novice gdb question
2009-07-03 22:15 ` Daniel Jacobowitz
@ 2009-07-05 0:19 ` Paul Pluzhnikov
0 siblings, 0 replies; 5+ messages in thread
From: Paul Pluzhnikov @ 2009-07-05 0:19 UTC (permalink / raw)
To: ikorot, gdb
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.
--
Paul Pluzhnikov
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Novice gdb question
2009-07-06 3:11 ikorot
@ 2009-07-06 3:26 ` Paul Pluzhnikov
0 siblings, 0 replies; 5+ messages in thread
From: Paul Pluzhnikov @ 2009-07-06 3:26 UTC (permalink / raw)
To: ikorot; +Cc: gdb
On Sun, Jul 5, 2009 at 8:11 PM, <ikorot@earthlink.net> wrote:
> Let me put some clarification on it.
I am afraid your clarifications didn't do much clarification (at least
for me :-(
> Consider following code snippet:
Compiled how? Did the 'inlineGetParam()' actually get inlined?
What does the MSVC disassembly show?
> In MSVC debugger and gdb, when I hit F11 standing on the line "f.Bar(....)", I will
> go to the "f.inilineFunc()" line.
Which are the same line; so your description of behavior you observe
continues to be confusing.
Perhaps if you post *complete* test case, with instructions on how to
build it, with the version of MSVC you used, and then describe what
you see in MSVC (using line numbers instead of ambiguous line
descriptions), then we can tell you whether you'll get the same,
better or worse behavior from the next version of GDB.
P.S. Your using of e-mail account with automatic sender verification
to post your questions is quite annoying (at least to me). If spam is
a real problem for you, perhaps try using Gmail? I get less than 1
spam message a week through.
Cheers,
--
Paul Pluzhnikov
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Novice gdb question
@ 2009-07-06 3:11 ikorot
2009-07-06 3:26 ` Paul Pluzhnikov
0 siblings, 1 reply; 5+ messages in thread
From: ikorot @ 2009-07-06 3:11 UTC (permalink / raw)
To: gdb
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-07-06 3:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-03 20:04 Novice gdb question ikorot
2009-07-03 22:15 ` Daniel Jacobowitz
2009-07-05 0:19 ` Paul Pluzhnikov
2009-07-06 3:11 ikorot
2009-07-06 3:26 ` Paul Pluzhnikov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox