History log of /freebsd-10.1-release/sys/ddb/db_output.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 272461 02-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 207922 11-May-2010 attilio

There is not a good reason to have a different prototype for db_printf()
when compared to printf().
Unify it by returning the number of characters displayed for db_printf()
as well.

MFC after: 7 days


# 181842 18-Aug-2008 attilio

Add a missing include which was erroneusly left out from the previous
commit.

Sponsored by: Nokia


# 181840 18-Aug-2008 attilio

Bufferize the output for DDB printouts.
In order to CATER this, DDB buffered output can be choosen at compile
time through the option DDB_BUFR_SIZE=nbytes where nbytes choose the size
of the buffer (suggested size is 128 bytes), which should be manually
specified in any interested config file.

Sponsored by: Nokia


# 174910 25-Dec-2007 rwatson

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


# 163190 10-Oct-2006 bde

Fixed loss of whitespace suppression at ends of lines. Whitespace
suppression is only needed at ends of lines, but rev.1.32 forced it
off precisely there.

The --More-- prompt is now cleared by explicitly forcing out the
whitespace in "\r \r". It might be better to use the line
editor's clearing functions, but these are currently static and not
much different.


# 163134 08-Oct-2006 bde

Fixed formatting of printing of command tables. WIth the default max
output width of 79, only 6 columns of width 12 each fit, but 7 columns
were printed.

The fix is to pass the width of the next output to db_end_line() and
not assume there that this width is always 1.

Related unfixed bugs:
- 1 character is wasted for a space after the last column
- suppression of trailing spaces used to limit the misformatting, but
seems to have been lost
- in db_examine(), the width of the next output is not know and is
still assumed to be 1.


# 160312 12-Jul-2006 jhb

Simplify the pager support in DDB. Allowing different db commands to
install custom pager functions didn't actually happen in practice (they
all just used the simple pager and passed in a local quit pointer). So,
just hardcode the simple pager as the only pager and make it set a global
db_pager_quit flag that db commands can check when the user hits 'q' (or a
suitable variant) at the pager prompt. Also, now that it's easy to do so,
enable paging by default for all ddb commands. Any command that wishes to
honor the quit flag can do so by checking db_pager_quit. Note that the
pager can also be effectively disabled by setting $lines to 0.

Other fixes:
- 'show idt' on i386 and pc98 now actually checks the quit flag and
terminates early.
- 'show intr' now actually checks the quit flag and terminates early.


# 150842 02-Oct-2005 cognet

- Call db_setup_paging() for traceall.
- Make it so one can't call db_setup_paging() if it has already been called
before. traceall needs this, or else the db_setup_paging() call from
db_trace_thread() will reset the printed line number, and override its
argument.
This is not perfect for traceall, because even if one presses 'q' while in
the middle of printing a backtrace it will finish printing the backtrace
before exiting, as db_trace_thread() won't be notified it should stop, but
it is hard to do better without reworking the pager interface a lot more.


# 139747 05-Jan-2005 imp

Start each of the license/copyright comments with /*-


# 137117 01-Nov-2004 jhb

- Change the ddb paging "support" to use a variable (db_lines_per_page) to
control the number of lines per page rather than a constant. The variable
can be examined and changed in ddb as '$lines'. Setting the variable to
0 will effectively turn off paging.
- Change db_putchar() to force out pending whitespace before outputting
newlines and carriage returns so that one can rub out content on the
current line via '\r \r' type strings.
- Change the simple pager to rub out the --More-- prompt explicitly when
the routine exits.
- Add some aliases to the simple pager to make it more compatible with
more(1): 'e' and 'j' do a single line. 'd' does half a page, and
'f' does a full page.

MFC after: 1 month
Inspired by: kris


# 131952 10-Jul-2004 marcel

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.


# 125134 28-Jan-2004 njl

If not in the debugger or if the user requests it with the
debug.ddb_use_printf sysctl, output kernel debugger data to both the
console and kernel message buffer via printf. This fixes the case where
backtrace() went directly to the console and should help debugging greatly.
Thanks to Ian Dowse for the work, minor edits or any bugs are by myself.

Submitted by: iedowse


# 118268 31-Jul-2003 jhb

Add a one-shot callout facility to db_printf() that executes the registered
callout when a specified number of lines have been output. This can be
used to implement pagers for ddb commands that output a lot of text. A
simple paging function is included that automatically rearms itself when
fired.

Reviewed by: bde, julian


# 116176 10-Jun-2003 obrien

Use __FBSDID().


# 92756 20-Mar-2002 alfred

Remove __P.


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 49558 09-Aug-1999 phk

Merge the cons.c and cons.h to the best of my ability. alpha may or
may not compile, I can't test it.


# 37504 08-Jul-1998 bde

Fixed bogus type of valuep in struct db_variable. It was `int *' and
became `long *' for alpha, but should always have been `db_expr_t *'.
Fixed variable types to match.


# 36735 07-Jun-1998 dfr

This commit fixes various 64bit portability problems required for
FreeBSD/alpha. The most significant item is to change the command
argument to ioctl functions from int to u_long. This change brings us
inline with various other BSD versions. Driver writers may like to
use (__FreeBSD_version == 300003) to detect this change.

The prototype FreeBSD/alpha machdep will follow in a couple of days
time.


# 24490 01-Apr-1997 bde

Fixed gratuitous ANSIisms.


# 22975 22-Feb-1997 peter

Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 18298 14-Sep-1996 bde

Attached vm ddb commands `show map', `show vmochk', `show object',
`show vmopag', `show page' and `show pageq'. Moved all vm ddb stuff
to the ends of the vm source files.

Changed printf() to db_printf(), `indent' to db_indent, and iprintf()
to db_iprintf() in ddb commands. Moved db_indent and db_iprintf()
from vm to ddb.

vm_page.c:
Don't use __pure. Staticized.

db_output.c:
Reduced page width from 80 to 79 to inhibit double spacing for long
lines (there are still some problems if words are printed across
column 79).


# 15680 08-May-1996 gpalmer

Clean up various compiler warnings. Most (if not all) were benign

Reviewed by: bde


# 13594 23-Jan-1996 phk

Remove some now unused printfoids.


# 13446 15-Jan-1996 phk

Get rid of two and a half printf in the kernel.
Add more features to the one remaining to handle the job:
+ signed quantity.
# alternate format
- left padding
* read width as next arg.
n numeric in (argument specified) default radix.

Fix the DDB debugger to use these.
Use vprintf in debug routine in pcvt.

The warnings from gcc may become more wrong and intolerable because
of this.

Warning: I have not checked the entire source for unsupported or
changed constructs, but generally belive that there are only a few.

Suggested by: bde


# 12734 10-Dec-1995 bde

Reduced and cleaned up #includes.


# 12662 07-Dec-1995 dg

Untangled the vm.h include file spaghetti.


# 12515 29-Nov-1995 phk

Staticized and '#ifdef notused' stuff we don't use.


# 12473 24-Nov-1995 bde

Completed function declarations and/or added prototypes and/or #includes
to get the prototypes.

Changed some `int's to `boolean_t's. boolean_t's are ints so they are
hard to distinguish from ints.

Converted function headers to old-style. ddb is written in K&R1 C
except where we broke it.


# 8876 30-May-1995 rgrimes

Remove trailing whitespace.


# 4016 30-Oct-1994 bde

Print "(null)" instead of crashing for null strings. Null names are
often generated for stack traces. Now inspection of unmapped addresses
no longer panics the system.


# 3140 27-Sep-1994 phk

Makes gcc silent in sys/ddb.


# 2320 27-Aug-1994 dg

1) Changed ddb into a option rather than a pseudo-device (use options DDB
in your kernel config now).
2) Added ps ddb function from 1.1.5. Cleaned it up a bit and moved into its
own file.
3) Added \r handing in db_printf.
4) Added missing memory usage stats to statclock().
5) Added dummy function to pseudo_set so it will be emitted if there
are no other pseudo declarations.


# 2056 13-Aug-1994 wollman

Change all #includes to follow the current Berkeley style. Some of these
``changes'' are actually not changes at all, but CVS sometimes has trouble
telling the difference.

This also includes support for second-directory compiles. This is not
quite complete yet, as `config' doesn't yet do the right thing. You can
still make it work trivially, however, by doing the following:

rm /sys/compile
mkdir /usr/obj/sys/compile
ln -s M-. /sys/compile
cd /sys/i386/conf
config MYKERNEL
cd ../../compile/MYKERNEL
ln -s /sys @
rm machine
ln -s @/i386/include machine
make depend
make


# 879 18-Dec-1993 wollman

Make everything compile with -Wtraditional. Make it easier to distribute
a binary link-kit. Make all non-optional options (pagers, procfs) standard,
and update LINT to reflect new symtab requirements.

NB: -Wtraditional will henceforth be forgotten. This editing pass was
primarily intended to detect any constructions where the old code might
have been relying on traditional C semantics or syntax. These were all
fixed, and the result of fixing some of them means that -Wall is now a
realistic possibility within a few weeks.


# 798 24-Nov-1993 wollman

Make the LINT kernel compile with -W -Wreturn-type -Wcomment -Werror, and
add same (sans -Werror) to Makefile for future compilations.


# 623 16-Oct-1993 rgrimes

Removed all patch kit headers, sccsid and rcsid strings, put $Id$ in, some
minor cleanup. Added $Id$ to files that did not have any version info, etc


# 430 09-Sep-1993 rgrimes

Moved db_end_line after db_printf to eliminate forward reference and
shut up the compiler about prototype mismatch.


# 200 27-Jul-1993 dg

* Applied fixes from Bruce Evans to fix COW bugs, >1MB kernel loading,
profiling, and various protection checks that cause security holes
and system crashes.
* Changed min/max/bcmp/ffs/strlen to be static inline functions
- included from cpufunc.h in via systm.h. This change
improves performance in many parts of the kernel - up to 5% in the
networking layer alone. Note that this requires systm.h to be included
in any file that uses these functions otherwise it won't be able to
find them during the load.
* Fixed incorrect call to splx() in if_is.c
* Fixed bogus variable assignment to splx() in if_ed.c


# 5 12-Jun-1993 rgrimes

This commit was generated by cvs2svn to compensate for changes in r4,
which included commits to RCS files with non-trunk default branches.


# 4 12-Jun-1993 rgrimes

Initial import, 0.1 + pk 0.2.4-B1