No longer able to line step C code.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User22827
Level 1
Level 1
5 sign-ins First question asked Welcome!
Hello, I'm using DAVE 4.5 to program XMC1302 Boot Kit and I'm no longer able to line step when debugging. When I debug a program it pauses at the default breakpoint but once I hit Resume, Step into, or Step over the program runs without stepping or stopping at other breakpoints. Only instruction stepping mode works. Does anyone know how I can get C code stepping working again? thanks.
0 Likes
1 Solution
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi,

Additionally if you have imported the project, make sure that you have followed the right procedure. Under import -> Infineon -> Dave project. Also make sure that the build is in debug mode and not in release mode. 
One more thing is to look for is optimization. If it is set to something else than "-O0", the compiler may optimize redundant code parts away, thus you may not be able to set breakpoints there anymore.
To check it 


Right click on project in project explorer -> "Properties", there you can go to "C/C++ Build" -> "Settings"
From there you can select in the "Tool Settings" tab:
"ARM-GCC C Compiler" -> "Optimization" -> "Optimization level" --> which you can set to -O0 to avoid any optimization. The end result is  slower/larger code, but you should be able to set breakpoints wherever you like.
"Debugging" -> "Debug level" --> which should be on "Default (-g)" to enable the compiler to generate the additional data in the binary for debugging

Best Regards,
Vasanth

View solution in original post

0 Likes
2 Replies
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi,

Are you facing the issue with all the projects ? If it is happening to only to this project could you please confirm whether you have imported the project form existing one ?

Best Regards,
Vasanth

0 Likes
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi,

Additionally if you have imported the project, make sure that you have followed the right procedure. Under import -> Infineon -> Dave project. Also make sure that the build is in debug mode and not in release mode. 
One more thing is to look for is optimization. If it is set to something else than "-O0", the compiler may optimize redundant code parts away, thus you may not be able to set breakpoints there anymore.
To check it 


Right click on project in project explorer -> "Properties", there you can go to "C/C++ Build" -> "Settings"
From there you can select in the "Tool Settings" tab:
"ARM-GCC C Compiler" -> "Optimization" -> "Optimization level" --> which you can set to -O0 to avoid any optimization. The end result is  slower/larger code, but you should be able to set breakpoints wherever you like.
"Debugging" -> "Debug level" --> which should be on "Default (-g)" to enable the compiler to generate the additional data in the binary for debugging

Best Regards,
Vasanth

0 Likes