Low-level 32-bit system debugger (QNX)
Debugger32 [-b baud] [-d text] [-s port]
These options may be set from within the debugger through the colon (:) command.
The Debugger32 utility is a low-level debugger that lets you set breakpoints and single-step through programs, display and edit memory, disassemble code, and examine I/O ports. You can use this debugger for debugging interrupt handlers.
This debugger will function only with versions of Proc released with QNX 4.23 or later. |
The debugger operates below the kernel, thus allows debugging the kernel, interrupt and fault routines.
This debugger must be built into the operating system image; it cannot be started from the command line. You always place Debugger32 in the last line of the build file. For example:
sys/Debugger32 $ Debugger32
For more information, see the buildqnx utility.
Unless you specify the -D option to Proc, the debugger will go through two checkpoints when the operating system boots. You'll be prompted:
You can invoke this debugger with the following key chord: Ctrl-Alt-Esc.
Don't use this debugger in a multiuser environment, because it disables interrupts and freezes the entire system. |
The debugger operates in a simple line-edited mode (most familiar editing characters are available) accepting commands of the form
Most commands are single letter, some with modifiers. For example d displays memory, dw display memory in word-length quantities. Most arguments are expressions, which have a common syntax. The expression evaluator is crude, with cryptic error messages, and expressions may not contain space characters.
The command set supported by the debugger in QNX 4.23 and later is different from the one supplied with QNX versions 4.00 through 4.22. |
Any the debugger command prompt (* ), the following are valid:
Command | Arguments | Description |
---|---|---|
dsize | [expr0 [expr1]] | display memory at expr0 for expr1 bytes. |
D | expr | disassemble instructions at the address expr, enter disasm-mode. |
isize | expr | read from I/O location expr. |
osize | expr0 expr1 | write expr1 to I/O location expr0. |
esize | expr | edit memory at location expr. |
rregister | [expr] | display or set register to expr. |
a | expr | show page table entry for address expr. |
. | expr | print segment table entry for selector expr. |
/p | expr | display memory as a process table entry expr. |
/P | expr | display proc table entry for pid expr. |
/r | expr | display memory at expr as a saved register set. |
/R | expr | display saved register set for pid expr. |
/m | expr0 [expr1] | display mxfer_entry at expr0 (for expr1) |
? | show registers and fault. | |
" | comment till end of line. | |
! | expr | print expression expr. |
b | expr | set breakpoint at address expr. |
b | ? | show all breakpoints. |
g | continue execution | |
s | enter single-step mode. | |
v | continue from fault via "stored" fault vector. | |
V | [expr] | trap fault expr (default all) |
u | [expr] | clear breakpoint at address expr, or clear all breakpoints. |
U | [expr] | restore fault expr (default all) |
= | continuing, keeping breakpoint |
In single step mode the prompt is the disassembled opcode to be executed. If the user presses Enter it will not be executed. Space, i or I will execute one opcode and re-enter single-step mode. If the opcode is a "call", the O key will step over the function.
Disassemble mode (D) shows each opcode, Space shows the next one. Any other key moves back to command mode.
The debugger parses expressions that conform to the following grammar. The precedence of operations are as in C.
expr : primary | '(' expr ')' | expr '*,/,%' expr | expr '+,-' expr | expr '<<,>>' expr | expr '==,!=' expr | expr '&' expr | expr '^' expr | expr '|' expr | expr '&&' expr | expr '||' expr ; primary : value | primary ':' primary | register | '!' primary | '~' primary | '-' primary | '*' primary ; value : (0x)?'0-9a-f' + ; register : eax|ebx|ecx|edx|esi|edi|ebp|esp|eip|flags | ax| bx| cx| dx| si| di| bp| sp| ip | cs| ds| es| ss| fs| gs | cr[0-3] | dr[0-7] ;
The debugger supports limited line editing. The default behavior is EMACS-mode, but can be switched to QNX-mode by the colon commands. This table summarizes the editing characters.
Edit Cmd | EMACS-mode | QNX-mode | Description |
---|---|---|---|
home | Ctrl-A | Home | Move cursor to beginning of line. |
end | Ctrl-E | End | Move cursor to end of line. |
right | Ctrl-F | --> | Move cursor right one character. |
word right | ESC f | none | Move cursor right one word. |
left | Ctrl-B | <-- | Move cursor left one character. |
word left | ESC b | none | Move cursor left one word. |
line kill | Ctrl-U | none | Erase entire line. |
eol kill | ESC w | none | Erase from cursor to end of line. |
char delete | Ctrl-H | backspace | Delete current char. |
word delete | Ctrl-H | none | Delete current word. |
previous | Ctrl-P | /\ | Recall previous line. |
next | Ctrl-N | \/ | Recall next line. |
Dial the specified phone number before starting the debug session:
Debugger32 -s 3f8 -d ATDT5910941