Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ kadb(1M) — SunOS 5.2

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

adb(1)

boot(1M)

kernel(1M)

monitor(1M)

kadb(1M)

NAME

kadb − a kernel debugger

SYNOPSIS

ok boot device_specifier kadb

> b kadb [ −d ] [ boot-flags ]

DESCRIPTION

kadb is an interactive debugger with a user interface similar to that of adb(1), the assembly language debugger.  kadb must be loaded prior to the standalone program it is to debug.  It runs in the same address space as the standalone program, thus sharing many resources with that program.  The debugger is cognizant of and able to control multiple processors, should they be present in a system. 

Unlike adb, kadb runs in the same supervisor virtual address space as the program being debugged — although it maintains a separate context.  The debugger runs as a co-process that cannot be killed (no ‘:k’) or rerun (no ‘:r’).  There is no signal control (no ‘:i’, ‘:t’, or ‘$i’), although the keyboard facilities (CTRL−C, CTRL−S, and CTRL−Q) are simulated. 

In the case of the Unix kernel, the keyboard abort sequence (L1-A for console, BREAK for serial line ) will suspend kernel operations and break into the debugger.  kadb gives a prompt as:

kadb[ #]

where # is the cpu it is currently executing on. 

Since the kernel is composed of the core image file ( /kernel/unix) and the set of loadable modules already in memory, kadb has the capability of debugging all of these by traversing special data structures.  kadb makes use of this feature to allow it to reference any kernel data structure, even if it resides in a loadable module.  kadb will set the ’−d’ flag by default so the program being debugged can tell it is being watched.  If this flag is not given, kadb will load and immediately run the default kernel ( /kernel/unix). 

device-specifier specifies the device to load from (see monitor(1M)). 

Most adb commands function in kadb as expected.  As with ‘adb −k’, $p works when debugging kernels.  The verbs ?  and / are equivalent in kadb, since there is only one address space in use. 

Additional Commands

kadb has the following additional commands. 

[ Like :e in adb(1), but requires only one keystroke and no RETURN character. 

] Like :s in adb(1), but requires only one keystroke and no RETURN character. 

Note: for the general syntax of adb commands, see adb(1). 

OPTIONS

−d Interactive startup.  Promps with kadb: for a file to be loaded.  From here, you can enter the name of a program to debug.  The default program name will be given in square brackets ([ ]).

boot-flags
You can specify boot flags as arguments when invoking kadb.  Boot flags are passed to the program being debugged.  See the appropriate manual page for relevant boot flags. 

USAGE

Kernel Macros

As with adb, macros can be compiled and used with kadb, but they must be linked into kadb directly and not read from a file at runtime.  The kadb command $M lists macros currently complied into kadb. 

FILES

/kadb the debugger itself

/kernel/unix the default kernel

SEE ALSO

adb(1), boot(1M), kernel(1M), monitor(1M)

DIAGNOSTICS

kadb gives the same cryptic response as adb. 

BUGS

kadb cannot reliably single-step over instructions which change the processor status register. 
 

SunOS 5.2  —  Last change: 14 Feb 1991

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026