I am having a problem when I try to debug on a list iteration on c++.
I made a simple test app:
int main(int argc, const char * argv[])
{
// insert code here...
std::cout << "Hello, World!\n";
std::list<int> list;
list.push_back(1);
list.push_back(2);
--> list.push_back(3); //Line before step over
for (std::list<int>::const_iterator i = list.begin(); i != list.end(); i++)
{
std::cout << *i << std::endl;
}
return 0;
}
While debugging, when I am on the line marked with an arrow, when I step over, it starts stepping in on code from a c++ file: 'list'. I have to step over like 15 times until it finally gets to the code inside the for statement.
This issue only happens in Xcode 4.4. In Xcode 4.3 the debug works perfectly.
Here there are some different scenarios with different results:
- Use LLVM GCC 4.2 as the compiler → It works ok.
- Use Apple LLVM compiler 4.0 and set libstdc++ (GNU C++ standard library) for the C++ Standard library → It works ok.
- Apple LLVM compiler 4.0 and set libc++ (LLVM C++ standard library with C++11 support) for the C++ Standard library → The issue happens.
In the project I am working on, we are using Apple LLVM compiler 4.0 and libc++ (LLVM C++ standard library with C++11 support) so I need to solve this issue for scenario 3).
Does anybody knows what could be happening and if there is a fix for it?