Commit Graph

68 Commits

Author SHA1 Message Date
wiz
9e3f1ccd88 Various fixes. 2016-11-24 12:18:02 +00:00
kamil
f54728af92 Obsolete thread_type in td_thread_info_st in <pthread_dbg.h>
The thread_type is irrelevant as all local POSIX threads are in user-space.

Keep the thread_type member in td_thread_info_st to preserve ABI
compatibility.

Later the remnants from M:N will be refactored in one go with library ABI
version bump.

Sponsored by <The NetBSD Foundation>
2016-11-22 04:51:06 +00:00
kamil
4c8a06b7ee Simplify (pthread_t)pt_magic read in td_map_pth2thr(3)
No functional change. All ATF tests for pthread_dbg(3) still pass.

Sponsored by <The NetBSD Foundation>
2016-11-22 04:17:05 +00:00
kamil
7b8609d5c0 Document td_map_pth2thr(3) from libpthread_dbg(3)
td_map_pth2thr - convert the pthread_t to a thread handle

Sponsored by <The NetBSD Foundation>
2016-11-22 03:52:01 +00:00
kamil
2d6a6aff1c Document td_thr_getname(3) from libpthread_dbg(3)
td_thr_getname - get the user-assigned name of a thread

Sponsored by <The NetBSD Foundation>
2016-11-22 01:49:36 +00:00
kamil
2e8fabe0b7 Document td_thr_iter(3) from libpthread_dbg(3)
td_thr_iter - iterate over the threads in the process

Sponsored by <The NetBSD Foundation>
2016-11-22 00:07:40 +00:00
kamil
7332bc9351 Document td_thr_info(3) from libpthread_dbg(3)
td_thr_info - get information on a thread

Currently a subset of td_thread_info_t is documented. This version
describes thread_addr and thread_state.

Sponsored by <The NetBSD Foundation>
2016-11-21 22:19:03 +00:00
kamil
ba06ccfe95 Add initial documentation (man-pages) for libpthread_dbg
Document libpthread_dbg and basic function calls: td_open() and td_close()

Sponsored by <The NetBSD Foundation>
2016-11-21 20:43:25 +00:00
kamil
2bd33bc337 Kill SA thread states (TD_STATE_*) in pthread_dbg and add TD_STATE_DEAD
Scheduler Activation types were removed in NetBSD 5.0. Old type set is not
matching the new world POSIX threads library.

Only TD_STATE_RUNNING, TD_STATE_ZOMBIE are still applicable - keep it.

Keep TD_STATE_UNKNOWN as generic unrecognized type.

Add new TD_STATE_DEAD one. The TD_STATE_DEAD type is represented by number
6 in the POSIX threads library, but for the sake of compatibility with
older software using pthread_dbg - renumber it to 7, as six was reserved
for TD_STATE_SUSPENDED.

Old removed state types are marked as reserved and unused.

Sponsored by <The NetBSD Foundation>
2016-11-21 03:02:34 +00:00
kamil
c35485043b Always set trailing '\0' in td_thr_getname() to compose valid ASCIIZ string
This fixes threads5 in tests/lib/libpthread_dbg

Sponsored by <The NetBSD Foundation>
2016-11-20 21:49:24 +00:00
kamil
df6b325f24 Fix pt_magic read in td_map_pth2thr()
The pt_magic field is not the first one in the pthread_t structure.

Sponsored by <The NetBSD Foundation>
2016-11-20 03:53:47 +00:00
kamil
57fc5895ae Catch up with correct pt_magic reads in td_thr_{getname,suspend,resume}
The pt_magic field is not the first one in the pthread_t structure.

Sponsored by <The NetBSD Foundation>
2016-11-20 03:11:32 +00:00
kamil
1d6ebe4f76 Fix pt_magic (part of pthread_t) read in td_thr_info()
The pt_magic field is not the first one in the pthread_t structure.
After this fix, this code is confirmed to work and function td_thr_info()
is functional.

Sponsored by <The NetBSD Foundation>
2016-11-20 02:27:56 +00:00
skrll
11da075cc5 Add multiple inclusion protection and __{BEGIN,END}_DECLS as a native gdb
build uses c++ to build nbsd-thread.c
2016-10-22 18:04:40 +00:00
christos
ffb42684fe don't use kernel types. 2016-01-23 14:02:21 +00:00
manu
841339f07f Make PTHREAD_KEYS_MAX dynamically adjustable
NetBSD's PTHREAD_KEYS_MAX is set to 256, which is low compared to
other systems like Linux (1024) or MacOS X (512). As a result some
setups tested on Linux will exhibit problems on NetBSD because of
pthread_keys usage beyond the limit. This happens for instance on
Apache with various module loaded, and in this case no particular
developper can be blamed for going beyond the limit, since several
modules from different sources contribute to the problem.

This patch makes the limit conigurable through the PTHREAD_KEYS_MAX
environement variable. If undefined, the default remains unchanged
(256). In any case, the value cannot be lowered below POSIX-mandated
_POSIX_THREAD_KEYS_MAX (128).

While there:
- use EXIT_FAILURE instead of 1 when calling err(3) in libpthread.
- Reset _POSIX_THREAD_KEYS_MAX to POSIX mandated 128, instead of 256.
2015-05-29 07:37:31 +00:00
joerg
9c3fd52490 Introduce GENASSYM_CPPFLAGS for options during genassym processing.
Consistently drop assembler flags.
2014-03-04 14:58:14 +00:00
christos
38f91e249c Only the first symbol (pthread_dbg) should return NOLIB, the rest indicate
internal inconsistencies, so let the code return a more vocal error.
2013-01-20 18:45:19 +00:00
christos
1197f89ea3 tsd_alloc is no more, use tsd_list, and disable the destructor walking code
since it needs work. Fixes gdb.
2013-01-20 18:18:07 +00:00
joerg
d306702545 Match ARCHSUBDIR logic from libpthread. 2012-07-19 06:33:48 +00:00
matt
fa835e8c8b These directories default to WARNS?=5 2012-03-21 05:37:42 +00:00
christos
80e86efb1f constify. 2011-10-02 18:18:14 +00:00
matt
353ac4a525 Since this is use pthread_int.h, it needs __LIBPTHREAD_SOURCE__ to be defined. 2011-03-17 01:01:15 +00:00
christos
46edb91e9f bump shared libraries. 2009-01-11 03:07:47 +00:00
ad
55faac1242 pthread_key_create: instead of using a simple 1/0 value to record a key
as allocated, use an array of pointers and save __builtin_return_address(0)
so keys can be identified when doing post-mortem debugging.
2008-03-07 22:27:07 +00:00
ad
bc9419f99a Crank libpthread_dbg major. 2007-10-16 15:11:27 +00:00
ad
9472415c5e Remove stuff that is no longer useful. 2007-10-16 15:06:11 +00:00
skrll
9fdaf800d9 Merge nick-csl-alignment. 2007-09-10 11:34:05 +00:00
ad
71197327ee Catch up with libpthread changes. 2007-08-16 01:09:50 +00:00
ad
7bf06aa722 Make libpthread_dbg build again. 2007-08-04 18:54:12 +00:00
skrll
3d370a5b33 Remove more SA libpthread stuff. 2007-03-14 21:09:01 +00:00
ad
de2138164c Remove the PTHREAD_SA option. If M:N threads is reimplemented it's
better off done with a seperate library.
2007-03-02 18:53:51 +00:00
ad
a21c37097e Bump libpthread & libpthread_dbg minor versions so that an old SA copy
gets kept in the file system. Requested by pavel.
2007-02-09 23:00:16 +00:00
ad
401499f30e Sync with kernel changes introduced by merging the newlock2 branch. 2007-02-09 22:08:48 +00:00
ad
d333bb5f2f Build without sys/sa.h present. 2007-02-06 15:24:37 +00:00
christos
f1700f07c0 But turn on PTHREAD_SA, since turning it off does not work yet. 2006-12-24 03:54:43 +00:00
christos
34bc1fc940 just get this to compile again, so that people can build. 2006-12-24 03:47:53 +00:00
christos
06f18c1c0d XXX: GCC uninitialized variable. 2006-05-14 02:15:31 +00:00
mycroft
2b4ccae3e9 Remove pt_blockuc. If the debugger attempts to muck with the state of a
blocked thread, return an error; this should be done through ptrace(2).
2004-10-12 22:17:56 +00:00
chs
94a458cedd enhance MI pthreads code to support hppa:
- statically initialize all global spin locks.  on hppa, 0 means
   the lock is held, so leaving them with the default value doesn't work.
 - compare functions pointers using a function-pointer type rather than
   an integral type.  on hppa, function pointers may be indirect,
   so we need to trigger gcc to emit calls to the function-pointer
   canonicalization routines in the millicode.
 - on hppa the stack grows up, so handle that using the STACK_* macros.
2004-07-18 21:24:52 +00:00
nathanw
993713df32 Recognize thread objects in addr2sync. 2004-07-06 19:33:53 +00:00
nathanw
3a30736db7 td_sync_info(): explicitly clear the "locked" flag when unlocked,
instead of leaving it as garbage.
2004-07-01 18:59:52 +00:00
nathanw
aaad58dd18 td_map_addr2sync(): recognize read-write lock objects. 2004-07-01 18:27:36 +00:00
scw
0f10094026 Cast integer to pointer types via intptr_t.
Problem reported by Havard Eidnes while building evbsh5.
2004-06-11 07:28:05 +00:00
martin
7347018381 Ouch. Lint didn't like the last change on sparc64. The reason:
<machine/reg.h> plays dirty naming tricks on sparc64 to allow 32bit
compatibility (reg ->  reg64 and the parameter in
PTHREAD_REG_TO_UCONTEXT() is called reg). This probably needs to be
fixed separately, but for now reordering the includes will do.
2004-06-10 18:06:19 +00:00
nathanw
41e871fe18 Avoid depending on declarations of struct reg and struct fpreg by using
the proc_regsize() callback to allocate reg and fpreg buffers as part of the
proc state (lazily initialized by the PT_STATE_RUNNING case of
td_thr_suspend()).

Fixes build on sh3 (and probably sh5) platforms.
2004-06-10 01:38:29 +00:00
nathanw
568717a98d Get the td_thread_t * corresponding to nthread to mess with its lwp
data, rather than trying a nonsensical operation on a caddr_t from a
different address space.

Moral: test-compile in the same tree you're working in.
2004-06-03 15:22:08 +00:00
nathanw
387534cc0a Update cached LWP values when suspending the running thread. 2004-06-03 00:31:28 +00:00
nathanw
bff67c76fe Add an offset to the thread ID numbers, because GDB really doesn't
cope with "thread 0".
2004-06-03 00:20:24 +00:00
nathanw
9edc974b8c Add support for reporting and examining suspended threads. 2004-06-02 21:18:25 +00:00