0

When stepping through code with the debugger using 'Step Into,' Xcode steps into constructors, destructors, and assignment operators. This is especially frustrating when the routine is compiler-supplied. Once a function has been debugged and is error-free, I'd like to be able to skip them during normal 'Step Into'.

Given this code:

#include <vector>

//-----------------------------------------------------------------------
class Object
{
  Object()
  {
    // Some initialization
  };
};

//-----------------------------------------------------------------------
class ObjectList : public std::vector<Object>
{
public:
  ObjectList()
  {
    // Some initialization
  };
};

//-----------------------------------------------------------------------
void TestFunction(ObjectList list)
{
// do something
}

//-----------------------------------------------------------------------
int main(int argc, const char * argv[])
{
  ObjectList    list;

  TestFunction(list);

  return 0;
}

When stepping through the above code, when you 'step into' TestFunction(ObjectList list), there is a copy construction of 'ObjectList,' as expected. Xcode jumps to the compiler-generated copy constructor, indicating the line being debugged is class ObjectList : public std::vector<Object> line, which tells me nothing. This makes 'step into' cumbersome.

I know you can 'Step Out' when you get there, but that is an additional step that must be recognized and acted upon when stepping and it interferes with the flow without adding any benefit. Of course, the TestFunction signature could be rewritten as void TestFunction(*const ObjectList &list*) to avoid the copy construction in this case, but I am looking for a general way to avoid the issue.

After I have debugged ObjectList and Object, I would like to tell Xcode not to ever step into any ObjectList or Object function - either on a function-by-function basis or class-by-class basis. Sort of like they would be handled if they were in a library and I didn't have the source code for them.

Is there a way to tell the debugger, "I don't want to 'Step Into' this function"?

0

You must log in to answer this question.

Browse other questions tagged .