Modula-2 || Compiler & Tools || Library || Search Engine


Ulm's Modula-2 System:
mdb


NAME

mdb - Modula-2 debugger

SYNOPSIS

mdb [-f] [objfile [corefile]]

DESCRIPTION

Mdb is a Modula-2 debugging tool. Objfile is an executable program file (default: a.out). Corefile is assumed to be a core image file produced after executing objfile; the default for corefile is core. Under f-option mdb gives a backtrace and error diagnostics. Otherwise mdb switches to command mode.

WINDOWS

Mdb builds up a tree of windows according to the program found in objfile and the reference files of the modules used in the program. The M-window (i.e. the root) contains the list of all global modules. The D-windows show the contents of all variables of a certain level. The procedure backtrace is shown in the P-window. You can examine parts of your source code by using the T-window. The C-window enables you to read the core dump. For example, you may select a certain procedure shown in the P-window by moving the cursor to it, then change to D-window to examine the variable values. The I-window allows to examine disassembled code.

COMMANDS

The command lines of the mdb are of the following syntax:
	 line	  = cmd	{ ";" cmd }.
	 cmd	  = count letter { arg } .
	 arg	  = intarg | strarg .
	 count	  = intarg .
	 intarg	  = ["-"] digit	{ digit	} [H|B]	.
	 strarg	  = text | "'" text "'"	| '"' text '"' .
q, x
exit
!
shell command
= value ['x'|'d'|'o']
convert value into hexadecimal, decimal (default) or octal format.
e
print run time error messages
h
displays an overview of the commands.
i [address] ['d'|'t']
switches to the I-window at location address in space 't' (a.out-file: default) or 'd' (core-file / current process). If address isn't specified the next instruction after the last 'i' command will be printed.
$m ['x'|'d'|'o']
print map in hexidecimal (default), decimal, or octal format (for further information about maps see adb(1)).
$r ['x'|'d'|'o']
print register contents and the last instruction. If a run time library routine is executed, two instructions will be printed: that of the library routine and the next instruction of the Modula-2 procedure.

Window Switches

p
switch to P-window.
P [pdesc]
Modula-2 process switch. The optional parameter specifies the address of a process descriptor. The address may be omitted if being in a D-window and a process variable have been choosen.
M
Switch to current coroutine. (Useful after 'P' command.)
d
switch to D-window.
m
switch to M-window.
c [address ['x'|'d'|'o'|'c' ['x'|'d'|'o']]]
switch to C-window. The C-window starts at address if specified, else it displays the contents of the current variable. The second parameter determines the data format, the third paramter determines the address format.
t [filename]
switch to T-window.

Positioning

<return>, + [lines]
next line / move lines lines (default: 1) forward.
- [lines]
move lines lines (default: 1) backward.
b
display last page.
n
display next page.
u
print context of current line.
/pattern
search forward for pattern.
?pattern
search backwards for pattern.

Process Control

R
start process
C
continue process
I
continue process and ignore last interrupt

Breakpoints

Breakpoints may be set at the begin and end of every procedure. For each breakpoint a counter has to be specified according to following rule:

0
ignore breakpoint
n > 0
stop when breakpoint is reached the n-th time and delete breakpoint.
-1
stop every time breakpoint is reached.

B [count1 [count2]]
set breakpoints at begin of the procedure (count1) and at the end of the procedure (count2).
D
delete breakpoint

ENVIRONMENT

MODPATH
MODPATH specifies a list of directories separated by colons. This path is used for the search of reference file archives named REF.
SRCPATH
This path is used on the search for source files (T-window!) and reference files.
MDBPS
defines the prompt (default: "> ").

CAVEATS

Avoid commands like "/7" because 7 is interpreted as an integer argument and "/" expects a string argument. The correct solution ist "/'7'" which enforces the "7" to be interpreted as string argument.

SEE

m2c

FILES

*.r reference files
REF archive with reference files
/usr/local/lib/modula/REF Modula-2 library reference files
a.out default object file
core default core file

BUGS

Mdb has not yet been ported to the Solaris2.x/SPARCv8 platform.
Edited by: borchert, last change: 1997/02/24, revision: 1.2, converted to HTML: 1997/04/28

Modula-2 || Compiler & Tools || Library || Search Engine