{
/* brobecker/2010-06-21: It looks like the LWP field in ptids
should be distinct for each thread (see write_ptid where it
writes the thread ID from the LWP). So instead of storing
the LynxOS tid in the tid field of the ptid, we store it in
the lwp field. */
{
/* brobecker/2010-06-21: It looks like the LWP field in ptids
should be distinct for each thread (see write_ptid where it
writes the thread ID from the LWP). So instead of storing
the LynxOS tid in the tid field of the ptid, we store it in
the lwp field. */
if ((sscanf (buf, "%d %d", &thread_pid, &thread_tid) == 2
&& thread_pid == pid))
{
if ((sscanf (buf, "%d %d", &thread_pid, &thread_tid) == 2
&& thread_pid == pid))
{
if (lynx_ptrace (PTRACE_ATTACH, ptid, 0, 0, 0) != 0)
error ("Cannot attach to process %lu: %s (%d)\n", pid,
if (lynx_ptrace (PTRACE_ATTACH, ptid, 0, 0, 0) != 0)
error ("Cannot attach to process %lu: %s (%d)\n", pid,
lynx_add_process (pid, 1);
lynx_add_threads_after_attach (pid);
lynx_add_process (pid, 1);
lynx_add_threads_after_attach (pid);
LynxOS 178 is a little more sensitive, and triggers some
unexpected signals (Eg SIG61) when we resume the inferior
using a different thread. */
LynxOS 178 is a little more sensitive, and triggers some
unexpected signals (Eg SIG61) when we resume the inferior
using a different thread. */
ptid = current_process()->priv->last_wait_event_ptid;
/* The ptid might still be minus_one_ptid; this can happen between
the moment we create the inferior or attach to a process, and
the moment we resume its execution for the first time. It is
fine to use the current_thread's ptid in those cases. */
ptid = current_process()->priv->last_wait_event_ptid;
/* The ptid might still be minus_one_ptid; this can happen between
the moment we create the inferior or attach to a process, and
the moment we resume its execution for the first time. It is
fine to use the current_thread's ptid in those cases. */
errno = 0;
lynx_ptrace (request, ptid, 1, signal, 0);
errno = 0;
lynx_ptrace (request, ptid, 1, signal, 0);
pid = lynx_ptid_get_pid (ptid_of (current_thread));
else
pid = BUILDPID (lynx_ptid_get_pid (ptid), lynx_ptid_get_tid (ptid));
pid = lynx_ptid_get_pid (ptid_of (current_thread));
else
pid = BUILDPID (lynx_ptid_get_pid (ptid), lynx_ptid_get_tid (ptid));
find_process_pid (ret)->priv->last_wait_event_ptid = new_ptid;
/* If this is a new thread, then add it now. The reason why we do
find_process_pid (ret)->priv->last_wait_event_ptid = new_ptid;
/* If this is a new thread, then add it now. The reason why we do
lynx_ptrace (PTRACE_KILL, ptid, 0, 0, 0);
lynx_wait (ptid, &status, 0);
lynx_ptrace (PTRACE_KILL, ptid, 0, 0, 0);
lynx_wait (ptid, &status, 0);
- ptid_t ptid = lynx_ptid_build (pid, 0);
- struct process_info *process;
-
- process = find_process_pid (pid);
- if (process == NULL)
- return -1;
+ ptid_t ptid = lynx_ptid_t (process->pid, 0);
lynx_ptrace (PTRACE_DETACH, ptid, 0, 0, 0);
the_target->mourn (process);
lynx_ptrace (PTRACE_DETACH, ptid, 0, 0, 0);
the_target->mourn (process);
NULL, /* stopped_data_address */
NULL, /* read_offsets */
NULL, /* get_tls_address */
NULL, /* stopped_data_address */
NULL, /* read_offsets */
NULL, /* get_tls_address */
NULL, /* hostio_last_error */
NULL, /* qxfer_osdata */
NULL, /* qxfer_siginfo */
NULL, /* hostio_last_error */
NULL, /* qxfer_osdata */
NULL, /* qxfer_siginfo */