Debug with 7.6.2: single-step jumps erratically

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Debug with 7.6.2: single-step jumps erratically

670 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mch0 on Tue Feb 17 10:34:38 MST 2015
Hi,

I have recently updated to 7.6.2 (full license).
Right now I'm seeing a very strange behaviour of the Debugger:

When using "step into" (F5) the location of the current line (to be executed next) shown in the source file jumps erratically.
Up to the last version (7.5.x) this never happened and I did not change the project.

Setup:
OS: Win8.1
Probe: LPCLink2
Target: LPC4330
Access method: JTAG

I have repeatedly cleaned up the project and recompiled to make as sure as I can that the symbol table and whatever other information may be used to correlate the source files to the binary are up to date.

The effect is always the same:

1. Program is downloaded to RAM (OK)
2. Debugger stops exection at Reset-ISR (OK)
3. Next BP is main, stops there (OK)

Now I begin to "step into" with F5

The next BP I would expect to be set on the first line of the called function (body).

Example: I "step into" nm06_init();

That function looks like this:

void nm06_init(void)
{
nm06_init_clocks(24000000);
nm06_init_pins();
}

4. After F5 the BP (as shown in the source window) is on the second line: nm06_init_pins() (NOT OK);

5. The next F5 dives into that function, this time at least correctly to the first body line (OK).

6. The next F5 all of a sudden jumps back to the calling function, this time the first line: nm06_init_clocks(24000000) (NOT OK);


7. The next F5 goes to the second line, as in step 4 (NOT OK, no step-in)

8. Next F5 goes to the second line of that function (like a continuation of step 5)

9: Next F5: back to the caller, line 1, like step 6

10: Next F5 dives now into that function (as expected)

The breakpoints as shown in the source window continue to jump back and forth the same way as described above. It does "progress", however in this way through the program.
I get the feeling that something is out of sync.
However I have no idea what to do, since cleaning/recompiling everything does not seem to help.

The target program does work, BTW.

However, debugging is obviously impossible this way.

What could I do to get it in working order again?

Best regards,

Mike

0 Kudos
Reply
2 Replies

641 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mch0 on Tue Feb 17 12:07:45 MST 2015
Hi R2D2,

I was using O3 (on that project) and set it back to Og.
Debugging now seems to behave as expected again on a very short test.
Thanks a lot!  :)

(I normally to not use any optimization during development, don't know when I set that to level 3.
Either it was something that happened during the update from 7.5.x to 7.6.2 or I had in on before and the new tool chain transforms the code in a new way with O3)

I'm really relieved now, even de- and reinstalled 7.6.2 to no avail before.


Greetings,

Mke
0 Kudos
Reply

641 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Tue Feb 17 11:11:34 MST 2015

Quote: mch0
What could I do to get it in working order again?



Which optimization are you using?

See: http://www.lpcware.com/content/faq/lpcxpresso/compiler-optimization

Did you try to use Instruction Stepping?

See: http://www.lpcware.com/content/faq/lpcxpresso/disassembly-view
0 Kudos
Reply