xref: /illumos-gate/usr/src/cmd/sgs/demo_rdb/sparcv9/m_utils.c (revision d9328cd43f1300af79f6fc8a3ad4760137618c63)
1*d9328cd4SRobert Mustacchi /*
2*d9328cd4SRobert Mustacchi  * CDDL HEADER START
3*d9328cd4SRobert Mustacchi  *
4*d9328cd4SRobert Mustacchi  * The contents of this file are subject to the terms of the
5*d9328cd4SRobert Mustacchi  * Common Development and Distribution License (the "License").
6*d9328cd4SRobert Mustacchi  * You may not use this file except in compliance with the License.
7*d9328cd4SRobert Mustacchi  *
8*d9328cd4SRobert Mustacchi  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*d9328cd4SRobert Mustacchi  * or http://www.opensolaris.org/os/licensing.
10*d9328cd4SRobert Mustacchi  * See the License for the specific language governing permissions
11*d9328cd4SRobert Mustacchi  * and limitations under the License.
12*d9328cd4SRobert Mustacchi  *
13*d9328cd4SRobert Mustacchi  * When distributing Covered Code, include this CDDL HEADER in each
14*d9328cd4SRobert Mustacchi  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*d9328cd4SRobert Mustacchi  * If applicable, add the following below this CDDL HEADER, with the
16*d9328cd4SRobert Mustacchi  * fields enclosed by brackets "[]" replaced with your own identifying
17*d9328cd4SRobert Mustacchi  * information: Portions Copyright [yyyy] [name of copyright owner]
18*d9328cd4SRobert Mustacchi  *
19*d9328cd4SRobert Mustacchi  * CDDL HEADER END
20*d9328cd4SRobert Mustacchi  */
21*d9328cd4SRobert Mustacchi 
22*d9328cd4SRobert Mustacchi /*
23*d9328cd4SRobert Mustacchi  * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
24*d9328cd4SRobert Mustacchi  */
25*d9328cd4SRobert Mustacchi 
26*d9328cd4SRobert Mustacchi #include <stdio.h>
27*d9328cd4SRobert Mustacchi #include <string.h>
28*d9328cd4SRobert Mustacchi 
29*d9328cd4SRobert Mustacchi #include "rdb.h"
30*d9328cd4SRobert Mustacchi 
31*d9328cd4SRobert Mustacchi void
print_mach_varstring(struct ps_prochandle * ph,const char * varname)32*d9328cd4SRobert Mustacchi print_mach_varstring(struct ps_prochandle *ph, const char *varname)
33*d9328cd4SRobert Mustacchi {
34*d9328cd4SRobert Mustacchi 	if (strcmp(varname, "ins") == 0) {
35*d9328cd4SRobert Mustacchi 		display_in_regs(ph, NULL);
36*d9328cd4SRobert Mustacchi 		return;
37*d9328cd4SRobert Mustacchi 	}
38*d9328cd4SRobert Mustacchi 	if (strcmp(varname, "globs") == 0) {
39*d9328cd4SRobert Mustacchi 		display_global_regs(ph, NULL);
40*d9328cd4SRobert Mustacchi 		return;
41*d9328cd4SRobert Mustacchi 	}
42*d9328cd4SRobert Mustacchi 	if (strcmp(varname, "outs") == 0) {
43*d9328cd4SRobert Mustacchi 		display_out_regs(ph, NULL);
44*d9328cd4SRobert Mustacchi 		return;
45*d9328cd4SRobert Mustacchi 	}
46*d9328cd4SRobert Mustacchi 	if (strcmp(varname, "locs") == 0) {
47*d9328cd4SRobert Mustacchi 		display_local_regs(ph, NULL);
48*d9328cd4SRobert Mustacchi 		return;
49*d9328cd4SRobert Mustacchi 	}
50*d9328cd4SRobert Mustacchi 	if (strcmp(varname, "specs") == 0) {
51*d9328cd4SRobert Mustacchi 		display_special_regs(ph, NULL);
52*d9328cd4SRobert Mustacchi 		return;
53*d9328cd4SRobert Mustacchi 	}
54*d9328cd4SRobert Mustacchi 	(void) printf("print: unknown variable given ($%s)\n", varname);
55*d9328cd4SRobert Mustacchi }
56