* lin-lwp.c, thread-db.c, defs.h, cris-tdep.c: Replace ``Linux''

with either ``GNU/Linux'' or ``Linux kernel''.
Fix PR gdb/378.
This commit is contained in:
Andrew Cagney 2002-02-24 21:53:02 +00:00
parent 2aea96a18e
commit 8605d56e7a
5 changed files with 45 additions and 34 deletions

View File

@ -1,3 +1,9 @@
2002-02-24 Andrew Cagney <ac131313@redhat.com>
* lin-lwp.c, thread-db.c, defs.h, cris-tdep.c: Replace ``Linux''
with either ``GNU/Linux'' or ``Linux kernel''.
Fix PR gdb/378.
2002-02-23 Andrew Cagney <ac131313@redhat.com> 2002-02-23 Andrew Cagney <ac131313@redhat.com>
* lin-thread.c: Delete file. * lin-thread.c: Delete file.

View File

@ -3625,11 +3625,13 @@ static struct core_fns cris_elf_core_fns =
}; };
/* Fetch (and possibly build) an appropriate link_map_offsets /* Fetch (and possibly build) an appropriate link_map_offsets
structure for native Linux/CRIS targets using the struct offsets structure for native GNU/Linux CRIS targets using the struct
defined in link.h (but without actual reference to that file). offsets defined in link.h (but without actual reference to that
file).
This makes it possible to access Linux/CRIS shared libraries from a This makes it possible to access GNU/Linux CRIS shared libraries
GDB that was not built on an Linux/CRIS host (for cross debugging). from a GDB that was not built on an GNU/Linux CRIS host (for cross
debugging).
See gdb/solib-svr4.h for an explanation of these fields. */ See gdb/solib-svr4.h for an explanation of these fields. */

View File

@ -333,13 +333,13 @@ enum target_signal
TARGET_SIGNAL_CANCEL = 76, TARGET_SIGNAL_CANCEL = 76,
/* Yes, this pains me, too. But LynxOS didn't have SIG32, and now /* Yes, this pains me, too. But LynxOS didn't have SIG32, and now
Linux does, and we can't disturb the numbering, since it's part GNU/Linux does, and we can't disturb the numbering, since it's
of the remote protocol. Note that in some GDB's part of the remote protocol. Note that in some GDB's
TARGET_SIGNAL_REALTIME_32 is number 76. */ TARGET_SIGNAL_REALTIME_32 is number 76. */
TARGET_SIGNAL_REALTIME_32, TARGET_SIGNAL_REALTIME_32,
/* Yet another pain, IRIX 6 has SIG64. */ /* Yet another pain, IRIX 6 has SIG64. */
TARGET_SIGNAL_REALTIME_64, TARGET_SIGNAL_REALTIME_64,
/* Yet another pain, Linux/MIPS might go up to 128. */ /* Yet another pain, GNU/Linux MIPS might go up to 128. */
TARGET_SIGNAL_REALTIME_65, TARGET_SIGNAL_REALTIME_65,
TARGET_SIGNAL_REALTIME_66, TARGET_SIGNAL_REALTIME_66,
TARGET_SIGNAL_REALTIME_67, TARGET_SIGNAL_REALTIME_67,

View File

@ -1,4 +1,4 @@
/* Multi-threaded debugging support for Linux (LWP layer). /* Multi-threaded debugging support for GNU/Linux (LWP layer).
Copyright 2000, 2001 Free Software Foundation, Inc. Copyright 2000, 2001 Free Software Foundation, Inc.
This file is part of GDB. This file is part of GDB.
@ -35,38 +35,38 @@
static int debug_lin_lwp; static int debug_lin_lwp;
extern const char *strsignal (int sig); extern const char *strsignal (int sig);
/* On Linux there are no real LWP's. The closest thing to LWP's are /* On GNU/Linux there are no real LWP's. The closest thing to LWP's
processes sharing the same VM space. A multi-threaded process is are processes sharing the same VM space. A multi-threaded process
basically a group of such processes. However, such a grouping is is basically a group of such processes. However, such a grouping
almost entirely a user-space issue; the kernel doesn't enforce such is almost entirely a user-space issue; the kernel doesn't enforce
a grouping at all (this might change in the future). In general, such a grouping at all (this might change in the future). In
we'll rely on the threads library (i.e. the LinuxThreads library) general, we'll rely on the threads library (i.e. the GNU/Linux
to provide such a grouping. Threads library) to provide such a grouping.
It is perfectly well possible to write a multi-threaded application It is perfectly well possible to write a multi-threaded application
without the assistance of a threads library, by using the clone without the assistance of a threads library, by using the clone
system call directly. This module should be able to give some system call directly. This module should be able to give some
rudimentary support for debugging such applications if developers rudimentary support for debugging such applications if developers
specify the CLONE_PTRACE flag in the clone system call, and are specify the CLONE_PTRACE flag in the clone system call, and are
using Linux 2.4 or above. using the Linux kernel 2.4 or above.
Note that there are some peculiarities in Linux that affect this Note that there are some peculiarities in GNU/Linux that affect
code: this code:
- In general one should specify the __WCLONE flag to waitpid in - In general one should specify the __WCLONE flag to waitpid in
order to make it report events for any of the cloned processes order to make it report events for any of the cloned processes
(and leave it out for the initial process). However, if a cloned (and leave it out for the initial process). However, if a cloned
process has exited the exit status is only reported if the process has exited the exit status is only reported if the
__WCLONE flag is absent. Linux 2.4 has a __WALL flag, but we __WCLONE flag is absent. Linux kernel 2.4 has a __WALL flag, but
cannot use it since GDB must work on older systems too. we cannot use it since GDB must work on older systems too.
- When a traced, cloned process exits and is waited for by the - When a traced, cloned process exits and is waited for by the
debugger, the kernel reassigns it to the original parent and debugger, the kernel reassigns it to the original parent and
keeps it around as a "zombie". Somehow, the LinuxThreads library keeps it around as a "zombie". Somehow, the GNU/Linux Threads
doesn't notice this, which leads to the "zombie problem": When library doesn't notice this, which leads to the "zombie problem":
debugged a multi-threaded process that spawns a lot of threads When debugged a multi-threaded process that spawns a lot of
will run out of processes, even if the threads exit, because the threads will run out of processes, even if the threads exit,
"zombies" stay around. */ because the "zombies" stay around. */
/* Structure describing a LWP. */ /* Structure describing a LWP. */
struct lwp_info struct lwp_info
@ -293,7 +293,7 @@ iterate_over_lwps (int (*callback) (struct lwp_info *, void *), void *data)
} }
/* Implementation of the PREPARE_TO_PROCEED hook for the Linux LWP /* Implementation of the PREPARE_TO_PROCEED hook for the GNU/Linux LWP
layer. layer.
Note that this implementation is potentially redundant now that Note that this implementation is potentially redundant now that
@ -1476,7 +1476,7 @@ _initialize_lin_lwp (void)
add_show_from_set (add_set_cmd ("lin-lwp", no_class, var_zinteger, add_show_from_set (add_set_cmd ("lin-lwp", no_class, var_zinteger,
(char *) &debug_lin_lwp, (char *) &debug_lin_lwp,
"Set debugging of linux lwp module.\n\ "Set debugging of GNU/Linux lwp module.\n\
Enables printf debugging output.\n", Enables printf debugging output.\n",
&setdebuglist), &setdebuglist),
&showdebuglist); &showdebuglist);
@ -1484,7 +1484,8 @@ Enables printf debugging output.\n",
/* FIXME: kettenis/2000-08-26: The stuff on this page is specific to /* FIXME: kettenis/2000-08-26: The stuff on this page is specific to
the LinuxThreads library and therefore doesn't really belong here. */ the GNU/Linux Threads library and therefore doesn't really belong
here. */
/* Read variable NAME in the target and return its value if found. /* Read variable NAME in the target and return its value if found.
Otherwise return zero. It is assumed that the type of the variable Otherwise return zero. It is assumed that the type of the variable
@ -1528,10 +1529,11 @@ lin_thread_get_thread_signals (sigset_t *set)
sigaddset (set, restart); sigaddset (set, restart);
sigaddset (set, cancel); sigaddset (set, cancel);
/* The LinuxThreads library makes terminating threads send a special /* The GNU/Linux Threads library makes terminating threads send a
"cancel" signal instead of SIGCHLD. Make sure we catch those (to special "cancel" signal instead of SIGCHLD. Make sure we catch
prevent them from terminating GDB itself, which is likely to be those (to prevent them from terminating GDB itself, which is
their default action) and treat them the same way as SIGCHLD. */ likely to be their default action) and treat them the same way as
SIGCHLD. */
action.sa_handler = sigchld_handler; action.sa_handler = sigchld_handler;
sigemptyset (&action.sa_mask); sigemptyset (&action.sa_mask);

View File

@ -37,7 +37,8 @@
#define LIBTHREAD_DB_SO "libthread_db.so.1" #define LIBTHREAD_DB_SO "libthread_db.so.1"
#endif #endif
/* If we're running on Linux, we must explicitly attach to any new threads. */ /* If we're running on GNU/Linux, we must explicitly attach to any new
threads. */
/* FIXME: There is certainly some room for improvements: /* FIXME: There is certainly some room for improvements:
- Cache LWP ids. - Cache LWP ids.
@ -576,7 +577,7 @@ attach_thread (ptid_t ptid, const td_thrhandle_t *th_p,
if (ti_p->ti_state == TD_THR_UNKNOWN || ti_p->ti_state == TD_THR_ZOMBIE) if (ti_p->ti_state == TD_THR_UNKNOWN || ti_p->ti_state == TD_THR_ZOMBIE)
return; /* A zombie thread -- do not attach. */ return; /* A zombie thread -- do not attach. */
/* Under Linux, we have to attach to each and every thread. */ /* Under GNU/Linux, we have to attach to each and every thread. */
#ifdef ATTACH_LWP #ifdef ATTACH_LWP
ATTACH_LWP (BUILD_LWP (ti_p->ti_lid, GET_PID (ptid)), 0); ATTACH_LWP (BUILD_LWP (ti_p->ti_lid, GET_PID (ptid)), 0);
#endif #endif