Next: GNU Free Documentation License, Previous: Debug Protocol Notes, Up: STARTER Debugger [Contents]
This walkthrough uses the starter-core sample peers
time-example (ST:TimeExample) and
beep-example (ST:Beep) from the core package
examples/ tree. Together with a tiny rules file they form the
same “alarm clock” setup described in the starter-core manual.
time:hourtime:minutetime:secondInputs published by time-example (system clock).
time:localOutput on the time peer: 1 uses local time, 0 uses UTC.
beep:statusOutput on the beep peer: 1 makes the host terminal bell.
Put this in your Core rules file (for example /tmp/beep-time.conf):
beep:status {
SET TRUE WHEN time:hour == 7 && time:minute == 0;
SET FALSE WHEN TRUE;
}
In three terminals (from a built starter-core tree):
$ starter-core -R /tmp/beep-time.conf $ ./examples/time-example $ ./examples/beep-example
Confirm the debug port is listening (default
127.0.0.1:17373), then attach:
$ starter-debugger --core=127.0.0.1:17373
Live D-Bus signals from the Core debug interface can be printed as they
arrive. Shadow tables used by info io / info vars always
update; monitor only controls what is printed.
monitor onmonitor allPrint every channel.
monitor offSilence live printing (shadows keep updating).
monitor CHANNELmonitor CHANNEL on|offToggle one channel. Names:
inputs, outputs, io (both),
stats, vars, peers, stopped,
rules, triggers, engine (rules+triggers).
Useful combinations for this plant:
monitor inputs — each tick of time:second /
time:minute / time:hour as InputChanged.
monitor outputs — OutputChanged when
beep:status or time:local changes.
monitor rules — RuleTriggered when Core applies a
rule to an output (for example writing beep:status).
monitor stopped — Stopped lines from breakpoints and
watchpoints (also enable this before using break /
watch).
monitor peers — peer connect/disconnect noise while examples
start or stop.
Example: watch the clock without drowning in other traffic:
(starter) monitor off (starter) monitor inputs (starter) monitor stopped
Lines look like:
[monitor 12:00:01.042] InputChanged time:second = 1 [monitor 12:00:02.041] InputChanged time:second = 2
A breakpoint pauses Core before rule apply for an
identifier. A watchpoint pauses when that identifier’s value
changes. After Stopped, use continue to resume.
Simulated session (clock already running; peers visible):
(starter) status (starter) info peers (starter) info io time (starter) info io beep (starter) monitor stopped (starter) monitor rules (starter) monitor outputs (starter) watch time:second Watchpoint 1 on time:second (starter) break beep:status Breakpoint 2 on beep:status (starter) info watch (starter) info break
When the second ticks, Core stops and the debugger prints something like:
[monitor ...] Stopped reason=watchpoint id=time:second \ value=17 handle=1 (starter) continue Continuing.
Force the beep from the debugger (bypasses waiting for 07:00). With
the breakpoint on beep:status, the poke pauses before apply:
(starter) set output beep:status = 1 SetOutput beep:status = 1 [monitor ...] Stopped reason=breakpoint id=beep:status \ value=1 handle=2 (starter) info io beep (starter) continue Continuing. [monitor ...] OutputChanged beep:status = 1 [monitor ...] RuleTriggered on beep:status => ...
The terminal running beep-example should start beeping.
Turn it off again:
(starter) set output beep:status = 0 (starter) continue
Optional: switch the time peer to local wall-clock:
(starter) set output time:local = 1 (starter) continue
Clean up when finished:
(starter) delete watch 1 (starter) delete break 2 (starter) monitor off (starter) quit
The same flow is sketched in examples/session.stdbg. Run it non-interactively once the plant is up:
$ starter-debugger --core=127.0.0.1:17373 \
examples/session.stdbg
Or source examples/session.stdbg from the REPL. Uncomment or
edit lines to match how long you want to sit on each Stopped
event; interactive use is usually clearer for continue.
Next: GNU Free Documentation License, Previous: Debug Protocol Notes, Up: STARTER Debugger [Contents]