Commit Graph

373 Commits

Author SHA1 Message Date
hannken 4e993c9545 When looking for the next element of cpu_queue compare the pointer to the
address of the head, not to the head itself.  Not sure if the cast of the
arg to db_value_name() is right, but works on i386 and compiles on sparc64.

Stack traces from ddb work again on i386.
2011-02-20 10:24:45 +00:00
matt dfed083ad4 Since curlwp and curproc must always be non-NULL, remove the == NULL branches. 2011-02-09 18:24:44 +00:00
rmind 7146b2f61d Retire struct user, remove sys/user.h inclusions. Note sys/user.h header
as obsolete.  Remove USER_TO_UAREA/UAREA_TO_USER macros.

Various #include fixes and review by matt@.
2011-01-14 02:06:22 +00:00
drochner a1f59518fb fix extern/static inconsistency 2010-09-13 08:42:04 +00:00
enami 5de383f454 Define db_hist_put() only when DDB_HISTORY_SIZE != 0 so that
build successes on ports like hpcarm.
2010-08-31 07:48:23 +00:00
enami a8a2c06f4b Fix indent in prevous commit. 2010-08-31 07:12:55 +00:00
tls 4e9aaafe62 Don't overflow DDB command history. Coyote Point changelist description:
DDB is flakey.  The command history wanders past the bounds.  Way
past.  When it hits some boolean that indicates a.out format symbol
tables are to be used, and here is the pointer to the function, the
call thru the NULL function pointer renders the debug session entirely
unsatisfactory, outcome wise.
2010-08-30 19:23:25 +00:00
tron 370c0f3c62 Include "ctype.h" in the central place which deals with building the
kernel debugger as a userland program.
2010-02-02 09:04:14 +00:00
tron 4fe91a715f Include "ctype.h" if we are not building a kernel to fix the build
of crash(8).
2010-02-01 09:56:58 +00:00
phx cc35ab39e9 New modifiers for the "write" command: /BHL. They act like /bhl but do not
read the old value from memory before writing.
2010-01-31 21:52:23 +00:00
rmind 1069745866 Replace few USER_TO_UAREA/UAREA_TO_USER uses, reduce sys/user.h inclusions. 2009-12-17 01:25:10 +00:00
bsh 1c34311d57 quick fix for crash(8) build failure caused by my previous commit (rev
1.20).

The problem was reported Ty Sarna and Geoff Wing.  Thanks.

XXX: I made #if too messy. split db_access.c into two files for
db_{get,put}_values and db_read_{int,ptr}?
2009-09-28 05:53:37 +00:00
bsh 35bc16c502 kgdb still needs db_{get,put}_value in ddb/db_access.c when SOFTWARE_SSTEP is defined in db_machdep.h. 2009-09-27 18:24:23 +00:00
rmind 6227d22ed0 Add #ifdef MQUEUE for db_show_mqueue_cmd().
XXX: Wrong.  DDB should be dynamic, modular, etc.
2009-07-19 02:37:33 +00:00
mrg 06dd613f03 extend 'show event' to take /i /t and /m modifiers, to select interrupt,
trap or misc event types.  you can mix them with /f as well, to show all
including zero events for traps and misc, "show event/ftm"
2009-06-05 04:31:47 +00:00
ad d991fcb3b6 More changes to improve kern_descrip.c.
- Avoid atomics in more places.
- Remove the per-descriptor mutex, and just use filedesc_t::fd_lock.
  It was only being used to synchronize close, and in any case we needed
  to take fd_lock to free the descriptor slot.
- Optimize certain paths for the <NDFDFILE case.
- Sprinkle more comments and assertions.
- Cache more stuff in filedesc_t.
- Fix numerous minor bugs spotted along the way.
- Restructure how the open files array is maintained, for clarity and so
  that we can eliminate the membar_consumer() call in fd_getfile().  This is
  mostly syntactic sugar; the main functional change is that fd_nfiles now
  lives alongside the open file array.

Some measurements with libmicro:

- simple file syscalls are like close() are between 1 to 10% faster.
- some nice improvements, e.g. poll(1000) which is ~50% faster.
2009-05-24 21:41:25 +00:00
ad 9f19801f75 add boilerplate missed in initial commit 2009-04-10 22:29:30 +00:00
reinoud 49f0ea0bd0 KGDB does no longer refers to ddb/db_access. Fixes compilation problems of KGDB
kernels.
2009-03-31 15:50:45 +00:00
ad 912b4160fd Make 'show event', 'dmesg' work with crash(8).
XXX dmesg fails exactly the same way as /sbin/dmesg.
2009-03-21 13:06:39 +00:00
dsl 454af1c0e8 Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
2009-03-14 15:35:58 +00:00
dsl 02cdf4d2c8 Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
2009-03-14 14:45:51 +00:00
martin 7d53797861 Switch the default value (if no options DDB_ONPANIC is defined) for
ddb.onpanic to 1, change it back to 0 in sysctl.conf and make sure
postinstall installs this setting.
This avoids us trying to dump while booting from install CD, but keeps
the default the same once we are far enough through /etc/rc.d. Failing
earlier is unlikely to be recovered by an automatic reboot.
OK: core.
2009-03-11 23:22:57 +00:00
nakayama 3a99fdb328 Avoid "warning: cast from pointer to integer of different size"
on 32-bit sparc64 kernels.
2009-03-11 13:29:44 +00:00
mrg d2ea53a056 include <stdbool.h> if not _KERNEL, and don't include kauth.h if _KERNEL.
now crash builds on i386.
2009-03-09 06:07:05 +00:00
mrg e4d97b1066 include <sys/user.h> 2009-03-08 11:41:47 +00:00
mrg 4540375faf include ddb headers *after* sys/types.h or sys/param.h. 2009-03-08 11:40:00 +00:00
ad cd6b1c8f08 Make ddb compile and work in userspace. Mostly this is comprised of three
types of changes:

- Add a few new methods to replace stuff like p_find(), CPU_INFO_FOREACH.

- Use db_read_bytes() instead of accessing kernel structures directly,
  and similar changes.

- Add ifdef _KERNEL where the above hasn't been done, and an XXX comment.
2009-03-07 22:02:16 +00:00
haad 87b8a8844f Do not set last_count to zero after every db_command function call it is
static variable. This should fix PR 40712.
2009-03-01 12:13:12 +00:00
yamt f68e4571e5 - fix vmem unittest. rename VMEM_DEBUG so that it won't be abused again.
- reimplement vmem sanity checks with less code duplication.
- reimplement ddb vmem-related commands in a more consistent ways.
  remove automatic whatis.
2009-02-18 13:31:59 +00:00
ad 563a207d33 Default 'show all procs' to /l. People tend to type 'ps' without modifiers
when providing information about deadlocks. Without the thread info it's
not very useful.
2009-02-04 20:17:58 +00:00
ad 6e89a762d6 Default DDB_ONPANIC to zero. The end product is ultimately for the
consumption of users external to the project, users who are unlikely to
be kernel hackers with the motivation to debug crashes. In this situation
rebooting and creating a crash dump is more appropriate than interrupting
normal service for an unbounded amount of time, while also leaving the
machine at cryptic db> prompt.
2009-01-30 21:30:56 +00:00
haad 128703a537 Fix my bug introduced in rev 1.98 of db_command.c where command prefix
not ambiguous in one table was choosed even if it was ambiguous in another
table in same list. Also apply more KNF rules.

Patch was supplied by uwe@.
2009-01-05 22:19:40 +00:00
cegger 10de0e2b14 ddb: new 'show vmem' and 'show all vmems' commands.
Useful to inspect vmem(9) structures.
2008-12-07 00:51:15 +00:00
martin 719a906ef5 As discussed on tech-kern: mutex_init is too heavyweight for early bootstrap
phases, so move the initialization of the ksyms mutex back into main via
a function called ksyms_init. Rename the existing (but quite different)
ksyms_init* variations into ksyms_addsyms_elf() and ksyms_addsyms_explicit()
and adapt machdep code accordingly.
2008-11-30 18:21:31 +00:00
nakayama 4cb83f9c6e Make DDB shows right register values on 32-bit sparc64 kernels.
- define db_expr_t as int64_t.
- %gsr is 32-bit, so use db_sparc_intop.
- sync arguments with function prototype.
- ansify.
2008-11-25 15:41:11 +00:00
ad 31afc5b6d8 Add some basic DDB stuff for modules. 2008-11-25 15:14:07 +00:00
pooka 010ce4930e more <sys/buf.h> police 2008-11-16 19:34:29 +00:00
ad 13de59a192 ifdef AIO 2008-11-14 23:37:50 +00:00
ad 9b83143a6a +ifdef AIO
XXX ddb needs a way to register commands at runtime!
2008-11-14 23:37:30 +00:00
christos bc44c7d780 don't hold locks in ddb (call ksyms_getval_unlocked()), pointed out by ad. 2008-10-24 13:55:42 +00:00
rmind 97561001a3 Replace more intptr_t to uintptr_t when casting VA. 2008-10-03 14:52:11 +00:00
rmind 03fe669395 - Fix message queue permissions problems.
- Rake into account umask when creating mqueue.
- Restore DDB command, which was accidentally lost (hi martin).
- Misc.
2008-09-29 10:27:53 +00:00
skrll 3ceaf8f8e4 Make "show uvmhist" available to all arches (not just sparc*) in ddb. 2008-08-08 17:09:28 +00:00
blymn a7db4edf3b Take care not to dereference NULL datapointer from fd table
Make output more readable and label what lock we are examining.
2008-07-14 10:15:11 +00:00
blymn 380be0c111 Fix indents. 2008-07-10 13:28:23 +00:00
blymn 8a19e9911c Add a show files command that prints the vnodes associated with a
given struct proc and, if LOCKDEBUG is built in, the lock status of
the uvmobject.
2008-07-10 12:42:24 +00:00
blymn 8070795214 Whitespace clean up. 2008-07-10 12:38:28 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
uwe aece9113ff Fix CS_MACH definition. 0x10 is spelled 0x10, not 0x16. 2008-03-27 01:15:15 +00:00
uwe cff5aa6f0d Fix help string for "w" - it is "write" not "watch". 2008-02-21 02:07:45 +00:00