Skipping over an instruction while using JTAGICE mkII

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is this possible, or do I have to comment it out in the source, recompile, and reload the .cof? Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If all else fails you can always read the manual.

I have not, but here goes:

press F10 to execute one line of C code.

if you want to NOT execute the code i.e. miss this line and resume from the next line. You would have to edit the PC register (location counter)

I have never manipulated the PC.
I have altered a branch decision by setting the Z flag in SREG

If you want to "miss" a branch or line of code on a regular basis, then put in a debug statement that controls it. e.g. if (debug_flag) do_this_line();

Then you just alter the (debug_flag) to turn your "feature" on or off.

And of course if you write your debug macros carefully, they stay in the code, do not make the code unsightly, and are inactive in the production version.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

With C it's a nightmare doing things at times, however you can right click on a line and set it as the next statement, unless the "optimiser" has helped you and the feature is greyd out because there is no code produced for that line.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John,

You are a star. This works just fine. Perhaps I will even read the Studio manual one day. Or perhaps just look at the right-click menus.

Mind you, I wonder whether I will ever use this feature.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The feature is VERY useful. One good example is that you've used the "step over" feature to walk through the code because you "know" that the problem you're chasing couldn't possibly be in any of the deeper subroutines, and you don't want to have to wade through them. Only after you "step over" a subroutine call, the return value is completely wrong. Whoa thar; maybe you DO need to watch that subroutine at work. So you use the "set next statement" feature to "back up" the execution flow to just prior to the call, and "step INTO" the subroutine to see why it misbehaves.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
This works just fine.
...especially with ASM where there is no "optimiser" to fix your code. :) With C can be hit and miss and very annoying when you want to put a breakpoint and it appears a few lines below or you try to "set as next statement" or "run to cursor" and it does not work because the code is elsewhere.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly