UP
CapROS home
Kernel Development
Guide
|
|
kdb Reference
Name
kdb -- Kernel Debugger
Description
kdb is based on the Mach kernel debugger ddb.
Typing control-c while CapROS is running will cause the kernel
debugger to be entered.
Try this link
for a formatted "man page", giving a description of most commands.
Here are a few useful commands:
- help
- Print a list of commands.
- trace [proc] [,count]
- Print a stack trace of the specified process, or if no process
is specified, the kernel and current process.
- c
- Continue execution
- reboot (or rb)
- Reboot the target computer.
- addrspace [<address>]
- Switch to the address space of the Process at the specified address.
If no address is specified, this command uses the current Process.
- check nodes
- Checks the validity of all Node structures.
- check pages
- Checks the validity of all pages.
- check procs
- Checks the validity of all Process structures.
- debug inttrap y
- debug inttrap n
- Turns the "dbg_inttrap" flag on and off. When on, the debugger
is entered at the beginning of the interrupt/trap handler.
The flag is off by default.
- debug wild y
- debug wild n
- If the kernel is configured with DBG_WILD_PTR defined, this
command turns the "dbg_wild_ptr" flag on and off.
When on, the kernel does extensive checking of pointers.
If configured, the flag is on by default.
- node <OID>
- Print the node with the specified OID.
- page <OID>
- Print information about the page with the specified OID.
- pframe <physAddr>
- Print information about the page at the specified physical address.
- kstat show
- Print the kernel statistics.
- kstat fast
- Print the fast IPC statistics.
- kstat clear
- Clear the kernel statistics counters.
- kstat hist depend
- Print usage counts for all depend buckets.
- kstat hist depend <bucket>
- Print data for the specified depend bucket.
- kstat hist object
- Print usage counts for all objhash buckets.
- kstat hist object <bucket>
- Print data for the specified objhash bucket.
- mesg flag
- Toggle a flag, which must be one of:
allinv, gate, keyerr, keeper, return,
segwalk, uqueue, uyield. These flags enable debugging
stops throughout the kernel.
- uqueue
- Stops when a user process is queued or exits the kernel.
- uyield
- Stops when a user process yields or the current process changes.
- mesg procinv [addr]
- Toggle a flag that enables a debugging stop when the process
at the specified addr performs an invocation.
If addr is omitted, the current process is used.
- mesg proctrap [addr]
- Toggle a flag that enables a debugging stop when the process
at the specified addr traps to a keeper.
If addr is omitted, the current process is used.
- mesg show
- Print the flags that are currently set.
- show
- Without any arguments, this command prints a list of arguments
you can give. Here are explanations of most of them:
- show regs
- Print the kernel registers on entry to the debugger.
- show inv
- If a CapROS invocation is active, this command prints
some information in the inv structure.
- show entry
- If a CapROS invocation is active, this command prints
the information in the inv.entry structure.
- show exit
- If a CapROS invocation is active, this command prints
the information in the inv.exit structure.
- show invokee
- If a CapROS invocation is active, this command prints
the context of the invokee.
- show keyregs [<address>]
- Print the key registers of the current or specified process.
- show invkeys
- If a CapROS invocation is active, this command prints
the key registers of the invokee.
- show key <address>
- Print the key at the specified address.
- show keyring <address>
- Print all the keys on the specified keyring.
- show cckr [<address>]
- Print all the keys that refer to the process
context at the specified address (the keyring of the process).
If no address is specified, this command prints
the information for the current process.
- show activity [<address>]
- Print the Activity at the specified address.
If no address is specified, this command prints
the current activity.
- show activities
- Print all the Activitys.
- show mappings <space> <base> <nPages>
- <space> must be the physical address of the beginning
of a top-level mapping table.
For the <nPages> pages beginning at virtual address
<base>, this command prints the PTEs for each address.
<space>, <base>, and <nPages> must be
numbers not expressions.
- show depend <address>
- Show all depend entries for the specified key address.
- show proc [<address>]
- Print the Process at the specified address.
If no address is specified, this command prints the current
Process.
- show floatregs [<address>]
- Print the floating point registers
of the Process at the specified address.
If no address is specified, this command prints the registers
of the current Process.
- show sa <address>
- Print the registers in the fixregs_t
save area at the specified address.
- show ioreqs
- Print information about all the IORequests.
- show node <address>
- Print the node at the specified address.
- show nodes all
- show nodes persistent
- show nodes nonpersistent
- Print information about all the specified nodes in memory.
- show pages all
- show pages persistent
- show pages nonpersistent
- Print information about all the specified pages in memory.
- show procs
- Print information about all the processes in memory.
- show readylist
- Print the list of processes ready to run.
- show pmem
- Print information about all the regions of physical memory
(PmemInfo).
- show obhdr <address>
- Print the ObjectHeader or PageHeader structure
at the specified address.
- show pins
- Print information about all pinned objects.
- show pte <address>
- Print the page table entry at the specified virtual address.
- show sizes
- Print the sizes of some kernel structures.
- show sources
- Print information about all the ObjectSources.
- show walkinfo <address>
- Print the SegWalk structure at the specified address.
- profile clear
-
- profile all
-
- profile top
- These commands are available when the kernel profiling option
is configured.
|
|