Entering and exiting debug

From the Brainhat commandline, you can enter debug at any time.  Debug has no side-effects; you can execute any commands with causing a change in the context.  To enter debug, enter one of "debug" or "break" at the ">>" prompt:

$ ./run
make: 'data' is up to date.
Initializing

>> debug

Break in debug at the start:
debug> help
Commands:
debug symbol [ location] -or-
debug symbol [ location] -or-
set symbol [ location]
  Increment debug count for routine/process/flag,
  and optionally stop at listed locations.
  "location" is one of {start, loc[1-3], finish, all}

nodebug symbol -or-
unset symbol
  Decrement debug count for routine/process/flag.
clear symbol
  Zero the debug count for routine/process/flag.
dump [n]
  Dump optional argument concept (if concept).
  Dump optional conchain (if conchain).
  "n" chooses conchain element.
rdump [n]
  Dump recursively.
speak [n]
  Speak optional argument concept (if concept).
  Speak optional conchain (if conchain).
list label
  Show all symbols matching label.
words
  Dump pre-prepared word list.
listm
  Shows loaded motvs.
showmids
  Show available motv shift targets.
shiftn number
  Shifts motive processing to motv N.
shift name
  Shifts motive processing to motv by name.
midsym
  Show current memory system tables.
s[r]dump symbol
  Dump symbol from clean symbol table.
c[r]dump symbol
  Dump symbol from context.
m[r]dump symbol
  Dump symbol from MID symbol table.
x[r]dump n
  Dump nth CC from context.
xspeak [n]
  Speak nth context entry.
d[r]dump n
  Dump nth CC from discourse buffer.
dspeak [n]
  Speak nth discourse entry.
q[r]dump n
  Dump nth CC from questions buffer.
qspeak [n]
  Speak nth question.
sqspeak/sq[r]dump
  Speak/dump the saved question, if any.
ccspeak label
  Speak CC from context.
a[r]dump/speak n
  Dump nth anaphor candidate.
parse string.
  Parse and read back the input.
p[r]dump n
  Dump nth CC from temporary parse buffer.
pspeak [n]
  Speak nth context entry from temporary parse buffer.
eval string
  Evaluate the truth value of the input.
input string
  Run input cycle on string. Speaker will be credited if creditspkr is set
spkrinput string
  Run input cycle on string and credit speaker for saying it in all cases.
hints
  Dumps conditions for explicit inferences loaded and ready.  Ancient command.
parents symbol
  List all parents of the given symbol.
gtime
  Show global relative start and end times for current window.
rule <rule name>
  Dump a Brainhat grammar, sort of.
redir flag.
  Output debug for "flag" to stderr.  "Flag" may additionally
  be specified as "journal", in which case the journal output is
  redirected.
stderr ipaddr port.
  Send stderr to a socket waiting at ipaddr:port.
argv
  Print out the argument vector for this Brainhat invocation.
send ipaddress[:port]
  Send the whole context to another copy of Brainhat at address and port (10000 default).
receive port
  Receive the whole context from another copy of Brainhat on tcp port given.
wslistcx
  List all websocket connections.
wsping peername
  Ping a websocket peer
wsmessage peername
  Send a message to a websocket peer
wsclose peername
  Close connection to a websocket peer
wsconnect host port remote-friendly-name my-friendly(or path) protocol
  Connect to a websocket server
exit
  Return to Brainhat command line.
version
  Print code version.
forget
  clear context and dirty symbol tables.
prompt "<new prompt>"
  change dialog prompt.
stop
  Stop the program.

debug> exit

>>

Above, you see the output of the "help" command.  Any debug command can also be issued in a one-time fashion, without descended to debug prompt. Here is an example using the version command:

$ ./run
make: 'data' is up to date.
Initializing

>> debug version
Server version 4.260324

>>