home *** CD-ROM | disk | FTP | other *** search
- A BRIEF SUMMERY OF KDB COMMANDS
-
- The following is a brief list of the kdb commands. kdb uses the
- same command format as adb and expertise in adb is assumed. These
- describes kdb for the i386 machines but in general should apply to
- other machine types as well
-
- To enter the debugger:
-
- i386 - ctrl-alt-d
- pmax - do key (kernel must be enabled for this )
- sun3 - L1-a
-
- The format commands:
- <addr>/<letters>
- and write commands
- <addr>/{w,W} values
- function exactly as you would expect from adb. (And note that / and ?
- are treated the same.) So you can use kdb to disassemble code, look at
- memory locations and change memory locations.
-
- $r - will print out the register values
- <rname/var accesses the value of register_name/variable
- >rname/var sets the value of register_name/variable
-
- The neat features are the "step/breakpoint" commands, which are
- again analogous to the adb functions:
- :s - single step one instruction
- :c,C - continue until the next breakpoint
- (these both takes counts ala adb syntax)
- :p,P - print the instructions while single stepping
- :j - step until the next call or return and count
- the instructions
- :J - step until we return to this nesting level
- (show functions entered and instruction
- counts.)
- :S - step over the function call you are stopped at
- :r,R - set a temporary break at the return address, so
- you effectively step out of this function. (Note:
- make sure you have done the push %ebp, movl %esp,
- %ebp before you try this.)
-
-
- Breakpoints are set with <addr>:B and <addr>:D and listed with $B,
- just like adb. You may not provide commands to execute when a breakpoint
- is hit. <addr>:b #, <addr>:d and $b are very different breakpoints. They
- use the i386 hardware match facilities. You can set up to 4 breakpoints and
- you have to specify which one to ":b". Right now they work analogous to
- the "B" breakpoints. But someday, I will implement access to the hardware
- break on read and break on write features; all that is supported now is
- break on execute.
-
- @begin(verbatim)
- $l - lists the state of all the threads
- $L - lists the state and stack of all the threads
-
- $k - does a stack trace
- $c - does a stack trace
- <thread>$K - does a stack trace for the give thread
- <addres>$C - does a stack trace at the given frame.
- <map>$m - prints the map at address <map>
- <addres>$Pp - prints port
- <addres>$PO - prints object
- <addres>$PM - prints map
- <addres>$PP - prints "page structure"
-
- <function>! arg0 arg1 ... invokes function with the given arguments
-
- R! - invokes the function to sync the disk and reboot
- Q! - invokes the function to reboot
-
- pb! - invokes the playback function. The screen is small
- compared to the info you might want to display; pb
- will play back each line and wait for a space or
- return before continuing. Any other character
- terminates playback. The buffer is 64k.
-
-
-
-