binutils-gdb/gdb/linux-nat.h
Daniel Jacobowitz 0ec9a092fd * linux-thread-db.c: Include "linux-nat.h".
(check_for_thread_db): New function, split out from
	thread_db_new_objfile.  Remove dead check for active
	thread_db on inapplicable targets.
	(thread_db_new_objfile): Call check_for_thread_db.
	* Makefile.in (linux-thread-db.o): Update.
	* linux-nat.c (child_post_attach): Call check_for_thread_db.
	(linux_child_post_startup_inferior): Likewise.
	(lin_lwp_attach_lwp): Call target_post_attach instead of
	child_post_attach.
	* linux-nat.h (check_for_thread_db): New prototype.
2006-03-30 16:34:23 +00:00

96 lines
3.3 KiB
C

/* Native debugging support for GNU/Linux (LWP layer).
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006
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., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
#include "target.h"
/* 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;
/* If WAITSTATUS->KIND != TARGET_WAITKIND_SPURIOUS, the waitstatus
for this LWP's last event. This may correspond to STATUS above,
or to a local variable in lin_lwp_wait. */
struct target_waitstatus waitstatus;
/* Next LWP in list. */
struct lwp_info *next;
};
/* Attempt to initialize libthread_db. */
void check_for_thread_db (void);
/* Find process PID's pending signal set from /proc/pid/status. */
void linux_proc_pending_signals (int pid, sigset_t *pending, sigset_t *blocked, sigset_t *ignored);
/* 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);
/* Iterator function for lin-lwp's lwp list. */
struct lwp_info *iterate_over_lwps (int (*callback) (struct lwp_info *,
void *),
void *data);
/* Create a prototype generic Linux target. The client can override
it with local methods. */
struct target_ops * linux_target (void);
/* Register the customized Linux target. This should be used
instead of calling add_target directly. */
void linux_nat_add_target (struct target_ops *);
/* Update linux-nat internal state when changing from one fork
to another. */
void linux_nat_switch_fork (ptid_t new_ptid);