1td_ta_new(3C_DB) Threads Debugging Library Functions td_ta_new(3C_DB)
2
3
4
6 td_ta_new, td_ta_delete, td_ta_get_ph - allocate and deallocate process
7 handles for libc_db
8
10 cc [ flag... ] file... -lc_db [ library... ]
11 #include <proc_service.h>
12 #include <thread_db.h>
13
14 td_err_e td_ta_new(const struct ps_prochandle *ph_p, td_thragent_t **ta_pp);
15
16
17 td_err_e td_ta_delete(const td_thragent_t *ta_p);
18
19
20 td_err_e td_ta_get_ph(const td_thragent_t *ta_p, struct ps_prochandle **ph_pp);
21
22
24 The td_ta_new() function registers a target process with libc_db(3LIB)
25 and allocates an internal process handle of type td_thragent_t for this
26 target process. Subsequent calls to libc_db can use this handle to
27 refer to this target process.
28
29
30 There are actually two process handles, an internal process handle
31 assigned by libc_db and an external process handle assigned by the
32 libc_db client. There is a one-to-one correspondence between the two
33 handles. When the client calls a libc_db function, it uses the inter‐
34 nal process handle. When libc_db calls one of the client-provided rou‐
35 tines listed in proc_service(3PROC), it uses the external process han‐
36 dle.
37
38
39 The ph argument is the external process handle that libc_db should use
40 to identify this target process to the controlling process when it
41 calls routines in the imported interface.
42
43
44 If this call is successful, the value of the newly allocated td_thra‐
45 gent_t handle is returned in *ta_pp. The td_ta_delete() function
46 deregisters a target process with libc_db, which deallocates its inter‐
47 nal process handle and frees any other resources libc_db has acquired
48 with respect to the target process. The ta_p argument specifies the
49 target process to be deregistered.
50
51
52 The td_ta_get_ph() function returns in *ph_pp the external process han‐
53 dle that corresponds to the internal process handle ta_p. This is use‐
54 ful for checking internal consistency.
55
57 TD_OK The call completed successfully.
58
59
60 TD_BADPH A NULL external process handle was passed to
61 td_ta_new().
62
63
64 TD_ERR The ta_pp argument is NULL or an internal error
65 occurred.
66
67
68 TD_DBERR A call to one of the imported interface routines
69 failed.
70
71
72 TD_MALLOC Memory allocation failure.
73
74
75 TD_NOLIBTHREAD The target process does not appear to be multi‐
76 threaded.
77
78
80 See attributes(5) for description of the following attributes:
81
82
83
84
85 ┌─────────────────────────────┬─────────────────────────────┐
86 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
87 ├─────────────────────────────┼─────────────────────────────┤
88 │MT-Level │Safe │
89 └─────────────────────────────┴─────────────────────────────┘
90
92 libc_db(3LIB), proc_service(3PROC), attributes(5)
93
94
95
96SunOS 5.11 20 Oct 1998 td_ta_new(3C_DB)