30 #include <sys/param.h>
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 typedef struct findstack_info {
37 uintptr_t *fsi_stack; /* place to record frames */
38 uintptr_t fsi_sp; /* stack pointer */
39 uintptr_t fsi_pc; /* pc */
40 uintptr_t fsi_sobj_ops; /* sobj_ops */
41 uint_t fsi_tstate; /* t_state */
42 uchar_t fsi_depth; /* stack depth */
43 uchar_t fsi_failed; /* search failed */
44 uchar_t fsi_overflow; /* stack was deeper than max_depth */
45 uchar_t fsi_panic; /* thread called panic() */
46 uchar_t fsi_max_depth; /* stack frames available */
47 } findstack_info_t;
48
49 #define FSI_FAIL_BADTHREAD 1
50 #define FSI_FAIL_NOTINMEMORY 2
51 #define FSI_FAIL_THREADCORRUPT 3
52 #define FSI_FAIL_STACKNOTFOUND 4
53
54 typedef struct stacks_module {
55 char sm_name[MAXPATHLEN]; /* name of module */
56 uintptr_t sm_text; /* base address of text in module */
57 size_t sm_size; /* size of text in module */
58 } stacks_module_t;
59
60 extern int findstack(uintptr_t, uint_t, int, const mdb_arg_t *);
61 extern int findstack_debug(uintptr_t, uint_t, int, const mdb_arg_t *);
62
63 /*
64 * The following routines are implemented in findstack.c, shared across both
65 * genunix and libc.
66 */
67 extern int stacks(uintptr_t, uint_t, int, const mdb_arg_t *);
68 extern void stacks_cleanup(int);
69
70 /*
71 * The following routines are specific to their context (kernel vs. user-land)
72 * and are therefore implemented in findstack_subr.c (of which each of genunix
|
30 #include <sys/param.h>
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 typedef struct findstack_info {
37 uintptr_t *fsi_stack; /* place to record frames */
38 uintptr_t fsi_sp; /* stack pointer */
39 uintptr_t fsi_pc; /* pc */
40 uintptr_t fsi_sobj_ops; /* sobj_ops */
41 uint_t fsi_tstate; /* t_state */
42 uchar_t fsi_depth; /* stack depth */
43 uchar_t fsi_failed; /* search failed */
44 uchar_t fsi_overflow; /* stack was deeper than max_depth */
45 uchar_t fsi_panic; /* thread called panic() */
46 uchar_t fsi_max_depth; /* stack frames available */
47 } findstack_info_t;
48
49 #define FSI_FAIL_BADTHREAD 1
50 #define FSI_FAIL_THREADCORRUPT 2
51 #define FSI_FAIL_STACKNOTFOUND 3
52
53 typedef struct stacks_module {
54 char sm_name[MAXPATHLEN]; /* name of module */
55 uintptr_t sm_text; /* base address of text in module */
56 size_t sm_size; /* size of text in module */
57 } stacks_module_t;
58
59 extern int findstack(uintptr_t, uint_t, int, const mdb_arg_t *);
60 extern int findstack_debug(uintptr_t, uint_t, int, const mdb_arg_t *);
61
62 /*
63 * The following routines are implemented in findstack.c, shared across both
64 * genunix and libc.
65 */
66 extern int stacks(uintptr_t, uint_t, int, const mdb_arg_t *);
67 extern void stacks_cleanup(int);
68
69 /*
70 * The following routines are specific to their context (kernel vs. user-land)
71 * and are therefore implemented in findstack_subr.c (of which each of genunix
|