Commit Graph

419 Commits

Author SHA1 Message Date
ozaki-r 9f84c587df Don't use an unset value as an address
Instead, show usage if no address is passed.
2015-02-27 00:47:30 +00:00
christos 1a5609a923 we can use show callout now from crash 2015-02-08 19:41:39 +00:00
uebayasi 509aacc598 Define ddb module. 2014-11-16 05:46:27 +00:00
matt f1926b3d6f Add description of inst_return 2014-09-19 17:29:01 +00:00
matt bac0f3665b Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.
2014-09-05 09:27:24 +00:00
jakllsch 24761fbad1 Make this build.
Hi jakllsch@.
2014-04-12 19:25:48 +00:00
jakllsch ff1b98f16b Unbreak db_cpu_*. Allows backtraces on i386 to progress beyond the
first function by not doing a NULL-deref in the debugger.

Bug located by me.  Patch implementation by riastradh@.  Hi rmind@.
2014-04-12 19:01:49 +00:00
pooka 4f6fb3bf35 Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.
2014-02-25 18:30:08 +00:00
christos 52f1b2aafb add a return in the panic message 2014-01-22 15:20:40 +00:00
rmind df64447ca6 Remove cpu_queue (and thus eleminate another use of CIRCLEQ) by replacing
its uses with cpu_infos array.  Extra testing by christos@.
2013-11-24 21:58:38 +00:00
christos c60f6fad95 fix userland build, by moving all the unused stuff inside ifdef _KERNEL 2013-10-19 15:20:52 +00:00
martin 9197dcbb29 Mark a potentialy unused variable 2013-10-19 14:33:07 +00:00
christos 8e615742be need <sys/types.h> for various crap that other headers use (pid_t etc). 2013-02-10 14:44:14 +00:00
apb 161fe293bc Hook the new ddb/db_panic.c to the build. 2013-02-10 11:05:31 +00:00
apb bb0eb3bd82 Move the DDB-specific part of vpanic() to a new db_panic() function,
defined in ddb/db_panic.c and declared in ddb/ddbvar.h.  No functional
change.

The copyright years in db_panic.c are the years in which changes were
made to the code that has now been moved to db_panic.c.  No pre-NetBSD
copyright notice is needed because revision 1.12 of subr_prf.c had only
the trivial "#ifdef DDB \\ Debugger(); \\ #endif"
2013-02-10 11:04:19 +00:00
apb bf2dfb8fc5 read_symtab_from_file used to be defined in ddb/db_aout.c, but that
file was deleted in 2011.  Now delete the declaration in ddb/ddbvar.h.
2013-02-10 10:26:12 +00:00
christos fa04e235ed remove the new command not the old one. 2013-01-06 04:17:27 +00:00
christos cc78507c3a remove previous, dmesg just works. 2013-01-06 03:34:52 +00:00
christos 81736cc9cd Add "show dmesg" that prints the contents of the message buffer. 2013-01-06 03:23:55 +00:00
christos cedbce7adf Add "show panic" that shows the current panic string. two ports had it, and
it could be easily made MI.
2013-01-05 15:23:27 +00:00
matt 6787e5f9af Use _KERNEL_OPT 2012-09-01 01:13:51 +00:00
matt a1e2d01f42 Make DB_MAX_LINES a kernel option 2012-09-01 00:28:12 +00:00
dsl e21a34c25e Add some pre-processor magic to verify that the type of the data item
passed to sysctl_createv() actually matches the declared type for
  the item itself.
In the places where the caller specifies a function and a structure
  address (typically the 'softc') an explicit (void *) cast is now needed.
Fixes bugs in sys/dev/acpi/asus_acpi.c sys/dev/bluetooth/bcsp.c
  sys/kern/vfs_bio.c sys/miscfs/syncfs/sync_subr.c and setting
  AcpiGbl_EnableAmlDebugObject.
(mostly passing the address of a uint64_t when typed as CTLTYPE_INT).
I've test built quite a few kernels, but there may be some unfixed MD
  fallout. Most likely passing &char[] to char *.
Also add CTLFLAG_UNSIGNED for unsiged decimals - not set yet.
2012-06-02 21:36:41 +00:00
rmind 4b760398c3 Remove MALLOC_DEBUG and MALLOCLOG, which is dead code after malloc(9) move
to kmem(9).  Note: kmem(9) has debugging facilities under DEBUG/DIAGNOSTIC.
However, expensive kmguard and debug_freecheck have to be enabled manually.
2012-04-28 23:03:39 +00:00
joerg 66dd2755f5 Add __printflike attribution to use vprintf and friends with an argument
as format string.
2012-03-15 02:02:20 +00:00
christos b1c34b0c9a add __printflike where needed 2012-02-10 02:14:23 +00:00
christos 440da768fe fix printf formats. 2012-02-10 02:14:04 +00:00
christos d456592874 Re-indent, and factor out strlen() now that we have more space.
No functional change.
2012-02-09 17:07:07 +00:00
christos 8e619ae19a Remove bogus code in the non kernel case involving end[]. In this case
end[] is the end of the crash program symbols, so using that as the
end of the kernel symbol table is just wrong.
2012-02-09 00:21:23 +00:00
christos 6aaa2a926a include stddef.h for offsetof 2011-12-31 22:42:25 +00:00
christos 42c420856f - fix offsetof usage, and redundant defines
- kill pointer casts to 0
2011-12-31 20:41:58 +00:00
christos b799360e83 If we are DIAGNOSTIC don't try to go further if we failed to take the
lock, because we are going to trigger a KASSERT. Also hold the lock
longer and take the proc lock for kpsignal(). Maybe we should add
mutex_steal() and mutex_return() for the debugger? Lock correction
suggestion from jmcneill.
2011-12-03 16:25:49 +00:00
christos d5b7cb3520 deal with the proc_lock mutex. 2011-12-02 23:57:58 +00:00
mrg c09a267949 set panicstr to "reboot forced via kernel debugger" when rebooting
from ddb, similar to how sync from ddb works.

this avoids various asserts and other issues during ddb reboot.
2011-11-13 03:21:51 +00:00
jym 0f329bf765 Like ddb(4) "ps/l", use '>' sign to indicate running LWPs for the /w
modifier.
2011-10-23 13:30:20 +00:00
uebayasi 3abce800c0 Define SYMTAB_SPACE in opt_ksyms.h, not opt_ddbparam.h. Ensure
that ddb(4) code is independent of SYMTAB_SPACE value.
2011-07-28 13:42:16 +00:00
joerg 3eb244d801 Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
2011-07-17 20:54:30 +00:00
rmind e225b7bd09 Welcome to 5.99.53! Merge rmind-uvmplock branch:
- Reorganize locking in UVM and provide extra serialisation for pmap(9).
  New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
  the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
  Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
  kernel-lock on some ports).  Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
2011-06-12 03:35:36 +00:00
christos 4d927829db re-instate db_kill_proc 2011-05-31 03:40:22 +00:00
joerg a2bf8e5d19 Introduce DDB_EXPR_FMT and replace the logic around DB_EXPR_T_IS_QUAD. 2011-05-26 15:34:12 +00:00
mrg 8169e46991 move and rename the uvm history code out of uvm_stat to "kernhist".
rename "UVMHIST" option to enable the uvm histories.

TODO:
- make UVMHIST properly depend upon KERNHIST
- enable dynamic registration of histories.  this is mostly just
  allocating something in a bitmap, and is only for viewing multiple
  histories in a merged form.


tested on amd64 and sparc64.
2011-05-17 04:18:05 +00:00
nakayama 20cb9e7fb5 Fix GENERIC_SUN4U build. 2011-04-12 17:46:38 +00:00
mrg a057421714 include <sys/cpu.h> when using cpu specific info. fixes building
these as part of sparc64 crash(8).
2011-04-12 08:42:12 +00:00
mrg 56326562d4 avoid compiling dead code into crash. 2011-04-11 04:26:18 +00:00
mrg 07a98cd33f obsolete DB_AOUT_SYMBOLS. however, we need to leave most of the code
in db_sym.[ch] as it is used by the elf version of crash(8).

i will be cleaning up the db_sym.c code in a follow up commit to avoid
having dead code compiled.
2011-04-11 04:22:30 +00:00
christos 2a672d40b3 Add:
usage: show proc [/a] [/p] address|pid
        /a == argument is an address of any lwp
	/p == argument is a pid [default]
From: Vladimir Kirillov proger at wilab dot org dot ua
2011-04-10 20:59:22 +00:00
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