This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
Re: c++/2169: cant step into more than 1 function call on a singleline
- From: Daniel Jacobowitz <drow at false dot org>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 18 May 2007 20:28:01 -0000
- Subject: Re: c++/2169: cant step into more than 1 function call on a singleline
- Reply-to: Daniel Jacobowitz <drow at false dot org>
The following reply was made to PR c++/2169; it has been noted by GNATS.
From: Daniel Jacobowitz <drow@false.org>
To: intangir@gmail.com, Thomas McGuire <thomas.mcguire@gmx.net>
Cc: gdb-gnats@sources.redhat.com
Subject: Re: c++/2169: cant step into more than 1 function call on a single
line
Date: Fri, 18 May 2007 16:23:39 -0400
Sorry I didn't see this report earlier.
On Fri, Sep 08, 2006 at 09:23:28PM -0000, intangir@gmail.com wrote:
> >Description:
> when debugging C++, if there is more than one call (or overloaded operators) on a single line, when you step in, it steps in the first call, if its not the one you wanted to step into you have to step into every single line in that function till you get back out to the original line you want to step into..
>
> if you step over then when it returns to the original scope it steps over the rest of the line that you needed to step into.. and you miss your chance to step into it ;(
Use "finish":
(gdb) start
Breakpoint 1 at 0x40056b: file z.cc, line 13.
Starting program: /space/codesourcery/mips64-build/z
main () at z.cc:13
13 functioniwanttostepinto(givea(), giveb()); // *
(gdb) s
giveb () at z.cc:2
2 int giveb() { return 2; }
(gdb) fin
Run till exit from #0 giveb () at z.cc:2
0x0000000000400570 in main () at z.cc:13
13 functioniwanttostepinto(givea(), giveb()); // *
Value returned is $1 = 2
(gdb) s
givea () at z.cc:1
1 int givea() { return 1; }
(gdb) fin
Run till exit from #0 givea () at z.cc:1
0x0000000000400577 in main () at z.cc:13
13 functioniwanttostepinto(givea(), giveb()); // *
Value returned is $2 = 1
(gdb) s
functioniwanttostepinto (a=1, b=2) at z.cc:6
6 int c = a + b; // try and debug to THIS line. it is a pain
The behavior that "next" steps over other calls on the same line is
unfortunate in your case, but deliberate - it makes some other cases
clearer.
--
Daniel Jacobowitz
CodeSourcery