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.
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.
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]
23 * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
33 char *ht_key
; /* HELP keyword for topic */
34 char *ht_desc
; /* description of topic */
35 void (*ht_func
)(); /* detailed info on topic */
41 (void) printf("Break Help:\n"
42 "\tbreak - list breakpoints\n"
43 "\tbreak <address> - set break point at <address\n");
49 (void) printf("Delete Help:\n"
50 "\tdelete <address> - delete breakpoint at <address>\n");
56 (void) printf("Disassemble Help:\n"
57 "\tdis -\t\t\tdisassemble from current PC\n"
58 "\tdis <address> [count] -\tdisassemble from address for\n"
59 "\t\t\t\t<count> instructions\n");
65 (void) printf("Echo Help:\n"
66 "\tEcho '<quoted string>'\n"
67 "\t\tthe echo command can be used to display output to\n"
68 "\t\tthe main terminal. This is useful when running\n"
69 "\t\tcommand scripts and wanting to display status\n"
71 "\t\tcurrently only <quoted strings> may be displayed\n");
77 (void) printf("Print Help:\n"
78 "\tprint <address> [count [format]]\n"
79 "\t\tcount - number of units to print (default 4)\n"
80 "\t\tformat - how to display data:\n"
81 "\t\t\t\tX - Hex Words (default)\n"
82 "\t\t\t\tb - unsigned hex bytes\n"
83 "\t\t\t\ts - string\n"
85 "\t\thelp varname for more info\n");
91 (void) printf("Step Help:\n");
92 (void) printf("\tstep - step one instruction.\n");
93 (void) printf("\tstep count [silent] - step count instructions\n");
94 (void) printf("\t\t\t\tif silent is specified to not disassemble\n"
95 "\t\t\t\tinstr. during stepping\n");
101 (void) printf("Value Help:\n"
102 "\tvalue <symbol name> -\tdisplay the value associated with\n"
103 "\t\t\t\tsymbol <symbol name>.\n");
109 (void) printf("Variable Name Help:\n"
110 "\tVariable names are in the form of $<name> and are used\n"
111 "\tto access special information. Possible varnames\n"
114 "\t\t\t$regs - display all registers\n"
116 "\t\t\t$ins - display IN registers\n"
117 "\t\t\t$globs - display GLOBAL registers\n"
118 "\t\t\t$outs - display OUT registers\n"
119 "\t\t\t$locs - display LOCAL registers\n"
120 "\t\t\t$specs - display SPECIAL registers\n"
124 static const help_topics htops
[] = {
127 "Set and display breakpoints",
132 "continue execution of process",
137 "delete breakpoints",
142 "Help on the Disassemble Command",
147 "Help on the Echo Command",
152 "event [on|off] to enable or disable event information",
157 "Read Link_Map structure from run-time linker",
162 "Display link-map information",
167 "Display memory mapping information",
172 "Set object padding for ld.so.1 mmap'ed objects",
177 "Enables and disables stepping through PLT's",
182 "Display memory at <address>",
187 "Help on the Step Command",
192 "Help on the Value Command",
197 "Help on $variable values",
202 "Display stack trace",
213 rdb_help(const char *topic
) {
217 for (i
= 0; htops
[i
].ht_key
; i
++) {
218 if (strcmp(htops
[i
].ht_key
, topic
) == 0) {
219 if (htops
[i
].ht_func
)
222 (void) printf("no additional help "
223 "available for %s\n",
228 (void) printf("Help not available for topic: %s\n", topic
);
231 (void) printf("The following commands are available\n");
233 for (i
= 0; htops
[i
].ht_key
; i
++) {
234 (void) printf("\t%10s\t%s", htops
[i
].ht_key
, htops
[i
].ht_desc
);
235 if (htops
[i
].ht_func
)
237 (void) putchar('\n');
239 (void) printf("\n(*) more help is available by typing "
240 "'help <topic>'\n\n");