mdb.h revision 3b6e0a598869dfc84461624e8699bf51738f68b3
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 2012 by Delphix. All rights reserved.
* Copyright (c) 2012 Joyent, Inc. All rights reserved.
*/
#ifndef _MDB_H
#define _MDB_H
#include <mdb/mdb_gelf.h>
#include <mdb/mdb_addrvec.h>
#include <mdb/mdb_argvec.h>
#include <mdb/mdb_target.h>
#include <mdb/mdb_disasm.h>
#include <mdb/mdb_demangle.h>
#include <mdb/mdb_module.h>
#include <mdb/mdb_modapi.h>
#include <mdb/mdb_list.h>
#ifdef _KMDB
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define MDB_ERR_IS_FATAL(err) \
(err) == MDB_ERR_OUTPUT)
#ifdef _KMDB
#endif
#define MDB_EM_ASK 0 /* Ask what to do on an exec */
#define MDB_FM_ASK 0 /* Ask what to do on a fork */
struct kmdb_promif;
typedef struct mdb {
int m_radix; /* Default radix for output formatting */
int m_nargs; /* Default number of arguments in stack trace */
int m_histlen; /* Length of command history */
const char *m_pname; /* Program basename from argv[0] */
const char *m_shell; /* Shell for ! commands and pipelines */
char *m_root; /* Root for path construction */
char *m_ipathstr; /* Path string for include path */
char *m_lpathstr; /* Path string for library path */
const char **m_ipath; /* Path for $< and $<< macro files */
const char **m_lpath; /* Path for :: loadable modules */
char *m_defdisasm; /* Deferred diassembler selection */
char *m_termtype; /* Interactive mode terminal type */
char **m_env; /* Current environment */
#ifdef _KMDB
#endif
} mdb_t;
#ifdef _MDB_PRIVATE
#else
#endif
#ifdef _MDB
#define MDB_CONFIG_ENV_VAR "_MDB_CONFIG"
extern void mdb_create(const char *, const char *);
extern void mdb_destroy(void);
mdb_arg_t *);
extern int mdb_run(void);
extern const char *mdb_get_prompt(void);
extern int mdb_set_prompt(const char *);
extern void mdb_set_ipath(const char *);
extern void mdb_set_lpath(const char *);
extern const char **mdb_path_alloc(const char *, size_t *);
extern void mdb_path_free(const char *[], size_t);
extern uintmax_t mdb_dot_incr(const char *);
extern uintmax_t mdb_dot_decr(const char *);
extern mdb_iwalker_t *mdb_walker_lookup(const char *);
extern mdb_idcmd_t *mdb_dcmd_lookup(const char *);
extern void mdb_pservice_init(void);
extern void mdb_intr_enable(void);
extern void mdb_intr_disable(void);
extern char *mdb_get_config(void);
extern void mdb_set_config(const char *);
extern mdb_module_t *mdb_get_module(void);
#endif /* _MDB */
#ifdef __cplusplus
}
#endif
#endif /* _MDB_H */