diff options
author | rwatson <rwatson@FreeBSD.org> | 2007-12-01 22:04:16 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2007-12-01 22:04:16 +0000 |
commit | 090235e567d2103bb33c8098bde951eb3c184d05 (patch) | |
tree | 078abf5d6f6ec15b509ed5ddcf1ae98c1893fb79 /sys/vm/redzone.c | |
parent | a032664fc9c37f7b29a9713d084d2e3510510531 (diff) | |
download | FreeBSD-src-090235e567d2103bb33c8098bde951eb3c184d05.zip FreeBSD-src-090235e567d2103bb33c8098bde951eb3c184d05.tar.gz |
Modify stack(9) stack_print() and stack_sbuf_print() routines to use new
linker interfaces for looking up function names and offsets from
instruction pointers. Create two variants of each call: one that is
"DDB-safe" and avoids locking in the linker, and one that is safe for
use in live kernels, by virtue of observing locking, and in particular
safe when kernel modules are being loaded and unloaded simultaneous to
their use. This will allow them to be used outside of debugging
contexts.
Modify two of three current stack(9) consumers to use the DDB-safe
interfaces, as they run in low-level debugging contexts, such as inside
lockmgr(9) and the kernel memory allocator.
Update man page.
Diffstat (limited to 'sys/vm/redzone.c')
-rw-r--r-- | sys/vm/redzone.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/vm/redzone.c b/sys/vm/redzone.c index 5598b5d..b3e5c88 100644 --- a/sys/vm/redzone.c +++ b/sys/vm/redzone.c @@ -152,10 +152,10 @@ redzone_check(caddr_t naddr) "corrupted before %p (%lu bytes allocated).\n", ncorruptions, ncorruptions == 1 ? "" : "s", naddr, nsize); printf("Allocation backtrace:\n"); - stack_print(&ast); + stack_print_ddb(&ast); printf("Free backtrace:\n"); stack_save(&fst); - stack_print(&fst); + stack_print_ddb(&fst); if (redzone_panic) panic("Stopping here."); } @@ -171,10 +171,10 @@ redzone_check(caddr_t naddr) "after %p (%lu bytes allocated).\n", ncorruptions, ncorruptions == 1 ? "" : "s", naddr + nsize, nsize); printf("Allocation backtrace:\n"); - stack_print(&ast); + stack_print_ddb(&ast); printf("Free backtrace:\n"); stack_save(&fst); - stack_print(&fst); + stack_print_ddb(&fst); if (redzone_panic) panic("Stopping here."); } |