Dev-Cpp
Dev-Cpp copied to clipboard
For loop display in debugger
For pedagogical purposes in our computing courses, some of us like to introduce the "for" loop to new students by separating out the components on separate lines, and then inspecting in the debugger the exact control flow.
Unfortunately, at this time Dev-C++ incorrectly visualizes, after the body is executed, going back to the initializer segment (1st part), instead of the update segment (3rd part), which is what really happens. After that flow is correctly shown going to the test (2nd part), and then into the body. This can be seen in the attached screenshot (note the count has already iterated a few times).
It would be really lovely if the Dev-C++ debugger correctly showed return of control from the body of a "for" loop back to the update segment in a case like this.
In C++Builder using Clang, the debug behaviour is : [ top, comparison, top, action, increment ] .
In C++Builder Classic Compiler it is: [ top ] -> [ comparison, action, increment ]
In Dev-C++ and Code::Blocks, both using gcc, I get : [ top, comparison, action ]
I think this might be coming from gcc / gdb. Do you have experience with other compilers?