This is the mail archive of the gdb-prs@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]

c++/2169: cant step into more than 1 function call on a single line


>Number:         2169
>Category:       c++
>Synopsis:       cant step into more than 1 function call on a single line
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 08 21:28:02 UTC 2006
>Closed-Date:
>Last-Modified:
>Originator:     intangir@gmail.com
>Release:        unknown-1.0
>Organization:
>Environment:
Ubuntu 6.06, gdb 6.4
>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 ;(
>How-To-Repeat:
make some code that makes a function call with args that are returns from other function calls

step into the function call (it calls the functions to get the args first, if you stepover while in those functions that returns args it will step over the rest the line in the original scope)

int givea() { return 1; }
int giveb() { return 2; }

void functioniwanttostepinto(int a, int b)
{
  int c = a + b; // try and debug to THIS line. it is a pain
  // even more so if there are TONS of nested calls
  // and overloaded operators
}

void main()
{
  functioniwanttostepinto(givea(), giveb()); // *
}

* when you step into that line it steps into givea or giveb first, and unless you step into EACH LINE in both givea AND giveb, then you cant step into 'functioniwanttostepinto'

and if there is alot of code in givea, giveb it becomes a huge pain in the ass..

>Fix:
when stepping over (or stepping out) of a function that was called from a line that has more than 1 function call, when it returns to the calling scope, it should break on the same line  it originally stepped in from. this way you can step into more function calls on the same line

this is how visual studio does it, and going from visual studio to gdb .. this feature is SOOORELY missed on more complex c++ code
>Release-Note:
>Audit-Trail:
>Unformatted:


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