2003-06-04 Jeff Johnston <jjohnstn@redhat.com>

* acconfig.h: Add HAVE_TKILL_SYSCALL definition check.
        * config.in: Regenerated.
        * configure.in: Add test for syscall function and check for
        __NR_tkill macro in <syscall.h> to set HAVE_TKILL_SYSCALL.
        * configure: Regenerated.
        * lin-lwp.c [HAVE_TKILL_SYSCALL]: Include <unistd.h> and
        <sys/syscall.h>.
        (kill_lwp): New function that uses tkill syscall or
        uses kill, depending on whether threading model is nptl or not.
        All callers of kill() changed to use kill_lwp().
        (lin_lwp_wait): Make special check when WIFEXITED occurs to
        see if all threads have already exited in the nptl model.
        (stop_and_resume_callback): New callback function used by the
        lin_lwp_wait thread exit handling code.
        (stop_wait_callback): Check for threads already having exited and
        delete such threads fromt the lwp list when discovered.
        (stop_callback): Don't assert retcode of kill call.

        Roland McGrath  <roland@redhat.com>
        * i386-linux-nat.c (ps_get_thread_area): New function needed by
        nptl libthread_db.
This commit is contained in:
Jeff Johnston
2003-06-04 20:51:29 +00:00
parent e8c1a4e716
commit b757528ff6
7 changed files with 519 additions and 205 deletions

View File

@@ -70,6 +70,9 @@
/* Defines I386_LINUX_ORIG_EAX_REGNUM. */
#include "i386-linux-tdep.h"
/* Defines ps_err_e, struct ps_prochandle. */
#include "gdb_proc_service.h"
/* Prototypes for local functions. */
static void dummy_sse_values (void);
@@ -683,6 +686,21 @@ i386_linux_dr_set (int regnum, unsigned long value)
perror_with_name ("Couldn't write debug register");
}
extern ps_err_e
ps_get_thread_area(const struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base)
{
unsigned long int desc[3];
#define PTRACE_GET_THREAD_AREA 25
if (ptrace (PTRACE_GET_THREAD_AREA,
lwpid, (void *) idx, (unsigned long) &desc) < 0)
return PS_ERR;
*(int *)base = desc[1];
return PS_OK;
}
void
i386_linux_dr_set_control (unsigned long control)
{