1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 /* 22 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 23 * Use is subject to license terms. 24 */ 25 26 #ifndef _MDB_FRAME_H 27 #define _MDB_FRAME_H 28 29 #include <mdb/mdb_module.h> 30 #include <mdb/mdb_addrvec.h> 31 #include <mdb/mdb_list.h> 32 #include <mdb/mdb_umem.h> 33 #include <mdb/mdb_vcb.h> 34 #include <mdb/mdb_lex.h> 35 #include <mdb/mdb_wcb.h> 36 #include <mdb/mdb.h> 37 #include <setjmp.h> 38 39 #ifdef __cplusplus 40 extern "C" { 41 #endif 42 43 typedef struct mdb_cmd { 44 mdb_list_t c_list; /* List forward/back pointers */ 45 mdb_idcmd_t *c_dcmd; /* Dcmd to invoke */ 46 mdb_argvec_t c_argv; /* Arguments for this command */ 47 mdb_addrvec_t c_addrv; /* Addresses for this command */ 48 mdb_vcb_t *c_vcbs; /* Variable control block list */ 49 } mdb_cmd_t; 50 51 typedef struct mdb_frame { 52 mdb_list_t f_list; /* Frame stack forward/back pointers */ 53 mdb_list_t f_cmds; /* List of commands to execute */ 54 mdb_wcb_t *f_wcbs; /* Walk control blocks for GC */ 55 mdb_mblk_t *f_mblks; /* Memory blocks for GC */ 56 mdb_cmd_t *f_pcmd; /* Next cmd in pipe (if pipe active) */ 57 mdb_cmd_t *f_cp; /* Pointer to executing command */ 58 mdb_iob_stack_t f_istk; /* Stack of input i/o buffers */ 59 mdb_iob_stack_t f_ostk; /* Stack of output i/o buffers */ 60 jmp_buf f_pcb; /* Control block for longjmp */ 61 uint_t f_flags; /* Volatile flags to save/restore */ 62 uint_t f_id; /* ID for debugging purposes */ 63 mdb_argvec_t f_argvec; /* Command arguments */ 64 int f_oldstate; /* Last lex state */ 65 struct mdb_lex_state *f_lstate; /* Current lex state */ 66 uintmax_t f_dot; /* Value of '.' */ 67 mdb_bool_t pipe; /* frame has pipe context */ 68 uint_t f_cbactive; /* true iff a callback is active */ 69 } mdb_frame_t; 70 71 #ifdef _MDB 72 73 extern mdb_cmd_t *mdb_cmd_create(mdb_idcmd_t *, mdb_argvec_t *); 74 extern void mdb_cmd_destroy(mdb_cmd_t *); 75 extern void mdb_cmd_reset(mdb_cmd_t *); 76 77 extern void mdb_frame_reset(mdb_frame_t *); 78 extern void mdb_frame_push(mdb_frame_t *); 79 extern void mdb_frame_pop(mdb_frame_t *, int); 80 81 extern void mdb_frame_switch(mdb_frame_t *); 82 83 extern void mdb_frame_set_pipe(mdb_frame_t *); 84 extern void mdb_frame_clear_pipe(mdb_frame_t *); 85 extern mdb_frame_t *mdb_frame_pipe(void); 86 87 #endif /* _MDB */ 88 89 #ifdef __cplusplus 90 } 91 #endif 92 93 #endif /* _MDB_FRAME_H */ 94