5 * The contents of this file are subject to the terms of the
6 * Common Development and Distribution License (the "License").
7 * You may not use this file except in compliance with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
24 * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
28 #include <sys/types.h>
32 extern
void rdb_prompt
();
36 %token VALUE STEP HELP NUMBER NEWLINE SYMBOL PLUS BREAK CONT DIS GETMAPS
37 %token DELETE MAPS PLTSKIP WHERE PRINT OBJPAD QSTRING VARSTRING ECHO_OUT
46 %type
<addr
> NUMBER address
47 %type
<str
> SYMBOL QSTRING VARSTRING
58 command: BREAK NEWLINE
60 list_breakpoints
(&proch
);
63 | BREAK address NEWLINE
65 if
(set_breakpoint
(&proch
, $2, FLG_BP_USERDEF
) == RET_OK
)
66 (void) printf
("break point set at: 0x%lx\n",
69 (void) printf
("unable to set breakpoint.\n");
74 (void) continue_to_break
(&proch
);
77 | DELETE address NEWLINE
79 if
(delete_breakpoint
(&proch
, $2, FLG_BP_USERDEF
) != RET_OK
)
80 (void) printf
("unable to delete breakpoint at %#lx\n",
83 (void) printf
("breakpoint deleted at 0x%lx\n",
95 (void) disasm_addr
(&proch
, (ulong_t
)$2, 10);
98 | DIS address NUMBER NEWLINE
100 (void) disasm_addr
(&proch
, (ulong_t
)$2, (int)$3);
103 | ECHO_OUT QSTRING NEWLINE
109 | EVENT SYMBOL NEWLINE
111 if
(strcmp
($2, "on") == 0) {
112 (void) printf
("rdb: event information enabled.\n");
113 rdb_flags |
= RDB_FL_EVENTS
;
114 } else if
(strcmp
($2, "off") == 0) {
115 (void) printf
("rdb: event information disabled.\n");
116 rdb_flags
&= ~RDB_FL_EVENTS
;
118 (void) printf
("rdb: unknown event command: %s\n", $2);
125 if
(get_linkmaps
(&proch
) != RET_OK
)
126 (void) printf
("get_linkmaps failed\n");
132 if
(display_linkmaps
(&proch
) != RET_OK
)
133 (void) printf
("display_linkmaps failed\n");
138 if
(display_maps
(&proch
) != RET_OK
)
139 (void) printf
("display_maps failed\n");
146 (void) printf
("single step\n");
148 if
(proch.pp_flags
& FLG_PP_PLTSKIP
)
149 sf |
= FLG_SN_PLTSKIP
;
151 (void) step_n
(&proch
, 1, sf
);
154 | STEP NUMBER NEWLINE
158 (void) printf
("stepping %d\n", (int)$2);
160 if
(proch.pp_flags
& FLG_PP_PLTSKIP
)
161 sf |
= FLG_SN_PLTSKIP
;
163 (void) step_n
(&proch
, $2, sf
);
166 | STEP NUMBER SYMBOL NEWLINE
171 if
(proch.pp_flags
& FLG_PP_PLTSKIP
)
172 sf |
= FLG_SN_PLTSKIP
;
174 if
(strcmp
("silent", $3) == 0)
175 (void) step_n
(&proch
, $2, sf
);
177 (void) printf
("error: step <count> [silent]\n");
187 | HELP SYMBOL NEWLINE
193 | OBJPAD NUMBER NEWLINE
195 (void) printf
("setting object padding to: %#lx\n", $2);
196 (void) set_objpad
(&proch
, $2);
201 if
(proch.pp_flags
& FLG_PP_PLTSKIP
) {
202 proch.pp_flags
&= ~ FLG_PP_PLTSKIP
;
203 (void) printf
("plt skipping disabled\n");
205 proch.pp_flags |
= FLG_PP_PLTSKIP
;
206 (void) printf
("plt skipping enabled\n");
211 | PRINT VARSTRING NEWLINE
213 print_varstring
(&proch
, $2);
217 | PRINT address NEWLINE
219 print_mem
(&proch
, $2, 4, "X");
222 | PRINT address NUMBER NEWLINE
224 print_mem
(&proch
, $2, (int)$3, "X");
227 | PRINT address NUMBER SYMBOL NEWLINE
229 print_mem
(&proch
, $2, (int)$3, $4);
232 | VALUE address NEWLINE
234 (void) printf
("value: %#lx\n", (unsigned long)$2);
239 (void) printf
("printing stack trace\n");
255 address: address PLUS address
262 if
(str_to_sym
(&proch
, $1, &sym
) == RET_OK
)
263 $$
= (ulong_t
)sym.st_value
;
265 (void) printf
("unknown symbol: %s\n", $1);
280 if
(proch.pp_flags
& FLG_PP_PROMPT
) {
281 (void) fputs
("<rdb> ", stdout
);
282 (void) fflush
(stdout
);