Commit Graph

253 Commits

Author SHA1 Message Date
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
christos e415081a60 PR/14498: Wesley Chen: Identify loaded modules vs. kernel, because we don't
load the elf header with them.
2001-11-08 15:01:35 +00:00
christos 500d44e36c PR/14498: Wesley Chen: Print a return after enumerating the matching symbols. 2001-11-08 15:00:17 +00:00
bjh21 cabab13edd When setting watchpoints, call pmap_update() for each watchpoint, rather
than at the end, since they may be in different pmaps.  This avoids a null
pointer dereference that was causing panics when resuming from DDB on arm26.
2001-10-13 15:17:38 +00:00
chs 3fb05f05f8 use a for loop instead of goto. 2001-09-15 18:20:53 +00:00
thorpej 16c229ea7c Optimization suggested by Bill Sommerfeld: Keep a hint as to the
"earliest" firing callout in a bucket.  This allows us to skip
the scan up the bucket if no callouts are due in the bucket.

A cheap O(1) hint update is done at callout insertion (if new callout
is earlier than hint) and removal (is bucket empty).  A thorough
refresh of the hint is done when the bucket is traversed.

This doesn't matter much on machines with small values of hz
(e.g. i386), but on systems with large values of hz (e.g. Alpha),
it has a definite positive effect.

Also, keep the callwheel stats in evcnts, so that you can view them
with "vmstat -e".
2001-09-11 04:32:19 +00:00
chris 0e7661f023 Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

Currently this is a no-op on most platforms, so they should see no difference.

Reviewed by Jason.
2001-09-10 21:19:08 +00:00
thorpej fae2a1befd Add `show malloc' to dump the internal state of the MALLOC_DEBUG code. 2001-08-17 01:00:10 +00:00
bjh21 286faf2070 Extra sanity checking on ELF headers: Make sure the bootloader actually
loaded (or claims to have loaded) everything we need.
2001-07-31 22:31:47 +00:00
bjh21 34c3239d32 Don't depend on the bootloader's having loaded the .shstrtab section
in order to load the symbol table.  Instead of using the sections
called ".symtab" and ".strtab", use the first SYMTAB section (the
ELF spec says there should currently only be one) and the STRTAB
section that's linked to it.  I believe this is more robust, and it
certainly makes life easier for the bootloader.
2001-07-31 19:14:18 +00:00
atatat 124ae5b65c Add an easy way to dump the message buffer from ddb. 2001-07-31 04:28:16 +00:00
mrg 506cbe39be allow one to #define DB_MAX_LINE and DB_MAX_WIDTH independantly. 2001-07-01 12:16:25 +00:00
simonb 18b2f7e6a1 Add a port to IBM's PPC405GP Reference Board (the "walnut")
by Eduardo Horvath and Simon Burge of Wasabi Systems.

IBM 4xx series CPU features:
 - New pmap and revised trap handler.
 - Support on-chip timers, PCI controller, UARTs
 - Framework for on-chip ethernet and watchdog timer.
General PowerPC features:
 - Add in-kernel PPC floating point emulation
 - New in{,4}_cksum that is between 1.5 and 5 times faster than the
   old version depending on CPU type.
General changes:
 - Kernel support for generic dbsym-style symbols.
2001-06-13 06:01:44 +00:00
matt 9086deaf4d Default to kernel_map if no addr is available. 2001-06-03 00:32:25 +00:00
chs 821ec03ed9 replace vm_map{,_entry}_t with struct vm_map{,_entry} *. 2001-06-02 18:09:08 +00:00
mrg c13e3a6693 use _KERNEL_OPT 2001-05-30 11:40:35 +00:00
ross 818513678d The current API for MD support doesn't directly support the documented /u
option to show reg /u.  Fix this by adding a modif[ier] field to struct
db_variable.
2001-05-13 01:38:53 +00:00
thorpej 1c3a62e066 Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative.  It may be possible to
optimize these a little more.
2001-04-24 04:30:50 +00:00
msaitoh 9767692eee fix invalid reference to $fromconsole via DDB 2001-04-11 23:02:12 +00:00
cgd f7566f8058 Avoid crud after #endif. 2001-02-24 00:00:26 +00:00
cgd e4eb4c6cd5 #include <systm.h> for string fn prototypes. 2001-02-24 00:00:12 +00:00
cgd 42e019d568 put crud after #endif in comments 2001-02-15 21:59:38 +00:00
jhawk 35483d9169 alphabetize db_command tables 2001-02-11 21:12:24 +00:00
jdolecek 9818f641c3 make db_command_table[] const; since there is no way to dynamically extend
or modify the table at the moment, there is no functionality lost.
See also the discussion on tech-kern (Subject: 'machine' DDB command).
2001-01-24 20:54:41 +00:00
jdolecek 8b24036797 Require the machine-dependant DDB commands to be in db_machine_command_table[]
and link it directly to db_command_table[] so that it's not necessary
to do this at runtime. Make db_machine_command_table[] const on all ports.
g/c now unneded stuff, like db_machine_commands_install(), db_machine_init()

Patch written by enami.
2001-01-22 13:56:55 +00:00
jdolecek d5d431e8ae make db_[e]regs[] const 2001-01-18 10:54:27 +00:00
enami 1199c16835 db_command_table needs to be writable at least when DB_MACHINE_COMMANDS
is defined.
2001-01-18 08:52:26 +00:00
jdolecek 9aa0a0185f constify a little 2001-01-17 19:50:03 +00:00
jmc 5649071c21 Add x/m option functionality 2000-12-28 07:30:06 +00:00
jhawk 33e37f6d03 When we hit a breakpoint in a process, print the pid of the process as
well as the command name (p_comm) of the process.
2000-12-20 15:42:37 +00:00
thorpej 366b23111a Make sure values for a %llx are long long. 2000-11-28 21:44:34 +00:00
eeh 054819083c Restore the top level `callout' command. 2000-11-28 19:27:46 +00:00
eeh 6a7e0164dd Implement db_show_callout() again. 2000-11-28 19:20:37 +00:00
chs 55a751c9d5 add ddb commands "show uvmexp" and "show ncache".
the former used to be "call uvm_dump", the latter is new.
2000-11-24 07:25:50 +00:00
tv 0f6c5303e1 Missed change of parameter for %r->db_format_radix() change. 2000-08-11 22:50:47 +00:00
tv 242cedc18c Add two new functions, db_format_radix() and db_format_hex(), which supplant
the former %r and %z nonstandard kprintf strings.
2000-08-09 19:51:44 +00:00
tv 181f4183a5 Change kprintf attribute to printf. 2000-08-09 15:13:29 +00:00
jhawk 67c55e543e Fix CTRL-T to behave properly. It should swaps the current and previous
characters, not the previous and second-to-previous.
2000-07-28 16:33:39 +00:00
jeffs 9349a51d66 Provide some info on what db_trap_callback() is for in the code. 2000-07-18 20:51:07 +00:00
jeffs 0e0c4d24e8 Move platform db_trap callback from arch/mips into ddb as suggested by
jhawk.  This callback is used by platform code to manage things like
watchdogs that should be disabled while in ddb.  Done as a callback
for processors such as mips that support lots of different systems.
2000-07-17 19:57:49 +00:00
eeh 3acffdb4a5 Update TODO list item #7. 2000-07-10 00:50:22 +00:00
mycroft 39ff4faf53 Fix compiler warning. 2000-07-09 01:52:17 +00:00
eeh 74e5e4f040 Fix for:
7.      Numbers starting with [a-f] should work, but symbols
        of the same name should have priority.
2000-07-08 21:35:32 +00:00
sommerfeld 8951fce5df printf format safety 2000-07-08 17:10:22 +00:00
jhawk e0b6c173e7 s/preserving ... bytes of symbol table/using ... bytes of symbol table/
"preserving" implies that the data may be copied and might otherwise
be freed, and that other data in the symbol table or sections of
the kernel might be freed, however there is no mechanism for these
things to take place, so "using" is clearer.
2000-07-07 21:55:18 +00:00
jhawk 21322c88b6 Observe deficiency in printfs reporting symbol table problems
before we have a message buffer.
2000-07-07 21:51:38 +00:00
jhawk d58fe92d14 Detect ELF sections (string and symbol tables) by looking them
up by name (in .shstrtab) instead of guessing based on section
type (and throwing away the small one). In addition to being cleaner,
multiple symbol tables are no longer and error condition, so
booting netbsd.gdb no longer results in ddb being unable to use
*any* symbols.
2000-07-07 21:50:26 +00:00
jhawk 92276a6ce3 "set" now displays the name of the variable, old value, and new value,
just as "write" does.
2000-07-05 16:29:25 +00:00
mrg f324eef2d2 remove include of <vm/vm.h> 2000-06-27 17:55:38 +00:00
mrg 2f159a1bac remove/move more mach vm header files:
<vm/pglist.h> -> <uvm/uvm_pglist.h>
	<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
	<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
	<vm/vm_object.h> -> nothing
	<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
2000-06-26 14:20:25 +00:00
jhawk a639b800ee In db_command(), fix indentation and add a missing db_skip_to_eol() which
previously caused the next command following a ","-style repitition
to not be properly executed.
2000-06-17 05:57:41 +00:00
sommerfeld cb31de55ed In the "reboot" and (badly misnamed) "sync" commands, clear db_recover
before calling cpu_reboot() (which never returns) so we can debug
faults occurring in cpu_reboot().
2000-06-10 16:31:42 +00:00
jhawk 74ee4f350f Only define db_show_arptab if NARP>1;
pointed out by cgd in kern/10314
2000-06-08 21:06:46 +00:00
jhawk 84ceb5dfe7 Fix long-standing inconsistency between manapage and code.
The "ditto" character is " (double-quote); not , (comma) as
indicated in the manpage; and not ' (single-quote) as indicated
in the man.old -style manpage from which the mdoc manpage was derived.

Some other versions of ddb use single-quote for this feature, and this
part of the code may change again in the near future, but the documentation
now affects reality now.
they
2000-06-07 13:24:11 +00:00
soren 6d6d07abe5 #include <sys/systm.h> for the snprintf() prototype. 2000-06-06 18:50:56 +00:00
jhawk be69eea9ae First cut at an outline of stuff to do. 2000-06-06 05:41:54 +00:00
jhawk b756e7384d Stop using DDB-specific "%n" kprintf() format specifier. This was
important as db_sym() can be called through printf() rather than
db_printf(), causing a trap as the standard %n usage is invoked.

The DDB-specific %n code should disappear from subr_prf.c soon...
2000-06-06 05:06:25 +00:00
sommerfeld bdc8251646 Change printing of cpu number in the prompt in the MULTIPROCESSOR case 2000-05-28 19:03:55 +00:00
jhawk 8e44b27348 Rename the machine-specific stack trace printing functions
from db_stack_trace_cmd() to db_stack_trace_print(),
and add an additional argument, a function pointer for an
output routine (i.e. printf() or db_printf()).

Add db_stack_trace_cmd() in db_command.[ch], calling
db_stack_trace_print() with db_printf() as the printer.

Move count==-1 special handling from db_stack_trace_print() [nee
db_stack_trace_cmd()] to db_stack_trace_cmd() [nascent here].

Again, I'm unable to test compilation on all affected platforms,
so advance apologies for potential brokenness.
2000-05-26 03:34:24 +00:00
jhawk f3528d725d Interface change: db_printsym() takes a third argument, pr, a function
pointer indicating how to print the symbol. This allows db_printsym()
to called in places where db_printf() is not an appropriate output
function.

While straightforward, apologies in advance if I've introduced any minor
syntax errors; I was unable to test compilation this on all the affected
platforms.
2000-05-25 19:57:30 +00:00
thorpej 20c7af8a35 Fix a printf format. 2000-05-23 06:06:10 +00:00
jhawk 41ebaaaf09 Add a "sifting" command to ddb (named from the Sun OpenPROM command of
the same name); it searches the symbol table(s) for all symbols matching
a given substring, and prints.

Extremely useful for when you forget that critical symbol name.

Also, with /F support (cf. "ls -F") to print a char indicating the
symbol type.
2000-05-22 14:49:10 +00:00
jhawk ca31d672e2 Install "show arptab" (db_show_arptab) in the ddb command tree.
Move prototype from netinet/if_inarp.h to ddb/db_interface.h.
Change function to have standard ddb parameters (though they're
ignored).
2000-05-20 03:08:41 +00:00
jhawk cc732067b7 "p" should be an alias for "print", and was until "ps" was added.
Now it is, again.
2000-05-15 19:56:43 +00:00
jhawk a71de73182 From kern/9569.
Preserve ddb's idea of "count" from one command to the next if
repeating a command via hitting newline.
2000-04-13 22:48:29 +00:00
chs b937447204 actually add buf- and vnode-printing commands to the table. 2000-04-11 02:21:16 +00:00
chs 1c084aee4f add ddb commands for printing vnodes and bufs. 2000-04-10 02:22:13 +00:00
augustss 5e3d7e5317 Die, register, die! 2000-03-30 11:31:26 +00:00
simonb 836abd43c2 Remove redundant decl of db_radix, it's also in <ddb/db_output.h>. 2000-03-30 02:01:49 +00:00
kleink 8abfe24915 Cast timeval members to types we know the printf conversions of. 2000-03-26 20:24:12 +00:00
thorpej fc96443d15 New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
  resource allocation.
- Insertion and removal of callouts is constant time, important as
  this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
2000-03-23 07:01:25 +00:00
jdolecek b1e34812e4 Fix obvious off-by-one error in db_output().
Fixes kern/9570 by John Hawkinson.
2000-03-08 08:31:33 +00:00
sommerfeld ec2327108e On MP, print cpu number prior to prompt 2000-02-21 05:48:56 +00:00
jdolecek 8b2a23fb1a db_cmd_list(): variable ``width'' might have be used uninitialized, initialize
it to 0
1999-11-02 23:53:31 +00:00
lukem 4a2b49cb31 - change db_cmd_list() to list commands vertically rather than horizontally
- sort entries in the various command tables, so that the `help' lists
  are easier to use. this included hacking db_machine_commands_install()
  to search for the "machine" entry to change the `more cmds' pointer,
  rather than assuming it was the first entry
- add a `sync' command, which is effectively `reboot 0x100'.
- remove db_help_cmd(); it was unused (and was almost a duplicate of
  db_cmd_list()).
- move some extern decls to db_output.h, since they're used in more than one
  place now
- rename NEXT_TAB to DB_NEXT_TAB and move to db_output.h
1999-10-28 06:37:32 +00:00
kleink 522cbf0248 Update to match new SVR4-style definition names in <sys/exec_elf.h>. 1999-10-25 13:55:06 +00:00
erh 59b90d4a0e Remove ELFNAME macros which are already defines in exec_elf.h 1999-10-21 21:17:08 +00:00
jdolecek 9933da44b8 remove the MI Debugger() added recently. It doesn't make sense in
it's current form.
make Debugger just an alias for cpu_Debugger
1999-10-14 18:42:15 +00:00
jdolecek 7f589dba84 rename the MD Debugger() to cpu_Debugger()
add MI Debugger() which switches to console if wscons is used prior
to calling cpu_Debugger()
1999-10-12 17:08:56 +00:00
thorpej 40c08923a8 XXX LOCKING XXX of allproc; DDB runs with interrupts blocked, and MD
code should suspend other processors, so this probably isn't a problem,
but the comment is added anyhow.
1999-07-22 21:11:26 +00:00
simonb 3187dcd798 Fix tyop in error message. 1999-06-26 16:58:12 +00:00
thorpej fed8519457 Don't load the symbol table if it's corrupted. 1999-06-15 00:23:19 +00:00
pk 56aa5f9391 Cast ptrdiff_t to long for printf purposes. 1999-06-05 08:36:29 +00:00
ross 66ffb4e4d6 New format modifier: `L' gives true `long' vs `l' or `legacy' long. 1999-05-31 06:53:45 +00:00
thorpej 4b6d8943c2 Improve the pool allocator's diagnostic helpers, adding the ability to
log on a per-pool basis, reentrancy checking, and dumping various pool
information from DDB.
1999-05-10 21:13:05 +00:00
christos c3564f7b88 Don't go dereferencing pointers before verifying they are aligned. 1999-04-29 11:28:42 +00:00
thorpej dc63f8c31a Fix a problem where SOFTWARE_SSTEP would skip one instruction each time
on the Alpha.
1999-04-21 00:00:06 +00:00
pk b13e5d1469 Quote "AS IS" as in the majority of Carnegy Mellon notices. 1999-04-12 20:38:17 +00:00
pk c40eb1cd97 Fix a pasto in copyright text which has been procreating like rabbits.. 1999-04-06 20:09:18 +00:00
mrg d2397ac5f7 completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
1999-03-24 05:50:49 +00:00
thorpej 1ab6db8e5f Fix printf format problems on Alpha. 1999-02-12 00:50:09 +00:00
augustss 332d7c138f Avoid arithmetic on `void *' since that's not ANSI C. 1999-01-08 18:10:35 +00:00
thorpej c89493522f - Make the ddb_init() interface consistent for a.out and ELF.
- Allow DDB to run-time switch for a.out or ELF symbol table support.
1998-12-04 20:18:05 +00:00
mycroft 26a93b8985 Do branch forking for inst_return() instructions, too. 1998-11-25 06:38:03 +00:00
jonathan 3ac3cbcfb8 Add options DDB_FROMCONSOLE and sysctl ddb.fromconsole, analagous to
DDB_ONPANIC. Lets user ignore breaks but enter DDB on panic.  Intended
for machines where debug on panic is useful, but DDB entry is not,
(public-access console, or terminal-servers which send spurious breaks)

Add new ddb hook, console_debugger(), which decides whether or not to
ignore console ddb requests. Console drivers should be updated to call
console_debugger(), not Debugger(), in response to serial-console
break or ddb keyboard sequence.
1998-10-29 21:22:32 +00:00
thorpej 970e60efb8 - Use proclists[], rather than checking allproc and zombproc explicitly.
- Add some comments about locking.
1998-09-08 23:50:13 +00:00
christos bd52ba3c5a Assign copyright to TNF. 1998-09-05 14:42:05 +00:00
rvb e2ea9195fe Indent to 4 space for tabs 2 and 3 like the rest of the code 1998-08-16 03:29:16 +00:00