4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
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]
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _PRB_PROC_INT_H
28 #define _PRB_PROC_INT_H
35 * Interfaces private to proc layer
38 #include <sys/types.h>
39 #include <sys/syscall.h>
41 #include <tnf/probe.h>
46 * size of breakpoint instruction
49 typedef unsigned int bptsave_t
;
50 #elif defined(__i386) || defined(__amd64)
51 typedef unsigned char bptsave_t
;
55 * memory shared between parent and child when exec'ing a child.
56 * child spins on "spin" member waiting for parent to set it free
58 typedef struct shmem_msg
{
63 * per /proc handle state
69 bptsave_t saveinstr
; /* instruction that bpt replaced */
70 boolean_t bpt_inserted
; /* is bpt inserted ? */
77 prb_status_t
prb_status_map(int);
78 prb_status_t
find_executable(const char *name
, char *ret_path
);
80 /* shared memory lock interfaces */
81 prb_status_t
prb_shmem_init(volatile shmem_msg_t
**);
82 prb_status_t
prb_shmem_wait(volatile shmem_msg_t
*);
83 prb_status_t
prb_shmem_clear(volatile shmem_msg_t
*);
84 prb_status_t
prb_shmem_free(volatile shmem_msg_t
*smp
);
86 /* runs and stops the process to clear it out of system call */
87 prb_status_t
prb_proc_prstop(prb_proc_ctl_t
*proc_p
);
89 /* break point interfaces */
90 prb_status_t
prb_proc_tracebpt(prb_proc_ctl_t
*proc_p
, boolean_t bpt
);
91 prb_status_t
prb_proc_istepbpt(prb_proc_ctl_t
*proc_p
);
92 prb_status_t
prb_proc_clrbptflt(prb_proc_ctl_t
*proc_p
);
94 /* read a string from target process */
95 prb_status_t
prb_proc_readstr(prb_proc_ctl_t
*proc_p
, uintptr_t addr
,
96 const char **outstr_pp
);
102 #endif /* _PRB_PROC_INT_H */