oadldb - OADL binary debugger
oadldb [flags] [filename]
The [flags] are zero or more of:
The [filename] is an executable file (with a suffix of ".oax").
oadldb is a console-mode debugger for executable oadl programs (compiled by oadlc into .oax files).
oadldb inherits a lot of design philosophy from gdb; as such, many of the following commands may be familiar. Note that oadldb has extensive online help; more information about each command may be obtained by typing "help <command>".
Cmd | Alt | Description |
---|---|---|
b | break | set a breakpoint |
tbreak | set a temporary breakpoint | |
w | watch | set an expression watchpoint |
d | disable | disable breakpoints |
e | enable | enable breakpoints |
delete | delete breakpoints by number | |
clear | delete breakpoints by location | |
info | get info about breakpoints | |
r | run | run the OADL program |
c | continue | continue execution |
until | continue execution until a specified line | |
restart | restarts the program | |
j | jump | jumps to a specific location |
s | step | single step |
n | next | single step, stepping over procedure calls |
si | stepi | single step an instruction |
ni | nexti | single step an instruction, stepping into CALLs |
finish | complete execution of function at current stack frame | |
return | return immediately from function at current stack frame | |
bt | backtrace | prints a stack backtrace |
up | move up in the stack frames (toward stack base) | |
down | move down in the stack frames (toward top of stack) | |
f | frame | change or print info about stack frames |
q | quit | exit the debugger |
l | list | display program source and/or disassembly |
set | set a variable to an evaluated expression | |
p | print the value of an expression | |
dprint | deferred print of the value of an expression | |
t | throw | throw an exception |
v | var | declare (and optionally intialize) a new global variable |
<cr> | again | repeat the last command |
env | set debugging environment parameters | |
h | help | prints help. Topics include: breakpoints locations stack <command> |
The OADL debugger has several commands which handle breakpoints. These include:
breakpoint location | set a breakpoint |
breakpoint location if expr | set a conditional breakpoint |
watch expr | set an expression watchpoint |
disable opt-breakpoints | disable some breakpoints |
enable opt-breakpoints | enable some breakpoints |
delete opt-breakpoints | delete some breakpoints by number |
clear opt-location | delete breakpoints at some location |
info opt-breakpoints | print a table of breakpoints |
The opt-breakpoints is a list of zero or more breakpoint numbers. It may contain ranges, such as "3 - 5". It may also be the character "*", which is interpreted as "all". The "*" may be followed by a "-" and then a list of numbers, which is interpreted as "all but these breakpoints." For example, "disable * - 3" disables every breakpoint except for breakpoint number 3.
OADL code locations are specified in one of several ways:
If no location is given, the currently executing line of the OADL program is assumed. If a reference to a line with no code is given, the location will be recalculated as the location of the next valid line. Similarly, if an instruction address contained within a multi- byte instruction is given, the location will be recalculated as the address of the next instruction in the function.
If a file's directory path is not given, any source file whose name matches the given location may resolve the location. If multiple source files have the same base name, unpredictable results will occur.
bash $ oadlc foo.oad -o foo.oax bash $ oadldb foo.oax db> b main Breakpoint #0 main db> run Hit breakpoint #0 main -> 1 proc main() 2 { 3 var a = 3->iterate(); 4 "", a, '\n'; db> next 3 var a = 3->iterate(); db> print a 0 1 2 db> help continue continue c Continue program execution after an interruption. continue <ignore-count> Continue program execution, ignoring breakpoints at the current program location for <ignore-count> times. db> quit bash $