mdb_help.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_modapi.h>
#include <mdb/mdb_macalias.h>
#include <mdb/mdb_help.h>
const char _mdb_help[] =
"\nEach debugger command in %s is structured as follows:\n\n"
" [ address [, count]] verb [ arguments ... ]\n"
" ^ ^ ^ ^\n"
" the start --+ | | +-- arguments are strings which can be\n"
" address can be an | | quoted using \"\" or '' or\n"
" expression | | expressions enclosed in $[ ]\n"
" | |\n"
" the repeat count --+ +--------- the verb is a name which begins\n"
" is also an expression with either $, :, or ::. it can also\n"
" be a format specifier (/ \\ ? or =)\n\n"
"For information on debugger commands (dcmds) and walkers, type:\n\n"
" ::help cmdname ... for more detailed information on a command\n"
" ::dcmds ... for a list of dcmds and their descriptions\n"
" ::walkers ... for a list of walkers and their descriptions\n"
" ::dmods -l ... for a list of modules and their dcmds and walkers\n"
" ::formats ... for a list of format characters for / \\ ? and =\n\n"
"For information on command-line options, type:\n\n"
" $ %s -? ... in your shell for a complete list of options\n\n";
/*ARGSUSED*/
static int
{
mdb_printf(" dcmd %-20s - %s\n",
return (0);
}
/*ARGSUSED*/
static int
{
mdb_printf(" walk %-20s - %s\n",
return (0);
}
/*ARGSUSED*/
static int
{
mdb_printf(" ctor 0x%-18lx - target constructor\n",
}
mdb_printf(" ctor 0x%-18lx - disassembler constructor\n",
}
return (0);
}
/*ARGSUSED*/
static int
{
return (0);
}
/*ARGSUSED*/
int
{
mdb_var_t *v;
int i;
if (flags & DCMD_ADDRSPEC)
return (DCMD_USAGE);
if (i != argc) {
return (DCMD_USAGE);
if (v == NULL)
else
} else
return (DCMD_OK);
}
/*ARGSUSED*/
static int
{
return (0);
}
/*ARGSUSED*/
int
{
return (DCMD_USAGE);
return (DCMD_OK);
}
/*ARGSUSED*/
static int
{
return (0);
}
/*ARGSUSED*/
int
{
return (DCMD_USAGE);
return (DCMD_OK);
}
/*ARGSUSED*/
int
{
const mdb_idcmd_t *idcp;
return (DCMD_USAGE);
if (argc == 0) {
return (DCMD_OK);
}
warn("expected string argument\n");
return (DCMD_USAGE);
}
else
return (DCMD_ERR);
}
mdb_printf("\n%<b>NAME%</b>\n %s - %s\n\n",
mdb_printf("%<b>SYNOPSIS%</b>\n ");
if (usage[0] == '?') {
mdb_printf("[ %<u>addr%</u> ] ");
usage++;
} else if (usage[0] == ':') {
mdb_printf("%<u>addr%</u> ");
usage++;
}
mdb_printf("%<b>DESCRIPTION%</b>\n");
(void) mdb_inc_indent(2);
(void) mdb_dec_indent(2);
mdb_printf("\n");
}
/*
* For now, modules that are built-in mark their interfaces Evolving
* (documented in mdb(1)) and modules that are loaded mark their
* interfaces Unstable. In the future we could extend the dmod linkage
* to include the module's intended stability and then show it here.
*/
mdb_printf("%<b>ATTRIBUTES%</b>\n\n");
mdb_printf(" Interface Stability: %s\n\n",
"Evolving" : "Unstable");
return (DCMD_OK);
}
static int
{
mdb_printf(" [%d] %s`%s\n",
return (0);
}
static int
{
mdb_printf(" [%d] %s`%s\n",
return (0);
}
/*ARGSUSED*/
int
{
const char defn_hdr[] = " > definition list:\n";
int i;
for (; i < argc; i++) {
const char *alias;
continue;
if (s[0] == '$' && s[1] == '<')
s += 2;
int i = 1;
mdb_printf("%s is a dcmd from module %s\n",
} else
mdb_printf("%s is a built-in dcmd\n", s);
if (opt_v) {
mdb_nv_defn_iter(v, print_dcmd_def, &i);
}
}
int i = 1;
mdb_printf("%s is a walker from module %s\n",
} else
mdb_printf("%s is a built-in walker\n", s);
if (opt_v) {
mdb_nv_defn_iter(v, print_walker_def, &i);
}
}
}
if (!found)
mdb_warn("%s not found\n", s);
}
return (DCMD_OK);
}