Commit Graph

8 Commits

Author SHA1 Message Date
John Baldwin
93d4804b62 Initialize the DDB command list when initializing DDB so that the basic
commands are available from 'boot -d'.

Suggested by:	dfr
2008-09-25 19:50:14 +00:00
Robert Watson
c9b0cc3b96 Add a simple scripting facility to DDB(4), allowing the user to
define a set of named scripts.  Each script consists of a list of DDB
commands separated by ";"s that will be executed verbatim.  No higher
level language constructs, such as branching, are provided for:
scripts are executed by sequentially injecting commands into the DDB
input buffer.

Four new commands are present in DDB: "run" to run a specific script,
"script" to define or print a script, "scripts" to list currently
defined scripts, and "unscript" to delete a script, modeled on shell
alias commands.  Scripts may also be manipulated using sysctls in the
debug.ddb.scripting MIB space, although users will prefer to use the
soon-to-be-added ddb(8) tool for usability reasons.

Scripts with certain names are automatically executed on various DDB
events, such as entering the debugger via a panic, a witness error,
watchdog, breakpoint, sysctl, serial break, etc, allowing customized
handling.

MFC after:	3 months
2007-12-26 09:33:19 +00:00
Robert Watson
086fec574e Add a new DDB(4) facility, output capture. Input and output from DDB may be
captured to a memory buffer for later inspection using sysctl(8), or in the
future, to a textdump.

A new DDB command, "capture", is added, which accepts arguments "on", "off",
"reset", and "status".

A new DDB sysctl tree, debug.ddb.capture, is added, which can be used to
resize the capture buffer and extract buffer contents.

MFC after:	3 months
2007-12-25 23:06:51 +00:00
Konstantin Belousov
a0396f2797 Set up the context for the dbbe_trace callback in the ddb. Otherwise,
trap caused by backtracing would lead to panic.

Noted and reviewed by:	bde
2006-11-06 11:10:57 +00:00
Warner Losh
dd3cb56845 Start each of the license/copyright comments with /*- 2005-01-06 01:34:41 +00:00
Alexander Kabaev
0171fe42f2 Damage control. Correcly advance symtab and strtab pointers, not
table length values.

Spotted by:	iedowse
2004-07-28 08:59:08 +00:00
Alexander Kabaev
eec256de79 Avoid casts as lvalues. 2004-07-28 06:21:53 +00:00
Marcel Moolenaar
37224cd3fc Mega update for the KDB framework: turn DDB into a KDB backend.
Most of the changes are a direct result of adding thread awareness.
Typically, DDB_REGS is gone. All registers are taken from the
trapframe and backtraces use the PCB based contexts. DDB_REGS was
defined to be a trapframe on all platforms anyway.
Thread awareness introduces the following new commands:
	thread X	switch to thread X (where X is the TID),
	show threads	list all threads.

The backtrace code has been made more flexible so that one can
create backtraces for any thread by giving the thread ID as an
argument to trace.

With this change, ia64 has support for breakpoints.
2004-07-10 23:47:20 +00:00