Debugger crashing

I am a newbie, attempting to use the debugger to figure out why my sketch isn’t doing what I want. But it never shows anything in the variables window, and simply shows a massive red error message in the console instead. This happens both with my “problem” sketch and an earlier sketch that works just fine.

I am running Processing 3.5.4 in Windows 10 in Java mode. The console error message begins with:

Exception in thread “AWT-EventQueue-0” java.lang.NullPointerException
at processing.mode.java.VariableInspector$OutlineRenderer.getIcon(VariableInspector.java:501)
at processing.mode.java.VariableInspector$OutlineRenderer.getIcon(VariableInspector.java:566)
at org.netbeans.swing.outline.DefaultOutlineCellRenderer.getTableCellRendererComponent(DefaultOutlineCellRenderer.java:314)

What I do to generate this mess is:
(1) Load the sketch.
(2) Hit the butterfly icon in the upper right (or select Debug->Enable Debugger from the menu; doesn’t matter), which pops up an empty Variables window.
(3) Click a line number inside the draw() function, which turns that line number into a diamond.
(4) Hit the Continue button, or the Step button, or the Play button (it doesn’t matter). This results in vomiting the red error messages in the console, along with a message in the bar above saying “Debugger halted,” and no variables ever showing in the variables window.

I’m sorry if this question has been answered elsewhere in the forum. If it has, I can’t find it. Any clues would be greatly appreciated.

Hey first up, welcome to the forum:)
I don’t normally use the debugger but print out everything. Now I’ve tried it and I haven’t had any problems… Here is my simple sketch:

Maybe it helps to restart processing / pc

also I wonder if this issue happens with any code or specific code. It would be helpful if you @LuisGranados can post the code :slight_smile:

1 Like

It happens with any code. I every now and then just try the debugger to see what it does, and I have never seen anything in the variables box. Here is a an earlier sketch that works as intended, but the debugger spews error messages and gives me nothing in the variables box:

// Spinning pinwheel

void setup() {
size(800,800);
noFill();
strokeWeight(3);
stroke(200,160,160);
frameRate(20.0);
}

float spin=0.0;
float spin2=0.0;
float spin3=0.0;
float r=100.0; // radius
float spinrate[] = new float[10];
float xcor[] = new float[10];
float ycor[] = new float[10];
int counter;

void draw() {
background(172,250,248);

pushMatrix();
translate(width*.25,height*.25);
rotate(spin);
filledFlower();
spin+=0.1;
popMatrix();

if (counter==0) {
for (counter=0; counter<10; counter++) {
spinrate[counter]=random(-2.0,2.0);
xcor[counter]=random(60,width-60);
ycor[counter]=random(60,height-60);
}
}

for (counter=0; counter<10; counter++) {
// doPinwheel(xcor[counter],ycor[counter],spinrate[counter]);
pushMatrix();
translate(xcor[counter],ycor[counter]);
rotate(spinrate[counter]);
filledFlower();
spinrate[counter]+=0.1;
popMatrix();
}
}

void doPinwheel(float x,float y,float ang) {
pushMatrix();
translate(x,y);
rotate(ang);
filledFlower();
popMatrix();
}

void filledFlower() {
fill(200);
noStroke();
arc(50,0,r,r,radians(180),radians(270),OPEN);
arc(-50,0,r,r,radians(270),radians(360),OPEN);
arc(-50,0,r,r,radians(0),radians(90), OPEN);
arc(50,0,r,r,radians(90),radians(180),OPEN);
arc(0,50,r,r,radians(180),radians(270), OPEN);
arc(0,-50,r,r,radians(0),radians(90), OPEN);
arc(0,-50,r,r,radians(90),radians(180), OPEN);
arc(0,50,r,r,radians(270),radians(360), OPEN);
strokeWeight(3);
stroke(200,160,160);
noFill();
}

I tried the same code you had, and got no error message but also no variables. I then made it slightly more complicated, so I could set a decent breakpoint test. Using the code below, setting the breakpoint at the last command in draw(), I get the big error dump and still nothing in the variables table.

I wonder if I should uninstall and reinstall Processing?

float r=30;

void setup() {
size(600,600);
fill(255);
}
void draw() {
background(0);
ellipse(mouseX,mouseY,r,r);
r+=.1;
}

thanks but please format the code!

Here it is with the code formatted. The breakpoint is at the last line [r += .1;]

float r=30;

void setup() {
size(600,600);
fill(255);
}

void draw() {
background(0);
ellipse(mouseX, mouseY, r, r);
r += .1;
}

Not formatted yet.

Please format your posts as per:
https://discourse.processing.org/faq#format-your-code

:)

I wound up uninstalling and then reinstalling Processing. I inadvertently had it in a OneDrive cloud location. The program seemed to work ok, but the debugger didn’t. Now the debugger works, at least on a simple sketch. I’m hoping that one other bizarre problem I had may now go away also.