History log of /freebsd-10.1-release/sys/ddb/db_input.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


# 229272 02-Jan-2012 ed

Use strchr() and strrchr().

It seems strchr() and strrchr() are used more often than index() and
rindex(). Therefore, simply migrate all kernel code to use it.

For the XFS code, remove an empty line to make the code identical to
the code in the Linux kernel.


# 176895 07-Mar-2008 rwatson

Reserve two bytes at the end of the DDB input line in db_readline() to
hold the newline and nul terminator. Otherwise, there are cases where
garbage may end up in the command history due to a lack of a nul
terminator, or input may end up without room for a newline.

MFC after: 3 days
PR: 119079
Submitted by: Michael Plass <mfp49_freebsd@plass-family.net>


# 176870 06-Mar-2008 rwatson

When redrawing an input line, count backspaces to get to the beginning of
the input field from the current cursor location, rather than the end of
the input line, as the cursor may not be at the end of the line.
Otherwise, we may overshoot, overwriting a bit of the previous line and
failing to fully overwrite the current line.

MFC after: 3 days
PR: 119079
Submitted by: Michael Plass <mfp49_freebsd@plass-family.net>


# 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


# 139747 05-Jan-2005 imp

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


# 116176 10-Jun-2003 obrien

Use __FBSDID().


# 115495 31-May-2003 phk

Add /* FALLTHROUGH */

Found by: FlexeLint


# 113071 04-Apr-2003 des

The kernel bcopy() is safe for overlapping regions (and always has), so
there is no use for a separate ovbcopy().


# 104094 28-Sep-2002 phk

Be consistent about "static" functions: if the function is marked
static in its prototype, mark it static at the definition too.

Inspired by: FlexeLint warning #512


# 92756 20-Mar-2002 alfred

Remove __P.


# 90591 12-Feb-2002 yar

^U kills an entire input line in most applications,
including the default terminal canonical mode.
So let ddb(4) be no exception from this rule.

Pointed out by: Mark Peek <mark@peek.org>


# 90528 11-Feb-2002 yar

Teach ddb(4) to delete to the beginning of its command line on ^U.

PR: kern/28976
Submitted by: Nickolai Zeldovich <kolya@orbit.zepa.net>


# 55823 11-Jan-2000 yokota

Add a new mechanism, cndbctl(), to tell the console driver that
ddb is entered. Don't refer to `in_Debugger' to see if we
are in the debugger. (The variable used to be static in Debugger()
and wasn't updated if ddb is entered via traps and panic anyway.)

- Don't refer to `in_Debugger'.
- Add `db_active' to i386/i386/db_interface.d (as in
alpha/alpha/db_interface.c).
- Remove cnpollc() stub from ddb/db_input.c.
- Add the dbctl function to syscons, pcvt, and sio. (The function for
pcvt and sio is noop at the moment.)

Jointly developed by: bde and me

(The final version was tweaked by me and not reviewed by bde. Thus,
if there is any error in this commit, that is entirely of mine, not
his.)

Some changes were obtained from: NetBSD


# 52812 02-Nov-1999 archie

Remove unused macro definition.


# 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.


# 48810 14-Jul-1999 yokota

The following patch will remove a hack introduced in
/sys/ddb/db_input.c rev 1.19 to recognize syscons's cursor keycodes.
It is unnecessary now that scgetc() in syscons returns the escape
sequence for the cursor keys rather than their raw, internal key
codes.


# 31549 05-Dec-1997 dyson

Some fixes from John Hood:
1) Fix the initialization of malloc structure that changed
due to perf opt.
2) Remove unneeded include.
3) An initialization assert added to malloc.
Submitted by: John Hood <cgull@smoke.marlboro.vt.us>


# 31314 20-Nov-1997 bde

Cleaned up revs.1.19-1.21:


# 31062 09-Nov-1997 msmith

A better fix for the ddb command history buffer problem; use a static
buffer instead of trying to use malloc() in the input routine.
Submitted by: john hood <cgull@smoke.marlboro.vt.us>


# 31005 07-Nov-1997 msmith

Don't try to do anything with the input history if MALLOC() for the buffer
failed.

This broke early debugging.


# 28330 17-Aug-1997 joerg

Minor hack to also allow for syscons's "interesting" arrow keys.

I'm using "#if __i386__ && __FreeBSD__" to check for a ``potentially
syscons-relevant environment''. Hope that's ok...


# 24840 12-Apr-1997 joerg

Everyone's favorite, i think: make DDB understand the arrow keys for the
basic cursor movements. Assumes ANSI/DEC tty, but you can still resort
to plain emacs ^p/^n etc anyway.


# 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.


# 19268 30-Oct-1996 julian

if there is no console, cngetc should act like getc and return -1

make callers aware of this in those cases where it can occur.


# 17495 10-Aug-1996 joerg

Finally implement a simple commandline history in DDB.

Emacs-style line editing has already been there (did anybody ever
notice this? :), so i `only' had to add ^P and ^N. The approach is
fairly minimalistic, with the advantage of keeping the bloat as small
as 864 bytes of .text and 16 bytes of .bss, plus 10*120 bytes
malloc'ed history buffer at the first use.


# 15680 08-May-1996 gpalmer

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

Reviewed by: bde


# 12734 10-Dec-1995 bde

Reduced and cleaned up #includes.


# 12720 10-Dec-1995 phk

Staticize and cleanup.


# 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.


# 2112 18-Aug-1994 wollman

Fix up some sloppy coding practices:

- Delete redundant declarations.
- Add -Wredundant-declarations to Makefile.i386 so they don't come back.
- Delete sloppy COMMON-style declarations of uninitialized data in
header files.
- Add a few prototypes.
- Clean up warnings resulting from the above.

NB: ioconf.c will still generate a redundant-declaration warning, which
is unavoidable unless somebody volunteers to make `config' smarter.


# 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


# 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