Advanced Octave A65 — Debugging and diagnosing a pipeline

by Giux GX-TXT, octave-en, scripts-en 2 min read

Advanced GNU Octave with GX-TXT · Module 11

A debugger allows you to stop before an operation and observe the status of the program. We use it to locate two carriers with incompatible lengths, then we carry out the calculation with correct data.

Objectives and prerequisites

The test uses GX-TXT dev112-P011-bis and GNU Octave 9.4.0. Import diagnosi.m, assign him an ID in the Session and save him in the Workspace Octave.

Stop and inspect

In the source select row 4, after the assignment of the carriers. Open Run → Debug Session script, use Breakpoint and start with Start Debug. In the test the debugger stops at the selected line:

The current line and stack indicate where the execution is suspended. The Locals / Globals section allows you to consult the available variables; at this point x contains four elements and y three. Use Continue to continue and open Program output / diagnostics to read output.

Diagnosing and recalculating

The adjustment detects the length difference and the catch signals it. For this demonstration the same script then assigns a four-element y vector, rechecks the size and calculates x+y, obtaining [11 22 33 44]. The initial error is intentional and does not produce a result of the sum.

In a real pipeline it identifies the origin of discordance before correcting it: cutting or adding values arbitrarily could associate different observations. If you change source or data after a Job, save the new version and start a new execution; do not change back the previous result as if it was recalculated.

Exercise

  1. Where does the debugger stop in the test?
  2. What are the initial lengths of the carriers?
  3. Why is the sum done only after the second check?

Worked solution

  1. In line 4, after the initial assignment.
  2. Four and three.
  3. First the size is incompatible; after correction the program again checks and calculates the sum.

Download the Module 11 scripts (ZIP)

#GNU Octave #GX-TXT #GX-TXT public APIs

Other steps of this project

Leave a Reply

Your email address will not be published. Required fields are marked *