13.5. dcmd and Walker Reference 13.5.1. Commands pipeline [!word...] [;] basic expr pipeline [!word...] [;] set dot, run once expr, expr pipeline [!word...] [;] set dot, repeat ,expr pipeline [!word...] [;] repeat expr [!word...] [;] set dot, last pipeline, run once ,expr [!word...] [;] last pipeline, repeat expr, expr [!word...] [;] set dot, last pipeline, repeat !word... [;] shell escape 13.5.2. Comments // Comment to end of line 13.5.3. Expressions Arithmetic integer 0i binary, 0o octal, 0t decimal, 0x hex 0t[0-9]+\.[0-9]+ IEEE floating point 'cccccccc' Little-endian character const <identifier variable lookup identifier symbol lookup (expr) the value of expr . the value of dot & last dot used by dcmd + dot+increment ^ dot-increment increment is effected by the last formatting dcmd. Unary Ops #expr logical NOT ~expr bitwise NOT -expr integer negation %expr object file pointer dereference %/[csil]/expr object file typed dereference %/[1248]/expr object file sized dereference *expr virtual address pointer dereference */[csil]/expr virtual address typed dereference */[1248]/expr virtual address sized dereference [csil] is char-, short-, int-, or long-sized Binary Ops expr * expr integer multiplication expr % expr integer division left # right left rounded up to next right multiple expr + expr integer addition expr - expr integer subtraction expr << expr bitwise left shift expr >> expr bitwise right shift (logical) expr == expr logical equality expr != expr logical inequality expr & expr bitwise AND expr ^ expr bitwise XOR expr | expr bitwise OR 13.5.4. Symbols kernel {module`}{file`}symbol proc {LM[0-9]+`}{library`}{file`}symbol 13.5.5. dcmds ::{module`}d expr>var write the value of expr into var 13.5.6. Variables 0 Most recent value [/\?=]ed. 9 Most recent count for $< dcmd b base VA of the data section d size of the data e VA of entry point hits Event callback match count m magic number of primary object file, or zero t size of text section thread TID of current representative thread. registers are exported as variables (g0, g1, ...) 13.5.7. Read Formats / format VA from . \ format PA from . ? format primary object file, using VA from . = format value of . B (1) hex + dot += increment C (1) char (C-encoded) - dot -= increment V (1) unsigned ^ (var) dot -= incr*count b (1) octal N newline c (1) char (raw) n newline d (2) signed T tab h (2) hex, swap endianness r whitespace o (2) octal t tab q (2) signed octal a dot as symbol+offset u (2) decimal I (var) address and instruction D (4) signed i (var) instruction H (4) hex, swap endianness S (var) string (C-encoded) O (4) octal s (var) string (raw) Q (4) signed octal E (8) unsigned U (4) unsigned F (8) double X (4) hex G (8) octal Y (4) decoded time32_t J (8) hex f (4) float R (8) binary K (4|8) hex uintptr_t e (8) signed P (4|8) symbol g (8) signed octal p (4|8) symbol y (8) decoded time64_t 13.5.8. Write Formats [/\?][vwWZ] value... value is immediate or $[expr] / write virtual addresses \ write physical addresses ? write object file v (1) write low byte of each value, starting at dot w (2) write low 2 bytes of each value, starting at dot W (4) write low 4 bytes of each value, starting at dot Z (8) write all 8 bytes of each value, starting at dot 13.5.9. Search Formats [/\?][lLM] value [mask] value and mask are immediate or $[expr] / search virtual addresses \ search physical addresses ? search object file l (2) search for 2-byte value, optionally masked L (4) search for 4-byte value, optionally masked M (8) search for 8-byte value, optionally masked 13.5.10. General dcmds ::help dcmd Give help text for 'dcmd.' ::dmods -l [module...] List dcmds and walkers grouped by the dmod which provides them. ::log -e file Log session to file. ::quit / $q Quit. 13.5.11. Target-Related dcmds ::status Print summary of current target. $r / ::regs Display current register values for target. $c / ::stack / $C Print current stack trace ($C: with frame pointers). addr[,b]::dump [-g sz] [-e] Dump at least b bytes starting at address addr. -g sets the group size -- for 64-bit debugging, '-g 8' is useful. addr::dis Disassemble text, starting around addr. [ addr ] :b [ addr ] ::bp [+/-dDestT] [-c cmd] [-n count] sym ... addr [cmd ... ] Set breakpoint at addr. $b ::events [-av] $b [-av] Display all the breakpoints. addr ::delete [id | all] addr :d [id | all] Delete a breakpoint at addr. :z Deletes all breakpoints ::cont [SIG] :c [SIG] Continue the target program, and wait for it to terminate id ::evset [+/-dDestT] [-c cmd] [-n count] id ... Modify the properties of one or more software event specifiers. ::next [SIG] :e [SIG] Step the target program one instruction, but step over subroutine calls. ::step [branch | over | out] [SIG] :s SIG :u SIG Step the target program one instruction. addr [,len]::wp [+/-dDestT] [-rwx] [-ip] [-c cmd] [-n count] addr [,len]:a [cmd... ] addr [,len]:p [cmd... ] addr [,len]:w [cmd... ] Set a watchpoint at the specified address. 13.5.12. CTF-Related addr::print [type] [field...] Use CTF info to print out a full structure, or particular fields thereof. ::sizeof type / ::offsetof type field / ::enum enumname Get information about a type addr::array [type count] [var] Walk the count elements of an array of type 'type' starting at address. addr::list type field [var] Walk a circular or NULL-terminated list of type 'type', which starts at addr and uses 'field' as its linkage. ::typegraph / addr::whattype / addr::istype type / addr::notype bmc's type inference engine -- works on non-debug 13.5.13. Kernel: proc-Related 0tpid::pid2proc Convert the process ID 'pid' (in decimal) into a proc_t ptr. as::as2proc Convert a 'struct as' pointer to its associated proc_t ptr. vn::whereopen Find all processes with a particular vnode open. ::pgrep pattern Print out proc_t ptrs which match pattern. [procp]::ps Process table, or (with procp) the line for particular proc_t. ::ptree Print out a ptree(1)-like indented process tree. procp::pfiles Print out information on a process' file descriptors. [procp]::walk proc walks all processes, or the tree rooted at procp 13.5.14. Kernel: Thread-Related threadp::findstack Print out a stack trace (with frame pointers) for threadp. [threadp]::thread Give summary information about all threads or a particular thread. [procp]::walk thread Walk all threads, or all threads in a process (with procp). 13.5.15. Kernel: Synchronization-Related [sobj]::wchaninfo [-v] Get information on blocked-on condition variables. With sobj, info about that wchan. With -v, lists all threads blocked on the wchan. sobj::rwlock Dump out a rwlock, including detailed blocking information. sobj::walk blocked Walk all threads blocked on sobj, a synchronization object. 13.5.16. Kernel: CPU-Related ::cpuinfo [-v] Give information about CPUs on the system and what they are doing. With '-v', show threads on the run queues. ::cpupart Give information about CPU partitions (psrset(1m)s). addr::cpuset Print out a cpuset as a list of included CPUs. [cpuid]::ttrace Dump out traptrace records, which are generated in DEBUG kernels. These include all traps and various other events of interest. ::walk cpu Walk all cpu_ts on the system. 13.5.17. Kernel: Memory-Related ::memstat Display memory usage summary. pattern::kgrep [-d dist|-m mask|-M invmask] Search the kernel heap for pointers equal to pattern. addr::whatis [-b] Try to identify what a given kernel address is. With '-b', give bufctl address for the buffer (see $<bufctl_audit, below). 13.5.18. Kernel: kmem-Related ::kmastat Give statistics on the kmem caches and vmem arenas in the system ::kmem_cache Information about the kmem caches on the system [cachep]::kmem_verify Validate all buffers in the system, checking for corruption. With cachep, shows the details of a particular cache. threadp::allocdby / threadp::freedby Show buffers that were last allocated/freed by a particular thread, and are still in that state. ::kmalog [fail | slab] Dump out the transaction log, showing recent kmem activity. With fail/slab, outputs records of allocation failures and slab creations (which are always enabled) ::findleaks [-dvf] Find memory leaks, coalesced by stack trace. ::bufctl [-v] Print a summary line for a bufctl -- can also filter them -v dumps out a kmem_bufctl_audit_t. ::walk cachename Print out all allocated buffers in the cache named cachename. [cp]::walk kmem/[cp]::walk freemem/[cp]::walk bufctl/[cp]::walk freectl Walk {allocated,freed}{buffers,bufctls} for all caches, or the particular kmem_cache_t cp. 13.5.19. Process: Target-Related flt ::fltbp [+/-dDestT] [-c cmd] [-n count] flt ... Trace the specified machine faults. signal :i Ignore the specified signal and allow it to be delivered transparently to the target. $i Display the list of signals that are ignored by the debugger and will be handled directly by the target. $l Print the LWPID of the representative thread if the target is a user process. $L Print the LWPIDs of each LWP in the target if the target is a user process. ::kill :k Forcibly terminate the target if it is a live user process. ::run [args ... ] :r [args ... ] Start a new target program running with the specified arguments and attach to it. [signal] ::sigbp [+/-dDestT] [-c cmd] [-n count] SIG ... [signal] :t [+/-dDestT] [-c cmd] [-n count] SIG ... Trace delivery of the specified signals. ::step [branch | over | out] [SIG] :s SIG :u SIG Step the target program one instruction. [syscall] ::sysbp [+/-dDestT] [-io] [-c cmd] [-n count] syscall ... Trace entry to or exit from the specified system calls. 13.5.20. Kernel: kmdb-Related ::help dcmd gives help text for 'dcmd' ::dmods -l [module...] Lists dcmds and walkers grouped by the dmod which provides them ::status Print summary of current target. $r ::regs Display current register values for target. $c ::stack $C Print current stack trace ($C: with frame pointers). addr[,b] ::dump [-g sz] [-e] Dump at least b bytes starting at address addr. -g sets the group size; for 64-bit debugging, -g 8 is useful. addr::dis Disassemble text, starting around addr. [ addr ] :b [ addr ] ::bp [+/-dDestT] [-n count] sym ... addr Set breakpoint at addr. $b Display all the breakpoints. ::branches Display the last branches taken by the CPU. (x86 only) addr ::delete [id | all] addr :d [id | all] Delete a breakpoint at addr. :z Delete all breakpoints. function ::call [arg [arg ...]] Call the specified function, using the specified arguments. [cpuid] ::cpuregs [-c cpuid] Display the current general-purpose register set. [cpuid] ::cpustack [-c cpuid] Print a C stack backtrace for the specified CPU. ::cont :c Continue the target program. $M List the macro files that are cached by kmdb for use with the $< dcmd ::next :e Step the target program one instruction, but step over subroutine calls. ::step [branch | over | out] Step the target program one instruction. $<systemdump Initiate a panic/dump. ::quit [-u] $q Cause the debugger to exit. When the -u option is used, the system is resumed and the debugger is unloaded. addr [,len]::wp [+/-dDestT] [-rwx] [-ip] [-n count] addr [,len]:a [cmd ...] addr [,len]:p [cmd ...] addr [,len]:w [cmd ...] Set a watchpoint at the specified address. |