Tests & debugging

Understand a running program

Breakpoints, stack frames, variables, source maps and launch versus attach.

In this guideBefore you start · PremiumFollow a total calculation step by stepPause where it mattersLaunch and attach are different

Before you start · Premium#

This guide covers tools included in Code Weaver Premium. Sign in to your account in the IDE and check that Premium is active. Without Premium you can still browse, search, edit and save your files.

The Windows app’s debugger panel.Code Weaver · Windows

Follow a total calculation step by step#

A breakpoint is a line where execution pauses. The stack, shown under Calls, lists the functions that led there; Variables shows values at the selected location. Start with a small project Node.js program that calls your total function.

  1. Open and save the program, for example scripts/check-total.mjs, and the function to inspect.
  2. Open Debugger, choose Runtime → Node.js · JS / TS and enter the path under Program.
  3. Use JSON arguments for parameters, for example ["--quantity", "0"], or leave [].
  4. Click the editor gutter beside the calculation line to add a breakpoint, then click Start.
  5. When paused, select a frame under Calls and inspect Variables. Use Step over (F10) or Step into (F11) to follow the calculation.
  6. Click Continue debugging to continue or Stop debugger to end the session.

Pause where it matters#

A breakpoint can have a condition, hit counter or logpoint. Conditions use the program’s language. A logpoint writes to the console and continues; evaluated expressions can affect program state.

KeysAction
F5Continue
F10Step over
F11Step into
Shift+F11Step out
Shift+F5Stop

Launch and attach are different#

Launch starts a program whose shutdown is managed by Code Weaver. Attach connects to an existing program and leaves it running when disconnected. Debug ports use loopback; remote services need a prepared forward and matching sources.

Java supports Hot Code Replace for compatible changes. With .NET/netcoredbg, restart the session to apply program changes. Always check that the source files match the running program.

Open original image ↗