summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_malloc.c
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2004-07-10 21:36:01 +0000
committermarcel <marcel@FreeBSD.org>2004-07-10 21:36:01 +0000
commita9ad69d5afbc24f6748d28f393adec2556a9b944 (patch)
tree9e5d95534c4335250faaf97e9ff106a860667f5a /sys/kern/kern_malloc.c
parentb995877a066c7e04b455d29b5641151d05828de5 (diff)
downloadFreeBSD-src-a9ad69d5afbc24f6748d28f393adec2556a9b944.zip
FreeBSD-src-a9ad69d5afbc24f6748d28f393adec2556a9b944.tar.gz
Update for the KDB framework:
o Make debugging code conditional upon KDB instead of DDB. o Call kdb_enter() instead of Debugger(). o Call kdb_backtrace() instead of db_print_backtrace() or backtrace(). kern_mutex.c: o Replace checks for db_active with checks for kdb_active and make them unconditional. kern_shutdown.c: o s/DDB_UNATTENDED/KDB_UNATTENDED/g o s/DDB_TRACE/KDB_TRACE/g o Save the TID of the thread doing the kernel dump so the debugger knows which thread to select as the current when debugging the kernel core file. o Clear kdb_active instead of db_active and do so unconditionally. o Remove backtrace() implementation. kern_synch.c: o Call kdb_reenter() instead of db_error().
Diffstat (limited to 'sys/kern/kern_malloc.c')
-rw-r--r--sys/kern/kern_malloc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index 4bc3348..e966a49 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/kdb.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/malloc.h>
@@ -208,7 +209,7 @@ malloc(size, type, flags)
static int curerr, once;
if (once == 0 && ppsratecheck(&lasterr, &curerr, 1)) {
printf("Bad malloc flags: %x\n", indx);
- backtrace();
+ kdb_backtrace();
flags |= M_WAITOK;
once++;
}
@@ -216,7 +217,7 @@ malloc(size, type, flags)
#endif
#if 0
if (size == 0)
- Debugger("zero size malloc");
+ kdb_enter("zero size malloc");
#endif
#ifdef MALLOC_MAKE_FAILURES
if ((flags & M_NOWAIT) && (malloc_failure_rate != 0)) {
OpenPOWER on IntegriCloud