Commit Graph

407 Commits

Author SHA1 Message Date
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
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