MCPcopy Index your code
hub / github.com/benfry/processing4 / startDebug

Method startDebug

java/src/processing/mode/java/debug/Debugger.java:308–368  ·  view source on GitHub ↗

Start a debugging session. Builds the sketch and launches a VM to run it. VM starts suspended. Should produce a VMStartEvent.

()

Source from the content-addressed store, hash-verified

306 * VM starts suspended. Should produce a VMStartEvent.
307 */
308 public synchronized void startDebug() {
309 //stopDebug(); // stop any running sessions
310 if (isStarted()) {
311 return; // do nothing
312 }
313
314 // we are busy now
315 editor.statusBusy();
316
317 // clear console
318 editor.clearConsole();
319
320 // clear variable inspector (also resets expanded states)
321 inspector.reset();
322
323 // load edits into sketch obj, etc...
324 editor.prepareRun();
325
326 // after prepareRun, since this removes highlights
327 //editor.activateDebug();
328 editor.activateRun();
329
330 try {
331 Sketch sketch = editor.getSketch();
332 JavaBuild build = new JavaBuild(sketch);
333
334 log("building sketch: " + sketch.getName());
335 //LineMapping.addLineNumbers(sketch); // annotate
336// mainClassName = build.build(false);
337 mainClassName = build.build(true);
338 //LineMapping.removeLineNumbers(sketch); // annotate
339 log("class: " + mainClassName);
340
341 // folder with assembled/preprocessed src
342 srcPath = build.getSrcFolder().getPath();
343 log("build src: " + srcPath);
344 // folder with compiled code (.class files)
345 log("build bin: " + build.getBinFolder().getPath());
346
347 if (mainClassName != null) {
348 // generate the source line mapping
349 //lineMap = LineMapping.generateMapping(srcPath + File.separator + mainClassName + ".java");
350
351 log("launching debuggee runtime");
352 runtime = new Runner(build, new RunnerListenerEdtAdapter(editor));
353 VirtualMachine vm = runtime.debug(null); // non-blocking
354 if (vm == null) {
355 loge("error 37: launch failed", null);
356 }
357
358 // start receiving vm events
359 VMEventReader eventThread = new VMEventReader(vm.eventQueue(), vmEventListener);
360 eventThread.start();
361
362 startTrackingLineChanges();
363 editor.statusBusy();
364 }
365 } catch (Exception e) {

Callers 2

continueDebugMethod · 0.95
stepMethod · 0.95

Calls 15

isStartedMethod · 0.95
logMethod · 0.95
getNameMethod · 0.95
buildMethod · 0.95
getSrcFolderMethod · 0.95
getBinFolderMethod · 0.95
logeMethod · 0.95
statusBusyMethod · 0.80
clearConsoleMethod · 0.80
getSketchMethod · 0.80
resetMethod · 0.65

Tested by

no test coverage detected