Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ (1) — Plan9 1st Edition

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

2a(1)

2l(1)

mk(1)

db(1)

ACID(1)

NAME

acid − debugger

SYNOPSIS

­acid [ ­-l loadmodule ] [ ­-w ] [ ­pid ] [ ­textfile ]

DESCRIPTION

Acid is a general purpose source level, symbolic debugger.  The debugger is built around a simple command language.  The command language provides a flexible user interface which allows the debugger interface to be customized for a specific application or architecture.  Moreover, it provides an opportunity to write test and verification code independently of a programs source code.  Acid is able to debug multiple processes provided they share a common set of symbols (See ALEF(1)). 

The -w option allows the textfile to be modified. 

Control-D terminates the program. If there are active processes a diagnostic is printed and acid returns to the prompt. A second Control-D will cause the debugger to exit and attached processes will be unaffected. To make a clean exit, processes should be destroyed using the function ­kill . 

At startup acid reads a standard set of command functions from a library. Modules are automatically loaded from /lib/acid/port, /lib/acid/$objtype and $home/lib/acid in that order.  This provides a standard debugging environment for each of the architectures.  Definitions in $home/lib/acid may replace any previously defined functions. Language specific modules can also be loaded using a command line option. Modules specified on the command line are loaded last. If the function acidinit is defined by any of the load modules it will be invoked after all modules have been loaded. 

Acid introduces the symbols of the program being debugged as variables in the language. If a symbol in the program conflicts with a predefined variable or reserved word the symbol is renamed. The interpreter prepends $ characters to start of the symbol until it is unique.  A summary of the renamings is printed at startup. 

Acid has an expression syntax much like C. However since the symbol table provides addresses the dual of a program variable will be an address in acid. That is the same as if all names were preceded by an & in C or ALEF expression.  To obtain the value of a variable one of the indirection operators must be used. 

At the prompt acid is prepared to either store function definitions or evaluate expressions.  The expression syntax is similar to the expression syntax of C and ALEF.  The result of expression evaluation yields both a value and a format.  The format of and item may be set using the builtin function fmt. Formats are compatible with db(1). The format determines how an item will be printed, the stride of an increment or decrement operation and how many bytes are read or written by the indirection operators. 

EXAMPLE

To start to debug ls and set a breakpoint:

% acid /bin/ls
/bin/ls: mips plan 9 executable
/lib/acid/port
/lib/acid/mips
acid: new()
70094 : system call_mainADD$-14,R29
acid: bpset(ls)
acid: cont()
70094 : breakpointlsADD$-16c8,R29
acid:

FILES

­/proc/∗/text
­/proc/∗/mem
­/proc/∗/ctl
­/proc/∗/note
­/lib/acid/$objtype
­/lib/acid/port
­$home/lib/acid

SEE ALSO

2a(1), 2l(1), mk(1), db(1)
ACID Manual, Phil Winterbottom

Plan 9  —  January 03, 1993

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026