Improper stepping through source file during debug

Discussions concerning TrueSTUDIO for STM32 9.0.0 and later versions.

Moderators: Markus Girdland, Mattias Norlander

Trneal
Posts: 1
Joined: Mon Aug 06, 2018 1:38 am

Improper stepping through source file during debug

Postby Trneal » Mon Aug 06, 2018 1:47 am

I see a weird patten while debugging. Starting at the beginning of a debug session, I use the step over button and in the source file view the cursor will first stop at line 5, then go to line 1, then back to line 2,3,4,5,6 and then maybe back to line 5 again. All in a simple list of lines in the main function. In the disassembly listing, I see the same line associated with multiple memory addresses. I looked in the elf using dwarf dump and see multiple memory addresses associated with some of the source lines.

Can anyone help me with this?

Tom

reference
Posts: 5
Joined: Thu Jul 26, 2018 7:52 am

Re: Improper stepping through source file during debug

Postby reference » Mon Aug 06, 2018 1:30 pm

Are you sure you are debugging a DEBUG build? Stepping through an optimized RELEASE build would naturally be "strange" because the optimizer can rearrange/ignore/change some code.

Mattias Norlander
Posts: 262
Joined: Fri Apr 29, 2016 10:01 am

Re: Improper stepping through source file during debug

Postby Mattias Norlander » Wed Aug 08, 2018 1:29 pm

Certainly sounds like your stepping a binary built with optimization which is default for CubeMx projects.


Return to “TrueSTUDIO for STM32 discussions”

Who is online

Users browsing this forum: No registered users and 1 guest