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.
29 #include <sys/param.h>
30 #include <sys/regset.h>
35 disp_reg_line(struct ps_prochandle
*ph
, pstatus_t
*prst
, char *r1
, int ind1
,
38 char str1
[MAXPATHLEN
], str2
[MAXPATHLEN
];
40 (void) strcpy(str1
, print_address_ps(ph
, prst
->pr_lwp
.pr_reg
[ind1
],
42 (void) strcpy(str2
, print_address_ps(ph
, prst
->pr_lwp
.pr_reg
[ind2
],
45 (void) printf("%8s: 0x%08x %-16s %8s: 0x%08x %-16s\n", r1
,
46 prst
->pr_lwp
.pr_reg
[ind1
], str1
, r2
, prst
->pr_lwp
.pr_reg
[ind2
],
51 display_all_regs(struct ps_prochandle
*ph
)
55 if (pread(ph
->pp_statusfd
, &pstatus
, sizeof (pstatus
),
57 perror("dar: reading status");
60 (void) printf("registers:\n");
61 disp_reg_line(ph
, &pstatus
, "gs", GS
, "fs", FS
);
62 disp_reg_line(ph
, &pstatus
, "es", ES
, "ds", DS
);
63 disp_reg_line(ph
, &pstatus
, "edi", EDI
, "esi", ESI
);
64 disp_reg_line(ph
, &pstatus
, "ebp", EBP
, "esp", ESP
);
65 disp_reg_line(ph
, &pstatus
, "ebx", EBX
, "edx", EDX
);
66 disp_reg_line(ph
, &pstatus
, "ecx", ECX
, "eax", EAX
);
67 disp_reg_line(ph
, &pstatus
, "trapno", TRAPNO
, "err", ERR
);
68 disp_reg_line(ph
, &pstatus
, "eip", EIP
, "cs", CS
);
69 disp_reg_line(ph
, &pstatus
, "efl", EFL
, "uesp", UESP
);