Commit Graph

250 Commits

Author SHA1 Message Date
christos fe659fa011 fix uninitialized variable 2003-10-25 08:48:11 +00:00
chs d2266994e2 add "b" as a synonym for "break", since someone added "bt"
and made "b" an ambiguous prefix.
2003-10-10 15:21:24 +00:00
scw 5efdd1f9f3 Tweak the previous change to ensure symbol addresses are correctly
sign-extended on cpus with 64-bit registers.
2003-10-05 11:17:47 +00:00
thorpej c7a178e4a9 Add a "show sched_qs" command to dump the run queues. Format is:
1	pid.lid (p_comm)
	pid.lid (p_comm)
 ...

If a queue has procs, but no sched_whichqs bit, it shows:
!1	pid.lid (p_comm)
2003-09-20 03:02:03 +00:00
uwe ca90f34170 Widen FLAGS column for ps/l so that all defined l_flag flags fit. 2003-09-07 14:14:36 +00:00
ragge 65e8bb870b long -> unsigned long, so that correct pointer is sent in function call. 2003-09-03 10:45:10 +00:00
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
simonb c9bc6f3a9a Allow the dmesg command to show the last N bytes of the kernel message
buffer.
2003-07-02 07:05:29 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
briggs 819d74ccf1 Somehow overlooked in earlier commits: prototype db_kgdb_cmd(). 2003-05-22 20:17:11 +00:00
scw 66cf68c402 On some platforms, sizeof(db_expr_t) > sizeof(long), so add a method
to select the right format string (at compile time) when displaying
variables of type db_expr_t.

This fixes a problem where ddb(4) would only display the low 32-bits
of registers for an ILP32 kernel on SH5, even though registers
(and db_expr_t) are always 64-bits wide.
2003-05-17 09:58:03 +00:00
scw 273f50f75f Don't assume sizeof(db_expr_t) == sizeof(long).
Ditto for sizeof(db_addr_t), although I don't think this
one is currently an issue.
2003-05-17 09:48:05 +00:00
kristerw 96059deea7 Add a cast to make this build with -D__AUDIT__. 2003-05-17 00:28:44 +00:00
itojun f9121aada7 switch to use strlcpy() from libkern. 2003-05-16 16:28:30 +00:00
itojun d4074ff0ab use strlcpy [change prototype of db_symstr to pass size_t; noone seem to use it] 2003-05-16 15:02:08 +00:00
atatat b5329c1d85 (1) Don't print the message buffer (via ddb's dmesg command) if the
message buffer has not yet been set up, mimicking code from the top of
the sysctl routine for retrieving the message buffer.

(2) Add a /l modifier to the trace command.  This makes it print the
backtrace using printf() instead of db_printf(), which has the nice
side-effect of also putting it into the message buffer.  A kernel with
ddb in it but disabled (ie, ddb.onpanic set to zero) will print a
backtrace (which ends up in the message buffer) before dumping (or
not, depending on the value of kern.dump_on_panic) and rebooting, but
if ddb is not disabled, the backtrace is not printed, and there's no
way to get it to display a backtrace such that you can retrieve it
after the dump.  The backtrace printed by gdb is sometimes a little
different.

(3) Documentation for the above.
2003-05-15 13:18:18 +00:00
jdolecek d17c485917 make couple ksym functions' arguments const 2003-05-11 08:23:22 +00:00
scw 8c5c893bf7 Add a BKPT_ADDR() macro which gives MD code a chance to munge a
breakpoint address before it's used. Currently a no-op on all but sh5.

This is useful on sh5, for example, to mask off the instruction
type encoding in the bottom two address bits, and makes it possible
to do "db> break $rXX" instead of manually munging the address.
2003-04-29 17:06:03 +00:00
ragge 797b42a988 By accident db_symstr() was removed, which Håvard pointed out.
Readded now.
2003-04-28 15:55:45 +00:00
briggs e2391a87b6 Add a rudimentary 'trap to kgdb' command if KGDB is defined. This allows
systems with only one serial port for console, etc., to have at least some
basic access to remote-kgdb-over-serial, even if it is a bit awkward.
2003-04-28 02:49:54 +00:00
ragge cddfd23e42 Mobe the SYMTAB_SPACE stuff to ksyms_init, so that it can be used without
DDB compiled-in.
2003-04-25 20:30:57 +00:00
ragge e675595289 db_sym_numargs() disappeared by mistake, restore it. 2003-04-24 21:18:34 +00:00
ragge 4ee3d47c73 Teach DDB to use ksyms instead of it's own symbol table management.
Note: For a.out kernels (beware!) DDB will still use the old stuff.
2003-04-24 20:00:48 +00:00
jdolecek 054da0dc1b make parameter 'name' for db_del_symbol_table() const 2003-04-16 09:00:29 +00:00
enami 0f4835d18b Don't specify string width in the low level function like db_num_to_str.
The pretty printing should be done much higher level, and anyway the
value 10 doesn't make sense.
2003-03-02 13:39:40 +00:00
jmc 1ed82b5b2c Add a synonym for trace - 'bt' and document it 2003-02-13 23:50:33 +00:00
thorpej 1b84adbe5f New callout implementation. This is based on callwheel implementation
done by Artur Grabowski and Thomas Nordin for OpenBSD, which is more
efficient in several ways than the callwheel implementation that it is
replacing.  It has been adapted to our pre-existing callout API, and
also provides the slightly more efficient (and much more intuitive)
API (adapted to the callout_*() naming scheme) that the OpenBSD version
provides.

Among other things, this shaves a bunch of cycles off rescheduling-in-
the-future a callout which is already scheduled, which the common case
for TCP timers (notably REXMT and KEEP).

The API has been simplified a bit, as well.  The (very confusing to
a good many people) "ACTIVE" state for callouts has gone away.  There
is now only "PENDING" (scheduled to fire in the future) and "EXPIRED"
(has fired, and the function called).

Kernel version bump not done; we'll ride the 1.6N bump that happened
with the malloc(9) change.
2003-02-04 01:21:03 +00:00
pk 58005dc9d3 Zombie procs have no lwps. 2003-01-23 12:41:33 +00:00
simonb bbd9776970 Remove variable that is only assigned too but not referenced. 2003-01-20 07:20:01 +00:00
thorpej b78f59b443 Merge the nathanw_sa branch. 2003-01-18 08:51:40 +00:00
yamt 64f7cc2afc make stack trace on i386 work again.
(signed vs unsigned)
2002-11-13 05:59:28 +00:00
thorpej 1f8b8e3411 Avoid a GCC 3.3 strict alias warning. 2002-11-10 03:24:51 +00:00
thorpej aaf0f03bd6 Fix signed/unsigned comparison warnings. 2002-11-10 03:22:28 +00:00
thorpej 50d19d9171 Fix signed/unsigned comparison warnings. 2002-11-10 03:12:17 +00:00
itohy 94b2e6e61d Dump DDB_* and SYMTAB_SPACE options to opt_ddbparam.h rather than opt_ddb.h.
These options are used in limited files but #include "opt_ddb.h" are
everywhere, and changing them caused almost full recompilation.
2002-11-04 06:24:38 +00:00
perry 6858187df6 /*CONTCOND*/ while (0)'ed macros 2002-11-02 07:20:42 +00:00
scw f7982b5823 Another item on the TODO list:
Add support for cpus where sizeof(register_t) is not necessarily
	the same as sizeof(void *). This is the case on SH5 using the
	ILP32 ABI. On this cpu db_expr_t is, necessarily, 64-bits.
	Unfortunately, in ILP32 mode, ddb will only display the low 32-bits
	of any expression, including registers...
2002-08-26 11:35:22 +00:00
scw a82718b34d Casting from a pointer, to a db_expr_t, has to go via an intptr_t.
(db_expr_t == int64_t on sh5, for example).
2002-08-26 11:34:27 +00:00
drochner 49c4cfb2c5 provide a db_vprintf() which is exactly what the name suggests 2002-06-05 17:53:52 +00:00
matt 98b5a4329f Add db_recover 2002-05-13 20:17:20 +00:00
simonb 14ac06f0bd Add a "show event" ddb command to show the event counters. 2002-02-15 11:18:26 +00:00
simonb 4eaa4d66a8 ANSIfy, KNF.
Make some variables and functions static when not used outside of a module.
Make variables in headers extern.
Delete the unused db_find_watchpoint() function.
2002-02-15 07:33:48 +00:00
jhawk 73c2346377 Add db_symstr(), a parallel interface to db_printsym() that
writes to a string rather than outputs to the supplied printer.
This is convenient for disassemblers that are structured to
build a long string and print it later.

Perhaps db_printsym() should be changed to use this interface...
2002-01-05 20:09:52 +00:00
jhawk 605db0bb09 ddb(9) 2002-01-05 01:48:10 +00:00
jhawk a21d1ea7ac Convenience variables (workXX) don't work, so don't document them. 2001-12-31 00:35:21 +00:00
lukem 99bccc3cab - pull in opt_kgdb.h where necessary
- replace opt_kgdb_machdep.h with opt_kgdb.h
- defparam opt_kgdb.h:
	KGDB_DEV KGDB_DEVNAME KGDB_DEVADDR KGDB_DEVRATE KGDB_DEVMODE
- move from opt_ddbparam.h to opt_ddb.h:
	DDB_FROMCONSOLE DDB_ONPANIC DDB_HISTORY_SIZE DDB_BREAK_CHAR SYMTAB_SPACE
- replace KGDBDEV with KGDB_DEV
- replace KGDBADDR with KGDB_DEVADDR
- replace KGDBMODE with KGDB_DEVMODE
- replace KGDBRATE with KGDB_DEVRATE
- use `9600' instead of `0x2580' for 9600 baud rate
- use correct quotes for  options KGDB_DEVNAME="\"com\""
- use correct quotes for  options KGDB_DEV="17*256+0"
- remove unnecessary dependancy on Makefile for kgdb_stub.o
- minor whitespace cleanup
2001-11-20 08:43:19 +00:00
lukem 2565646230 don't need <sys/types.h> when including <sys/param.h> 2001-11-15 09:47:59 +00:00
lukem 1ac69d9cb3 add RCSIDs 2001-11-12 22:54:03 +00:00
thorpej 47514a31be Remove unneeded declarations of the db_machine_init() function. The
ARM ports are the only ones that actually have one, and it is about
to change.
2001-11-09 06:52:23 +00:00