9srv Manual Collection/plan9/acid(1) | 9srv Manual Collection/plan9/acid(1) |
---|
acid -l truss textfile
acid -l trump [ pid ] [ textfile ]
At startup, acid obtains standard function definitions from the library file /sys/lib/acid/port, architecture-dependent functions from /sys/lib/acid/$objtype, user-specified functions from $home/lib/acid, and further functions from -l files. Definitions in any file may override previously defined functions. If the function acidinit() is defined, it will be invoked after all libraries have been loaded. See 8c(1) for information about creating acid functions for examining data structures.
Variable types (integer, float, list, string) and formats are inferred from assignments. Truth values false/true are attributed to zero/nonzero integers or floats and to empty/nonempty lists or strings. Lists are sequences of expressions surrounded by {} and separated by commas.
Expressions are much as in C, but yield both a value and a format. Casts to complex types are allowed. Lists admit the following operators, with subscripts counted from 0.
Format codes are the same as in db(1). Formats may be attached to (unary) expressions with \, e.g. (32*7)\D. There are two indirection operators, * to address a core image, @ to address a text file. The type and format of the result are determined by the format of the operand, whose type must be integer.
Statements are
The statement defn name clears the definition for name. A defn may override a built-in function; prefixing a function call with builtin ignores any overriding defn, forcing the use of the built-in function.
Here is a partial list of functions; see the manual for a complete list.
Display elements of a linked list of structures:
Note the use of the . operator instead of ->.
Display an array of bytes declared in C as char array[].
This example gives array string format, then prints the string beginning at the address (in acid notation) *array.
Trace the system calls executed by ls(1):
9srv Manual Collection/plan9/acid(1) | Rev: Thu Sep 27 00:06:01 BST 2012 |