mdb_debug.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <mdb/mdb_debug.h>
#include <libproc.h>
#include <libctf.h>
#include <rtld_db.h>
#include <strings.h>
#include <stdarg.h>
typedef struct dbg_mode {
const char *m_name;
const char *m_desc;
} dbg_mode_t;
static const dbg_mode_t dbg_modetab[] = {
#ifdef YYDEBUG
#endif
{ "none", "unset all debug modes", 0 },
{ NULL, 0 }
};
static const char dbg_prefix[] = "mdb DEBUG: ";
/*PRINTFLIKE2*/
void
{
}
}
void
{
}
}
mdb_dstr2mode(const char *s)
{
const dbg_mode_t *mp;
const char *name;
char dstr[256];
if (s == NULL)
return (0);
else
bits = 0;
break;
}
}
}
if (bits & MDB_DBG_HELP) {
warn("Debugging tokens:\n");
}
return (bits);
}
void
{
int *libproc_debugp, *libctf_debugp;
void (*rd_logp)(const int);
}
#ifdef DEBUG
int
{
/*NOTREACHED*/
return (0);
}
#endif
/*
* debugging routines.
*/
const char *
mdb_err2str(int err)
{
static const char *const errtab[] = {
"0", "PARSE", "NOMEM", "PAGER", "SIGINT",
"QUIT", "ASSERT", "API", "ABORT", "OUTPUT"
};
static char buf[32];
return (buf);
}