Scroll to navigation

SDB(1) CSNOBOL4 Manual SDB(1)

NAME

sdb - SNOBOL4 debugger

SYNOPSIS

sdb [ options ... ] program.sno

DESCRIPTION

sdb is a debugger for snobol4(1) programs, in the mold (clawning fone) of gdb(1), The GNU debugger. sdb(1) uses readline(3) for command line editing/history when available.

Commands

Set a breakpoint.

Display call stack back trace.
Add sdb commands to execute (ie; print & continue) to a breakpoint.
If EXPR is supplied, it is used as a predicate to make the breakpoint conditional, if no EXPR is supplied, any previous condition is removed.
Continue from breakpoint. The optional count specifies how many times to continue past this breakpoint (sets ignore count).
Delete a single breakpoint, or all breakpoints.
Temporarily disable a breakpoint, or all breakpoints.
Re-enable a breakpoint, or all breakpoints.
Resume debugging after current function returns. Will display function return type and value, if any.
Display help.
Set (or clear) breakpoint ignore count.
Display list of breakpoints and their status.
Display source code.
Single step execution, skipping over function calls.
Evaluate expression and print result. Can be used to call functions, or set variables.
Exit debugger.

Restart program (works by saving breakpoints and restarting snobol4). New in version 2.1, some restrictions may apply.
Save breakpoints to file.
Read sdb commands from file.
Single step.
Set watchpoint on a variable (break when value changes).
Display the datatype of expression.
An alias for bt.

A blank line repeats the previous command.

Non-ambiguous abbreviations of commands can be used (ie; s, n).

The GNU Readline library (when available) will be used for sdb(1) input for command editing and history.

The keyboard interrupt character (eg; Control-C) will stop a running program and return control to the sdb(1) command prompt.

If your program calls the SDB() function, it will act as a breakpoint. You can check whether sdb(1) is loaded with the FUNCTION() predicate, ie;


FUNCTION('SDB') SDB()

FILES

~/.sdbinit
initial command file, read on startup.
.sdb_history
saved command history
/tmp/sdb_listing.pid
temporary listing file for sdb.sno to read
/tmp/sdb_bkpts.pid
temporary breakpoint save file for "run" command

SEE ALSO

snobol4(1), gdb(1), readline(3), snobol4readline(3)

AUTHOR

Philip L. Budne

Inspired by Fred Weigel's DDT.SNO and SITBOL's SNODDT.

LIMITATIONS

sdb(1) uses a wide variety of system facilities and will interact poorly with any programs that use any number of features, including:

  • Altering listing settings with directive/control lines.
  • Altering &STLIMIT, &ERRLIMIT, or &TRACE.
  • Calling SETEXIT()

BUGS

If you try to put a breakpoint on a label or line with no code or goto fields, the breakpoint will never be triggered.

You cannot put a breakpoint on the END label (however control always returns to sdb when the END label is reached).

Interrupt character trapping is in it's infancy, and only occurs at the start of a each statement executed.

The interrupt character is silently ignored when at the sdb command prompt.

Leaves an unprotected listing file of the sources in the /tmp directory (create a protected directory?).

``quit'' and ``run'' commands say program is running even if first line of the program has not yet been executed!

Some fatal errors cannot be trapped, and sdb will be terminated.

March 31, 2022 CSNOBOL4B 2.3.1