Deleted Added
full compact
thread_db.c (180982) thread_db.c (181044)
1/*
2 * Copyright (c) 2004 David Xu <davidxu@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*
2 * Copyright (c) 2004 David Xu <davidxu@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/lib/libthread_db/thread_db.c 180982 2008-07-30 00:59:19Z marcel $");
28__FBSDID("$FreeBSD: head/lib/libthread_db/thread_db.c 181044 2008-07-31 05:25:52Z marcel $");
29
30#include <proc_service.h>
31#include <stddef.h>
32#include <thread_db.h>
33#include <unistd.h>
34#include <sys/cdefs.h>
35#include <sys/linker_set.h>
36

--- 8 unchanged lines hidden (view full) ---

45
46SET_DECLARE(__ta_ops, struct ta_ops);
47
48td_err_e
49td_init(void)
50{
51 td_err_e ret, tmp;
52 struct ta_ops *ops_p, **ops_pp;
29
30#include <proc_service.h>
31#include <stddef.h>
32#include <thread_db.h>
33#include <unistd.h>
34#include <sys/cdefs.h>
35#include <sys/linker_set.h>
36

--- 8 unchanged lines hidden (view full) ---

45
46SET_DECLARE(__ta_ops, struct ta_ops);
47
48td_err_e
49td_init(void)
50{
51 td_err_e ret, tmp;
52 struct ta_ops *ops_p, **ops_pp;
53 size_t i;
54
55 ret = 0;
56 SET_FOREACH(ops_pp, __ta_ops) {
57 ops_p = *ops_pp;
58 if (ops_p->to_init != NULL) {
59 tmp = ops_p->to_init();
60 if (tmp != TD_OK)
61 ret = tmp;

--- 37 unchanged lines hidden (view full) ---

99td_ta_map_lwp2thr(const td_thragent_t *ta, lwpid_t lwpid, td_thrhandle_t *th)
100{
101 return (ta->ta_ops->to_ta_map_lwp2thr(ta, lwpid, th));
102}
103
104td_err_e
105td_ta_new(struct ps_prochandle *ph, td_thragent_t **pta)
106{
53
54 ret = 0;
55 SET_FOREACH(ops_pp, __ta_ops) {
56 ops_p = *ops_pp;
57 if (ops_p->to_init != NULL) {
58 tmp = ops_p->to_init();
59 if (tmp != TD_OK)
60 ret = tmp;

--- 37 unchanged lines hidden (view full) ---

98td_ta_map_lwp2thr(const td_thragent_t *ta, lwpid_t lwpid, td_thrhandle_t *th)
99{
100 return (ta->ta_ops->to_ta_map_lwp2thr(ta, lwpid, th));
101}
102
103td_err_e
104td_ta_new(struct ps_prochandle *ph, td_thragent_t **pta)
105{
107 size_t i;
108 struct ta_ops *ops_p, **ops_pp;
109
110 SET_FOREACH(ops_pp, __ta_ops) {
111 ops_p = *ops_pp;
112 if (ops_p->to_ta_new(ph, pta) == TD_OK) {
113 TAILQ_INSERT_HEAD(&proclist, *pta, ta_next);
114 (*pta)->ta_ops = ops_p;
115 return (TD_OK);

--- 146 unchanged lines hidden ---
106 struct ta_ops *ops_p, **ops_pp;
107
108 SET_FOREACH(ops_pp, __ta_ops) {
109 ops_p = *ops_pp;
110 if (ops_p->to_ta_new(ph, pta) == TD_OK) {
111 TAILQ_INSERT_HEAD(&proclist, *pta, ta_next);
112 (*pta)->ta_ops = ops_p;
113 return (TD_OK);

--- 146 unchanged lines hidden ---