New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugger "step" #3266

Closed
shiffman opened this Issue May 11, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@shiffman
Member

shiffman commented May 11, 2015

When the debugger is active and I'm stopped at a breakpoint, my expectation is as follows:

  1. "continue" will advance the code until the next breakpoint.
  2. "step" will move the code line by line (as if there is a breakpoint at each line.)

1 works as expected. 2 works, however, as soon as the debugger cycles back to the beginning of draw() it no longer steps, but rather continues. Here is what I am using to test:

float x = 0;

void setup() {
}

void draw() {
  println("test0");
  println("test1");
  x = x +  1;    // ***** breakpoint is here ***** //
  println("test2");
  println("test3");
}

"step" will advance line by line through println("test2"); and println("test3"); but then jump again to x = x + 1 without stopping at println("test0"); or println("test1");

@benfry benfry added the high label May 11, 2015

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry May 16, 2015

Member

Hm, on closer look, I think this might be in line with how "step" works in a debugger. When you hit the end of draw(), you're stepping out of the function (otherwise we'd be dropping you into a bunch of PApplet arcana), and there's no way for a debugger to know that draw() is your function of interest and you want to go back to stepping there.

Put another way, to the debugger, draw() is like a different function each time. The way you signal that you're always interested in draw() is to put a breakpoint at the beginning of it.

Does that make sense?

Member

benfry commented May 16, 2015

Hm, on closer look, I think this might be in line with how "step" works in a debugger. When you hit the end of draw(), you're stepping out of the function (otherwise we'd be dropping you into a bunch of PApplet arcana), and there's no way for a debugger to know that draw() is your function of interest and you want to go back to stepping there.

Put another way, to the debugger, draw() is like a different function each time. The way you signal that you're always interested in draw() is to put a breakpoint at the beginning of it.

Does that make sense?

@shiffman

This comment has been minimized.

Show comment
Hide comment
@shiffman

shiffman May 18, 2015

Member

Yes, I completely understand. Linking this to processing/processing-docs#211 so I remember this when I write tutorial. Closing.

Member

shiffman commented May 18, 2015

Yes, I completely understand. Linking this to processing/processing-docs#211 so I remember this when I write tutorial. Closing.

@shiffman shiffman closed this May 18, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment