xref: /illumos-gate/usr/src/man/man3c_db/td_thr_getgregs.3c_db (revision 6926de2eb4241afc948ffe50db3f852871d00997)
1.\"
2.\"  Copyright (c) 1998 Sun Microsystems, Inc.  All Rights Reserved
3.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6.\" Copyright 2023 Oxide Computer Company
7.Dd January 23, 2023
8.Dt TD_THR_GETGREGS 3C_DB
9.Os
10.Sh NAME
11.Nm td_thr_getgregs ,
12.Nm td_thr_setgregs ,
13.Nm td_thr_getfpregs ,
14.Nm td_thr_setfpregs ,
15.Nm td_thr_getxregsize ,
16.Nm td_thr_getxregs ,
17.Nm td_thr_setxregs
18.Nd reading and writing thread registers in libc_db
19.Sh LIBRARY
20.Lb libc_db
21.Sh SYNOPSIS
22.In proc_service.h
23.In thread_db.h
24.Ft td_err_e
25.Fo td_thr_getgregs
26.Fa "const td_thrhandle_t *th_p"
27.Fa "prgregset_t gregset"
28.Fc
29.Ft td_err_e
30.Fo td_thr_setgregs
31.Fa "const td_thrhandle_t *th_p"
32.Fa "prgregset_t gregset"
33.Fc
34.Ft td_err_e
35.Fo td_thr_getfpregs
36.Fa "const td_thrhandle_t *th_p"
37.Fa "prfpregset_t *fpregset"
38.Fc
39.Ft td_err_e
40.Fo td_thr_setfpregs
41.Fa "const td_thrhandle_t *th_p"
42.Fa "prfpregset_t *fpregset"
43.Fc
44.Ft td_err_e
45.Fo td_thr_getxregsize
46.Fa "const td_thrhandle_t *th_p"
47.Fa "int *xregsize"
48.Fc
49.Ft td_err_e
50.Fo td_thr_getxregs
51.Fa "const td_thrhandle_t *th_p"
52.Fa "prxregset_t *xregset"
53.Fc
54.Ft td_err_e
55.Fo td_thr_setxregs
56.Fa "const td_thrhandle_t *th_p"
57.Fa "prxregset_t *xregset"
58.Fc
59.Sh DESCRIPTION
60These functions read and write the register sets associated with thread
61.Fa th_p .
62The
63.Fn td_thr_getgregs
64and
65.Fn td_thr_setgregs
66functions get and set, respectively, the general registers of thread
67.Fa th_p .
68The
69.Fn td_thr_getfpregs
70and
71.Fn td_thr_setfpregs
72functions get and set, respectively, the thread's floating point register set.
73.Pp
74The
75.Fn td_thr_getxregsize
76function returns in
77.Fa *xregsize
78the size of the
79architecture-dependent extra state registers.
80The
81.Fn td_thr_getxregs
82and
83.Fn td_thr_setxregs
84functions get and set, respectively, those extra state registers.
85The buffer passed to
86.Fn td_thr_getxregs
87must be at least the size indicated by
88.Fn td_thr_getxregsize .
89This size must not be assumed and may change between processes.
90Failure to do so, will result in the system overwriting memory.
91Not all platforms implement extended registers.
92When they are not implemented, these functions return
93.Dv TD_NOXREGS .
94.Sh RETURN VALUES
95The
96.Fn td_thr_getgregs ,
97.Fn td_thr_setgregs ,
98.Fn td_thr_getfpregs ,
99.Fn td_thr_setfpregs ,
100.Fn td_thr_getxregsize ,
101.Fn td_thr_getxregs ,
102and
103.Fn td_thr_setxregs
104functions return one of the following values:
105.Bl -tag -width Ds
106.It Dv TD_OK
107The call completed successfully.
108.It Dv TD_BADTH
109An invalid thread handle was passed in.
110.It Dv TD_DBERR
111A call to one of the imported interface routines failed.
112.It Dv TD_NOFPREGS
113Floating point registers could not be read or written because the architecture
114does not have such registers.
115.It Dv TD_NOXREGS
116Architecture-dependent extra state registers could not be read or written,
117because the architecture does not have such registers.
118.It Dv TD_ERR
119A
120.Sy libc_db
121internal error occurred.
122.El
123.Sh MT-LEVEL
124.Sy Safe
125.Sh SEE ALSO
126.Xr libc_db 3LIB ,
127.Xr attributes 7
128