aboutsummaryrefslogtreecommitdiff
path: root/gdb/sol-thread.c
diff options
context:
space:
mode:
authorNicholas Duffek <nsd@redhat.com>2000-04-07 01:14:10 +0000
committerNicholas Duffek <nsd@redhat.com>2000-04-07 01:14:10 +0000
commit2f09097b734af8840d2141a26a53b9c67e67fcf2 (patch)
treec6fd0a041816d5bfb6211d1fde18788f1e51d223 /gdb/sol-thread.c
parent34cbe64ecf7ae8c7e029e4af582d98a7910a3bcf (diff)
downloadgdb-2f09097b734af8840d2141a26a53b9c67e67fcf2.zip
gdb-2f09097b734af8840d2141a26a53b9c67e67fcf2.tar.gz
gdb-2f09097b734af8840d2141a26a53b9c67e67fcf2.tar.bz2
* sol-thread.c (GET_LWP, GET_THREAD, BUILD_LWP, BUILD_THREAD):
Change to rely on PIDGET etc. * config/i386/nm-i386sol2.h (TARGET_HAS_WATCHPOINTS, TARGET_CAN_USE_HARDWARE_WATCHPOINT, HAVE_CONTINUABLE_WATCHPOINT, STOPPED_BY_WATCHPOINT, target_[insert/remove]_watchpoint): define. Allow target to use procfs hardware watchpoints. * config/sparc/nm-sun4sol2.h: ditto. * config/i386/tm-i386sol2.h (PIDGET, TIDGET, MERGEPID): modify definitions to use 16 bits for the pid, 15 bits for the tid, and 1 bit for the flag. * config/sparc/tm-sun4sol2.h: ditto. (SOFTWARE_SINGLE_STEP, SOFTWARE_SINGLE_STEP_P): undefine. * testsuite/gdb.threads/pthreads.exp (all_threads_running): Allow for more than 15 thread increments.
Diffstat (limited to 'gdb/sol-thread.c')
-rw-r--r--gdb/sol-thread.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index a3d2d2c..5d2197e 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -122,14 +122,14 @@ static void init_sol_core_ops PARAMS ((void));
/* Default definitions: These must be defined in tm.h
if they are to be shared with a process module such as procfs. */
-#define THREAD_FLAG 0x80000000
-#define is_thread(ARG) (((ARG) & THREAD_FLAG) != 0)
-#define is_lwp(ARG) (((ARG) & THREAD_FLAG) == 0)
-#define GET_LWP(PID) TIDGET (PID)
-#define GET_THREAD(PID) (((PID) >> 16) & 0x7fff)
-#define BUILD_LWP(TID, PID) ((TID) << 16 | (PID))
+#define THREAD_FLAG 0x80000000
+#define is_thread(ARG) (((ARG) & THREAD_FLAG) != 0)
+#define is_lwp(ARG) (((ARG) & THREAD_FLAG) == 0)
+#define GET_LWP(PID) TIDGET (PID)
+#define GET_THREAD(PID) TIDGET (PID)
+#define BUILD_LWP(TID, PID) MERGEPID (PID, TID)
-#define BUILD_THREAD(THREAD_ID, PID) (THREAD_FLAG | BUILD_LWP (THREAD_ID, PID))
+#define BUILD_THREAD(TID, PID) (MERGEPID (PID, TID) | THREAD_FLAG)
/* Pointers to routines from lithread_db resolved by dlopen() */
@@ -1328,6 +1328,12 @@ ps_lgetLDT (gdb_ps_prochandle_t ph, lwpid_t lwpid,
extern struct ssd *procfs_find_LDT_entry (int);
struct ssd *ret;
+ /* FIXME: can't I get the process ID from the prochandle or something?
+ */
+
+ if (inferior_pid <= 0 || lwpid <= 0)
+ return PS_BADLID;
+
ret = procfs_find_LDT_entry (BUILD_LWP (lwpid, PIDGET (inferior_pid)));
if (ret)
{