Commit Graph

211 Commits

Author SHA1 Message Date
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
ross c291189ae9 Have to fix the `(int)curproc' lossage now; kernel builds die here on alpha.
BTW, KNF requires the additional, not-technically-need `!= NULL'.
1998-08-15 00:04:00 +00:00
rvb a5f4270a21 Print program name when entering the debugger 1998-08-14 19:57:01 +00:00
eeh a2dd74ed79 Merge paddr_t changes into the main branch. 1998-08-13 02:10:37 +00:00
perry e1601dc2ca bzero->memset, bcopy->memcpy, bcmp->memcmp 1998-08-09 20:36:58 +00:00
tron 870e46e9c4 Include required "opt_ddb.h" header file. 1998-07-05 14:33:56 +00:00
jonathan 466e784ee1 defopt DDB. 1998-07-04 22:18:13 +00:00
tv 00ede2160e Change ddb_init() for a.out to provision for kernels which are not booted by
the current 'bootblock' method, like the Shark, which preloads and preformats
the symbol table right in the boot code.
1998-06-09 01:57:41 +00:00
thorpej 38f367e1a0 Whitespace. 1998-05-03 18:49:54 +00:00
pk df2b26547d If `SOFTWARE_SSTEP' is defined then kgdb_stub.c needs the single-step
emulation in db_run.c:

	- re-arrange `db_*_single_step()' and `db_*_temp_breakpoint()' -
	  which are only used in the `SOFTWARE_SSTEP' case - so these
	  are available to the KGDB code.
	- make other code in db_run.c conditional on `DDB'.
1998-04-03 19:45:12 +00:00
mrg d90485202c - add defopt's for UVM, UVMHIST and PMAP_NEW.
- remove unnecessary UVMHIST_DECL's.
1998-02-10 14:08:44 +00:00
mrg 1a8c7604f4 initial import of the new virtual memory system, UVM, into -current.
UVM was written by chuck cranor <chuck@maria.wustl.edu>, with some
minor portions derived from the old Mach code.  i provided some help
getting swap and paging working, and other bug fixes/ideas.  chuck
silvers <chuq@chuq.com> also provided some other fixes.

this is the rest of the MI portion changes.

this will be KNF'd shortly.  :-)
1998-02-05 07:59:28 +00:00
ross 9b463a1108 Print more info on ps/w, note the current proc, and properly declare db_maxoff. 1998-01-31 04:14:46 +00:00
pk 1581707b5d Fixes for software-assisted single-stepping from Chuck Silvers. 1997-12-10 23:09:31 +00:00
drochner 9d7d537acb Clean up usage of printf() vs db_printf(): The diagnostic messages
when symbol tables are loaded don't belong to the user interaction,
their output lines should not be counted by ddb's builtin pager.
1997-11-30 15:49:34 +00:00
lukem 4e3ba1ea9e s/DB_HISTORY_SIZE/DDB_HISTORY_SIZE/, for consistency with other DDB #defines 1997-11-16 23:51:23 +00:00
christos ab417737fa Add declaration for db_delete_line 1997-11-16 22:46:39 +00:00
christos 98ec14c8e6 PR/4504: Tero Kivinen: Add DB_HISTORY_SIZE option to enable history in ddb 1997-11-16 22:24:47 +00:00
chuck e0ced7363a fix printf formatting of "ps" (aka "show all proc") so that lines never
overflow (always hated that).

replaced "/m" flag with:
	/a == show process address info
	/n == show normal process info [currently the default]
	/w == show process wait/emul info
1997-10-24 18:26:36 +00:00
chuck c33b782b4e kill db_ksprintn, db_printf_guts, kdbprintf, db_printf.
db_printf moves to kern/subr_prf.c and uses the new kprintf located there.
1997-10-24 18:20:23 +00:00
chuck 58034fb20c kill kdbprintf [use db_printf] 1997-10-24 18:16:46 +00:00
pk 6282a103eb Last loop variable type change causes undesirable non-terminating loops.
Change for-loop expressions to get the intended effect again.
1997-09-13 18:44:55 +00:00
scottr 4658336eda Add a 'reboot' command with a single parameter specifying the boot flags. 1997-09-11 06:55:56 +00:00
pk ae6bc354b9 Use the macro PC_ADVANCE(), if defined, to skip over a breakpoint. 1997-09-10 19:37:31 +00:00
mycroft b74cbfe5ed Eliminate signed-unsigned comparisons. 1997-09-09 18:59:23 +00:00
thorpej f576b48b39 Make sure debugging symbol sections are aligned. 1997-09-05 21:46:59 +00:00
thorpej 5accaea913 Add support for Elf symbol tables to DDB, written from scratch by me.
Known to work in DDB under NetBSD/alpha.
1997-07-01 18:36:36 +00:00
thorpej 9ec5f78d39 Pass the current DDB symbol table to X_db_symbol_values(). 1997-06-26 01:19:07 +00:00
thorpej d9f8d88a35 Fixup the software single-step code (used on architectures where there
is no hardware support for single-stepping):
- Fix branch prediction and delay slot computation (for the MIPS).
- Correctly deal with branch taken vs. branch not taken cases, and
  self-branches.
- General cleanup, including types botches.
Partially from Mach 3, with a bunch of cleanup work by me.
1997-06-26 01:18:11 +00:00
thorpej 1d7e4d35d9 Update prototypes for new function signatures. Note, the ddb_init()
signature is currently different for the DB_AOUT_SYMBOLS vs. the
DB_ELF_SYMBOLS cases. (XXX)
1997-06-26 01:14:16 +00:00
thorpej 84c0797eda Use db_expr_t rather than int when reading a value from the kernel
address space, to avoid type-size problems.
1997-06-26 01:13:11 +00:00
thorpej 0ae10b0d60 In the db_breakpoint_t, use a db_expr_t to store the original instruction,
not an int.
1997-06-26 01:12:05 +00:00
thorpej 76fbbf772d A few small changes to make it easier to support non-a.out symbol table
formats in DDB:
- Reverse the sense of the symbol format #ifdef... i.e. instead of
  "#ifndef DB_NO_AOUT", use "#ifdef DB_AOUT_SYMBOLS".  This is pulled
  in from <machine/db_machdep.h>.
- Change the signature of X_db_sym_init().  Instead of int * and char *,
  it now takes void *'s for the start and end of the symbol table.
- In X_db_sym_init(), check that the pointer to the beginning of
  the symbol table is aligned.
- X_db_symbol_values() now takes a "db_symtab_t *symtab" argument.
1997-06-26 01:11:00 +00:00
thorpej c95e0b0782 Use db_expr_t rather than int in a few strategic places to avoid
type-size problems.
1997-06-26 01:06:46 +00:00
gwr 25bdbcc1dc Move some DDB stuff here from kern_clock.c and kern_proc.c 1997-05-21 19:54:00 +00:00
gwr 84e0c3eb4b Add a "kill" command that calls db_kill_proc(). 1997-05-07 18:51:58 +00:00
gwr 8ae8b46853 Add db_kill_proc(). 1997-05-07 18:50:50 +00:00
gwr ea3925f508 FIXUP_PC_AFTER_BREAK now takes an arg of type db_regs_t * 1997-02-06 21:16:28 +00:00
cgd a9295bf811 make variable pointers (in variable declaration structs) be 'long *', so
that the common case can be handled with no hassles on all machines.
fix up the various internal variables which are also exported via sysctl
(and which therefore must be 'int's) to do the right thing via a special
read/write function.
1997-02-04 00:33:32 +00:00
cgd bd0be84b0a fix printf format widths 1997-02-04 00:32:09 +00:00
mycroft 12da023cd4 db_expr_t became a long. 1997-02-03 23:36:09 +00:00
cgd a34fffe676 part of the SOFTWARE_SSTEP code was mips-specific. #ifdef it appropriately.
fix various 64-bitness bugs.
fix various -Wall bugs.
1997-02-03 19:57:41 +00:00
cgd 3e34fdf8ac fix various 64-bitness bugs.
fix various db_printf format bugs (long vs. int, etc.).
1997-02-03 19:57:03 +00:00