subr_stack.c (174137) | subr_stack.c (174195) |
---|---|
1/*- 2 * Copyright (c) 2005 Antoine Brodin 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include "opt_ddb.h" 28 29#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2005 Antoine Brodin 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include "opt_ddb.h" 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/kern/subr_stack.c 174137 2007-12-01 22:04:16Z rwatson $"); | 30__FBSDID("$FreeBSD: head/sys/kern/subr_stack.c 174195 2007-12-02 20:40:35Z rwatson $"); |
31 32#include <sys/param.h> 33#include <sys/kernel.h> 34#ifdef KTR 35#include <sys/ktr.h> 36#endif 37#include <sys/linker.h> 38#include <sys/malloc.h> --- 61 unchanged lines hidden (view full) --- 100 KASSERT(st->depth <= STACK_MAX, ("bogus stack")); 101 for (i = 0; i < st->depth; i++) { 102 stack_symbol(st->pcs[i], namebuf, sizeof(namebuf), &offset); 103 printf("#%d %p at %s+%#lx\n", i, (void *)st->pcs[i], 104 namebuf, offset); 105 } 106} 107 | 31 32#include <sys/param.h> 33#include <sys/kernel.h> 34#ifdef KTR 35#include <sys/ktr.h> 36#endif 37#include <sys/linker.h> 38#include <sys/malloc.h> --- 61 unchanged lines hidden (view full) --- 100 KASSERT(st->depth <= STACK_MAX, ("bogus stack")); 101 for (i = 0; i < st->depth; i++) { 102 stack_symbol(st->pcs[i], namebuf, sizeof(namebuf), &offset); 103 printf("#%d %p at %s+%#lx\n", i, (void *)st->pcs[i], 104 namebuf, offset); 105 } 106} 107 |
108#ifdef DDB |
|
108void 109stack_print_ddb(struct stack *st) 110{ 111 char namebuf[64]; 112 long offset; 113 int i; 114 115 KASSERT(st->depth <= STACK_MAX, ("bogus stack")); 116 for (i = 0; i < st->depth; i++) { 117 stack_symbol_ddb(st->pcs[i], namebuf, sizeof(namebuf), 118 &offset); 119 printf("#%d %p at %s+%#lx\n", i, (void *)st->pcs[i], 120 namebuf, offset); 121 } 122} | 109void 110stack_print_ddb(struct stack *st) 111{ 112 char namebuf[64]; 113 long offset; 114 int i; 115 116 KASSERT(st->depth <= STACK_MAX, ("bogus stack")); 117 for (i = 0; i < st->depth; i++) { 118 stack_symbol_ddb(st->pcs[i], namebuf, sizeof(namebuf), 119 &offset); 120 printf("#%d %p at %s+%#lx\n", i, (void *)st->pcs[i], 121 namebuf, offset); 122 } 123} |
124#endif |
|
123 124/* 125 * Two print routines -- one for use from DDB and DDB-like contexts, the 126 * other for use in the live kernel. 127 */ 128void 129stack_sbuf_print(struct sbuf *sb, struct stack *st) 130{ --- 94 unchanged lines hidden --- | 125 126/* 127 * Two print routines -- one for use from DDB and DDB-like contexts, the 128 * other for use in the live kernel. 129 */ 130void 131stack_sbuf_print(struct sbuf *sb, struct stack *st) 132{ --- 94 unchanged lines hidden --- |