1/* 2 * Copyright (c) 2004 Marcel Moolenaar 3 * Copyright (c) 2005 David Xu 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/lib/libthread_db/libthr_db.c 155387 2006-02-06 11:54:19Z davidxu $"); |
30 31#include <proc_service.h> 32#include <stddef.h> 33#include <stdlib.h> 34#include <string.h> 35#include <sys/types.h> 36#include <sys/ptrace.h> 37#include <thread_db.h> --- 431 unchanged lines hidden (view full) --- 469pt_thr_get_info(const td_thrhandle_t *th, td_thrinfo_t *info) 470{ 471 const td_thragent_t *ta = th->th_ta; 472 int state; 473 int ret; 474 475 TDBG_FUNC(); 476 |
477 bzero(info, sizeof(*info)); |
478 ret = pt_validate(th); 479 if (ret) 480 return (ret); 481 ret = ps_pread(ta->ph, th->th_thread + ta->thread_off_state, 482 &state, sizeof(state)); 483 if (ret != 0) 484 return (P2T(ret)); 485 ret = ps_pread(ta->ph, th->th_thread + ta->thread_off_report_events, --- 301 unchanged lines hidden --- |