I got a problem when I try to debug list iteration in C ++.
I made a simple test application:
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; }
During debugging, when I am in the line marked with an arrow, when I step over, it starts to enter the code from the C ++: "list" file. I have to step over 15 times until it finally gets into the code inside the for statement.
This issue only occurs in Xcode 4.4. In Xcode 4.3, debugging works fine.
There are several different scenarios with different results:
- Use LLVM GCC 4.2 as a compiler -> It works fine.
- Use the Apple LLVM 4.0 compiler and install the libstdC ++ library (GNU C ++ standard library) for the C ++ standard library → It works fine.
- Apple LLVM 4.0 compiler and lib ++ set (LLVM ++ standard library with ++ 11 support) for ++ standard library → The problem occurs.
In the project I'm working on, we use Apple LLVM compiler 4.0 and lib ++ (the standard LLVM C ++ library with C ++ 11 support), so I need to solve this problem for scenario 3).
Does anyone know what could happen, and if there is a fix for it?
source share