mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-25 02:53:48 +08:00
4de4c07c6b
* config/i386/nm-linux.h (LINUX_CHILD_POST_STARTUP_INFERIOR): Define. * config/nm-linux.h (CHILD_POST_STARTUP_INFERIOR, CHILD_POST_ATTACH) (CHILD_FOLLOW_FORK, KILL_INFERIOR): Define. * i386-linux-nat.c: Include "linux-nat.h". (child_post_startup_inferior): New function. * i386-nat.c (child_post_startup_inferior): Wrap in #ifdef. * infptrace.c (kill_inferior): Wrap in #ifdef. * lin-lwp.c (lin_lwp_attach_lwp): Call child_post_attach after attaching to each LWP. (child_wait, lin_lwp_wait): Call linux_handle_extended_wait. (init_lin_lwp_ops): Fill in some more operations. * linux-nat.h (linux_enable_event_reporting) (linux_handle_extended_wait, linux_child_post_startup_inferior): New prototypes. * linux-nat.c (linux_enable_event_reporting): New function. (child_post_attach, linux_child_post_startup_inferior) (child_post_startup_inferior, child_follow_fork) (linux_handle_extended_wait, kill_inferior): New functions.
79 lines
2.7 KiB
C
79 lines
2.7 KiB
C
/* Native debugging support for GNU/Linux (LWP layer).
|
|
Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
|
|
|
This file is part of GDB.
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 59 Temple Place - Suite 330,
|
|
Boston, MA 02111-1307, USA. */
|
|
|
|
/* Structure describing an LWP. */
|
|
|
|
struct lwp_info
|
|
{
|
|
/* The process id of the LWP. This is a combination of the LWP id
|
|
and overall process id. */
|
|
ptid_t ptid;
|
|
|
|
/* Non-zero if this LWP is cloned. In this context "cloned" means
|
|
that the LWP is reporting to its parent using a signal other than
|
|
SIGCHLD. */
|
|
int cloned;
|
|
|
|
/* Non-zero if we sent this LWP a SIGSTOP (but the LWP didn't report
|
|
it back yet). */
|
|
int signalled;
|
|
|
|
/* Non-zero if this LWP is stopped. */
|
|
int stopped;
|
|
|
|
/* Non-zero if this LWP will be/has been resumed. Note that an LWP
|
|
can be marked both as stopped and resumed at the same time. This
|
|
happens if we try to resume an LWP that has a wait status
|
|
pending. We shouldn't let the LWP run until that wait status has
|
|
been processed, but we should not report that wait status if GDB
|
|
didn't try to let the LWP run. */
|
|
int resumed;
|
|
|
|
/* If non-zero, a pending wait status. */
|
|
int status;
|
|
|
|
/* Non-zero if we were stepping this LWP. */
|
|
int step;
|
|
|
|
/* Next LWP in list. */
|
|
struct lwp_info *next;
|
|
};
|
|
|
|
/* Read/write to target memory via the Linux kernel's "proc file
|
|
system". */
|
|
struct mem_attrib;
|
|
struct target_ops;
|
|
|
|
extern int linux_proc_xfer_memory (CORE_ADDR addr, char *myaddr, int len,
|
|
int write, struct mem_attrib *attrib,
|
|
struct target_ops *target);
|
|
|
|
/* linux-nat functions for handling fork events. */
|
|
extern void linux_record_stopped_pid (int pid);
|
|
extern void linux_enable_event_reporting (ptid_t ptid);
|
|
extern ptid_t linux_handle_extended_wait (int pid, int status,
|
|
struct target_waitstatus *ourstatus);
|
|
extern void linux_child_post_startup_inferior (ptid_t ptid);
|
|
|
|
/* Iterator function for lin-lwp's lwp list. */
|
|
struct lwp_info *iterate_over_lwps (int (*callback) (struct lwp_info *,
|
|
void *),
|
|
void *data);
|