gdb/
* Makefile.in (linux-ptrace.o): New. * common/linux-procfs.c (linux_proc_pid_is_zombie): New, from linux-nat.c. * common/linux-procfs.h (linux_proc_pid_is_zombie): New declaration. * common/linux-ptrace.c: New file. * config/alpha/alpha-linux.mh (NATDEPFILES): Add linux-ptrace.o. * config/arm/linux.mh: Likewise. * config/i386/linux.mh: Likewise. * config/i386/linux64.mh: Likewise. * config/ia64/linux.mh: Likewise. * config/m32r/linux.mh: Likewise. * config/m68k/linux.mh: Likewise. * config/mips/linux.mh: Likewise. * config/pa/linux.mh: Likewise. * config/powerpc/linux.mh: Likewise. * config/powerpc/ppc64-linux.mh: Likewise. * config/powerpc/spu-linux.mh: Likewise. * config/s390/s390.mh: Likewise. * config/sparc/linux.mh: Likewise. * config/sparc/linux64.mh: Likewise. * config/xtensa/linux.mh: Likewise. * linux-nat.c (linux_lwp_is_zombie): Remove, move it to common/linux-procfs.c. (wait_lwp): Rename linux_lwp_is_zombie to linux_proc_pid_is_zombie. gdb/gdbserver/ * Makefile.in (linux-ptrace.o): New. * configure.srv (arm*-*-linux*, bfin-*-*linux*, crisv32-*-linux*) (cris-*-linux*, i[34567]86-*-linux*, ia64-*-linux*, m32r*-*-linux*) (m68*-*-linux*, m68*-*-uclinux*, mips*-*-linux*, powerpc*-*-linux*) (s390*-*-linux*, sh*-*-linux*, sparc*-*-linux*, tic6x-*-uclinux) (x86_64-*-linux*, xtensa*-*-linux*): Add linux-ptrace.o to SRV_TGTOBJ of these targets. * linux-low.c (linux_attach_lwp_1): Remove redundent else clause.
This commit is contained in:
parent
44f238bb63
commit
5f572decf9
@ -1,3 +1,30 @@
|
|||||||
|
2012-03-13 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
* Makefile.in (linux-ptrace.o): New.
|
||||||
|
* common/linux-procfs.c (linux_proc_pid_is_zombie): New,
|
||||||
|
from linux-nat.c.
|
||||||
|
* common/linux-procfs.h (linux_proc_pid_is_zombie): New declaration.
|
||||||
|
* common/linux-ptrace.c: New file.
|
||||||
|
* config/alpha/alpha-linux.mh (NATDEPFILES): Add linux-ptrace.o.
|
||||||
|
* config/arm/linux.mh: Likewise.
|
||||||
|
* config/i386/linux.mh: Likewise.
|
||||||
|
* config/i386/linux64.mh: Likewise.
|
||||||
|
* config/ia64/linux.mh: Likewise.
|
||||||
|
* config/m32r/linux.mh: Likewise.
|
||||||
|
* config/m68k/linux.mh: Likewise.
|
||||||
|
* config/mips/linux.mh: Likewise.
|
||||||
|
* config/pa/linux.mh: Likewise.
|
||||||
|
* config/powerpc/linux.mh: Likewise.
|
||||||
|
* config/powerpc/ppc64-linux.mh: Likewise.
|
||||||
|
* config/powerpc/spu-linux.mh: Likewise.
|
||||||
|
* config/s390/s390.mh: Likewise.
|
||||||
|
* config/sparc/linux.mh: Likewise.
|
||||||
|
* config/sparc/linux64.mh: Likewise.
|
||||||
|
* config/xtensa/linux.mh: Likewise.
|
||||||
|
* linux-nat.c (linux_lwp_is_zombie): Remove, move it to
|
||||||
|
common/linux-procfs.c.
|
||||||
|
(wait_lwp): Rename linux_lwp_is_zombie to linux_proc_pid_is_zombie.
|
||||||
|
|
||||||
2012-03-13 Hui Zhu <teawater@gmail.com>
|
2012-03-13 Hui Zhu <teawater@gmail.com>
|
||||||
Pedro Alves <palves@redhat.com>
|
Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
|
@ -1929,6 +1929,10 @@ linux-procfs.o: $(srcdir)/common/linux-procfs.c
|
|||||||
$(COMPILE) $(srcdir)/common/linux-procfs.c
|
$(COMPILE) $(srcdir)/common/linux-procfs.c
|
||||||
$(POSTCOMPILE)
|
$(POSTCOMPILE)
|
||||||
|
|
||||||
|
linux-ptrace.o: $(srcdir)/common/linux-ptrace.c
|
||||||
|
$(COMPILE) $(srcdir)/common/linux-ptrace.c
|
||||||
|
$(POSTCOMPILE)
|
||||||
|
|
||||||
common-agent.o: $(srcdir)/common/agent.c
|
common-agent.o: $(srcdir)/common/agent.c
|
||||||
$(COMPILE) $(srcdir)/common/agent.c
|
$(COMPILE) $(srcdir)/common/agent.c
|
||||||
$(POSTCOMPILE)
|
$(POSTCOMPILE)
|
||||||
|
@ -84,3 +84,34 @@ linux_proc_pid_is_stopped (pid_t pid)
|
|||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* See linux-procfs.h declaration. */
|
||||||
|
|
||||||
|
int
|
||||||
|
linux_proc_pid_is_zombie (pid_t pid)
|
||||||
|
{
|
||||||
|
char buffer[100];
|
||||||
|
FILE *procfile;
|
||||||
|
int retval;
|
||||||
|
int have_state;
|
||||||
|
|
||||||
|
xsnprintf (buffer, sizeof (buffer), "/proc/%d/status", (int) pid);
|
||||||
|
procfile = fopen (buffer, "r");
|
||||||
|
if (procfile == NULL)
|
||||||
|
{
|
||||||
|
warning (_("unable to open /proc file '%s'"), buffer);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
have_state = 0;
|
||||||
|
while (fgets (buffer, sizeof (buffer), procfile) != NULL)
|
||||||
|
if (strncmp (buffer, "State:", 6) == 0)
|
||||||
|
{
|
||||||
|
have_state = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
retval = (have_state
|
||||||
|
&& strcmp (buffer, "State:\tZ (zombie)\n") == 0);
|
||||||
|
fclose (procfile);
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
@ -31,4 +31,8 @@ extern int linux_proc_get_tgid (int lwpid);
|
|||||||
|
|
||||||
extern int linux_proc_pid_is_stopped (pid_t pid);
|
extern int linux_proc_pid_is_stopped (pid_t pid);
|
||||||
|
|
||||||
|
/* Return non-zero if PID is a zombie. */
|
||||||
|
|
||||||
|
extern int linux_proc_pid_is_zombie (pid_t pid);
|
||||||
|
|
||||||
#endif /* COMMON_LINUX_PROCFS_H */
|
#endif /* COMMON_LINUX_PROCFS_H */
|
||||||
|
26
gdb/common/linux-ptrace.c
Normal file
26
gdb/common/linux-ptrace.c
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
/* Linux-specific ptrace manipulation routines.
|
||||||
|
Copyright (C) 2012 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 3 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, see <http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
#ifdef GDBSERVER
|
||||||
|
#include "server.h"
|
||||||
|
#else
|
||||||
|
#include "defs.h"
|
||||||
|
#include "gdb_string.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "linux-ptrace.h"
|
@ -2,7 +2,7 @@
|
|||||||
NAT_FILE= config/nm-linux.h
|
NAT_FILE= config/nm-linux.h
|
||||||
NATDEPFILES= inf-ptrace.o alpha-linux-nat.o \
|
NATDEPFILES= inf-ptrace.o alpha-linux-nat.o \
|
||||||
fork-child.o proc-service.o linux-thread-db.o \
|
fork-child.o proc-service.o linux-thread-db.o \
|
||||||
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o
|
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o
|
||||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||||
|
|
||||||
# The dynamically loaded libthread_db needs access to symbols in the
|
# The dynamically loaded libthread_db needs access to symbols in the
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
NAT_FILE= config/nm-linux.h
|
NAT_FILE= config/nm-linux.h
|
||||||
NATDEPFILES= inf-ptrace.o fork-child.o arm-linux-nat.o \
|
NATDEPFILES= inf-ptrace.o fork-child.o arm-linux-nat.o \
|
||||||
proc-service.o linux-thread-db.o \
|
proc-service.o linux-thread-db.o \
|
||||||
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o
|
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o
|
||||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||||
|
|
||||||
LOADLIBES= -ldl $(RDYNAMIC)
|
LOADLIBES= -ldl $(RDYNAMIC)
|
||||||
|
@ -4,7 +4,7 @@ NAT_FILE= config/nm-linux.h
|
|||||||
NATDEPFILES= inf-ptrace.o fork-child.o \
|
NATDEPFILES= inf-ptrace.o fork-child.o \
|
||||||
i386-nat.o i386-linux-nat.o \
|
i386-nat.o i386-linux-nat.o \
|
||||||
proc-service.o linux-thread-db.o \
|
proc-service.o linux-thread-db.o \
|
||||||
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o
|
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o
|
||||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||||
|
|
||||||
# The dynamically loaded libthread_db needs access to symbols in the
|
# The dynamically loaded libthread_db needs access to symbols in the
|
||||||
|
@ -3,7 +3,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
|
|||||||
i386-nat.o amd64-nat.o amd64-linux-nat.o \
|
i386-nat.o amd64-nat.o amd64-linux-nat.o \
|
||||||
linux-nat.o linux-osdata.o \
|
linux-nat.o linux-osdata.o \
|
||||||
proc-service.o linux-thread-db.o linux-fork.o \
|
proc-service.o linux-thread-db.o linux-fork.o \
|
||||||
linux-procfs.o
|
linux-procfs.o linux-ptrace.o
|
||||||
NAT_FILE= config/nm-linux.h
|
NAT_FILE= config/nm-linux.h
|
||||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
|
|||||||
core-regset.o ia64-linux-nat.o \
|
core-regset.o ia64-linux-nat.o \
|
||||||
proc-service.o linux-thread-db.o \
|
proc-service.o linux-thread-db.o \
|
||||||
linux-nat.o linux-osdata.o linux-fork.o \
|
linux-nat.o linux-osdata.o linux-fork.o \
|
||||||
linux-procfs.o
|
linux-procfs.o linux-ptrace.o
|
||||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||||
|
|
||||||
LOADLIBES = -ldl $(RDYNAMIC)
|
LOADLIBES = -ldl $(RDYNAMIC)
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
NAT_FILE= config/nm-linux.h
|
NAT_FILE= config/nm-linux.h
|
||||||
NATDEPFILES= inf-ptrace.o fork-child.o \
|
NATDEPFILES= inf-ptrace.o fork-child.o \
|
||||||
m32r-linux-nat.o proc-service.o linux-thread-db.o \
|
m32r-linux-nat.o proc-service.o linux-thread-db.o \
|
||||||
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o
|
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o
|
||||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||||
|
|
||||||
LOADLIBES= -ldl $(RDYNAMIC)
|
LOADLIBES= -ldl $(RDYNAMIC)
|
||||||
|
@ -4,7 +4,7 @@ NAT_FILE= config/nm-linux.h
|
|||||||
NATDEPFILES= inf-ptrace.o fork-child.o \
|
NATDEPFILES= inf-ptrace.o fork-child.o \
|
||||||
m68klinux-nat.o \
|
m68klinux-nat.o \
|
||||||
proc-service.o linux-thread-db.o \
|
proc-service.o linux-thread-db.o \
|
||||||
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o
|
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o
|
||||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||||
|
|
||||||
# The dynamically loaded libthread_db needs access to symbols in the
|
# The dynamically loaded libthread_db needs access to symbols in the
|
||||||
|
@ -3,7 +3,7 @@ NAT_FILE= config/nm-linux.h
|
|||||||
NATDEPFILES= inf-ptrace.o fork-child.o mips-linux-nat.o \
|
NATDEPFILES= inf-ptrace.o fork-child.o mips-linux-nat.o \
|
||||||
linux-thread-db.o proc-service.o \
|
linux-thread-db.o proc-service.o \
|
||||||
linux-nat.o linux-osdata.o linux-fork.o \
|
linux-nat.o linux-osdata.o linux-fork.o \
|
||||||
linux-procfs.o
|
linux-procfs.o linux-ptrace.o
|
||||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||||
|
|
||||||
LOADLIBES = -ldl $(RDYNAMIC)
|
LOADLIBES = -ldl $(RDYNAMIC)
|
||||||
|
@ -3,7 +3,7 @@ NAT_FILE= config/nm-linux.h
|
|||||||
NATDEPFILES= inf-ptrace.o fork-child.o \
|
NATDEPFILES= inf-ptrace.o fork-child.o \
|
||||||
hppa-linux-nat.o proc-service.o linux-thread-db.o \
|
hppa-linux-nat.o proc-service.o linux-thread-db.o \
|
||||||
linux-nat.o linux-osdata.o linux-fork.o \
|
linux-nat.o linux-osdata.o linux-fork.o \
|
||||||
linux-procfs.o
|
linux-procfs.o linux-ptrace.o
|
||||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||||
|
|
||||||
LOADLIBES = -ldl $(RDYNAMIC)
|
LOADLIBES = -ldl $(RDYNAMIC)
|
||||||
|
@ -5,7 +5,7 @@ XM_CLIBS=
|
|||||||
NAT_FILE= config/nm-linux.h
|
NAT_FILE= config/nm-linux.h
|
||||||
NATDEPFILES= inf-ptrace.o fork-child.o \
|
NATDEPFILES= inf-ptrace.o fork-child.o \
|
||||||
ppc-linux-nat.o proc-service.o linux-thread-db.o \
|
ppc-linux-nat.o proc-service.o linux-thread-db.o \
|
||||||
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o
|
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o
|
||||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||||
|
|
||||||
LOADLIBES = -ldl $(RDYNAMIC)
|
LOADLIBES = -ldl $(RDYNAMIC)
|
||||||
|
@ -5,7 +5,7 @@ XM_CLIBS=
|
|||||||
NAT_FILE= config/nm-linux.h
|
NAT_FILE= config/nm-linux.h
|
||||||
NATDEPFILES= inf-ptrace.o fork-child.o \
|
NATDEPFILES= inf-ptrace.o fork-child.o \
|
||||||
ppc-linux-nat.o proc-service.o linux-thread-db.o \
|
ppc-linux-nat.o proc-service.o linux-thread-db.o \
|
||||||
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o
|
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o
|
||||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||||
|
|
||||||
# The PowerPC has severe limitations on TOC size, and uses them even
|
# The PowerPC has severe limitations on TOC size, and uses them even
|
||||||
|
@ -4,5 +4,5 @@
|
|||||||
# PPU side of the Cell BE and debugging the SPU side.
|
# PPU side of the Cell BE and debugging the SPU side.
|
||||||
|
|
||||||
NATDEPFILES = spu-linux-nat.o fork-child.o inf-ptrace.o \
|
NATDEPFILES = spu-linux-nat.o fork-child.o inf-ptrace.o \
|
||||||
linux-procfs.o
|
linux-procfs.o linux-ptrace.o
|
||||||
|
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
NAT_FILE= config/nm-linux.h
|
NAT_FILE= config/nm-linux.h
|
||||||
NATDEPFILES= inf-ptrace.o fork-child.o s390-nat.o \
|
NATDEPFILES= inf-ptrace.o fork-child.o s390-nat.o \
|
||||||
linux-thread-db.o proc-service.o \
|
linux-thread-db.o proc-service.o \
|
||||||
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o
|
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o
|
||||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||||
LOADLIBES = -ldl $(RDYNAMIC)
|
LOADLIBES = -ldl $(RDYNAMIC)
|
||||||
|
@ -4,7 +4,7 @@ NATDEPFILES= sparc-nat.o sparc-linux-nat.o \
|
|||||||
core-regset.o fork-child.o inf-ptrace.o \
|
core-regset.o fork-child.o inf-ptrace.o \
|
||||||
proc-service.o linux-thread-db.o \
|
proc-service.o linux-thread-db.o \
|
||||||
linux-nat.o linux-osdata.o linux-fork.o \
|
linux-nat.o linux-osdata.o linux-fork.o \
|
||||||
linux-procfs.o
|
linux-procfs.o linux-ptrace.o
|
||||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||||
|
|
||||||
# The dynamically loaded libthread_db needs access to symbols in the
|
# The dynamically loaded libthread_db needs access to symbols in the
|
||||||
|
@ -5,7 +5,7 @@ NATDEPFILES= sparc-nat.o sparc64-nat.o sparc64-linux-nat.o \
|
|||||||
fork-child.o inf-ptrace.o \
|
fork-child.o inf-ptrace.o \
|
||||||
proc-service.o linux-thread-db.o \
|
proc-service.o linux-thread-db.o \
|
||||||
linux-nat.o linux-osdata.o linux-fork.o \
|
linux-nat.o linux-osdata.o linux-fork.o \
|
||||||
linux-procfs.o
|
linux-procfs.o linux-ptrace.o
|
||||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||||
|
|
||||||
# The dynamically loaded libthread_db needs access to symbols in the
|
# The dynamically loaded libthread_db needs access to symbols in the
|
||||||
|
@ -4,7 +4,7 @@ NAT_FILE= config/nm-linux.h
|
|||||||
|
|
||||||
NATDEPFILES= inf-ptrace.o fork-child.o xtensa-linux-nat.o \
|
NATDEPFILES= inf-ptrace.o fork-child.o xtensa-linux-nat.o \
|
||||||
linux-thread-db.o proc-service.o \
|
linux-thread-db.o proc-service.o \
|
||||||
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o
|
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o
|
||||||
NAT_CDEPS = $(srcdir)/proc-service.list
|
NAT_CDEPS = $(srcdir)/proc-service.list
|
||||||
|
|
||||||
LOADLIBES = -ldl $(RDYNAMIC)
|
LOADLIBES = -ldl $(RDYNAMIC)
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
|
2012-03-13 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
* Makefile.in (linux-ptrace.o): New.
|
||||||
|
* configure.srv (arm*-*-linux*, bfin-*-*linux*, crisv32-*-linux*)
|
||||||
|
(cris-*-linux*, i[34567]86-*-linux*, ia64-*-linux*, m32r*-*-linux*)
|
||||||
|
(m68*-*-linux*, m68*-*-uclinux*, mips*-*-linux*, powerpc*-*-linux*)
|
||||||
|
(s390*-*-linux*, sh*-*-linux*, sparc*-*-linux*, tic6x-*-uclinux)
|
||||||
|
(x86_64-*-linux*, xtensa*-*-linux*): Add linux-ptrace.o to SRV_TGTOBJ
|
||||||
|
of these targets.
|
||||||
|
* linux-low.c (linux_attach_lwp_1): Remove redundent else clause.
|
||||||
|
|
||||||
2012-03-08 Yao Qi <yao@codesourcery.com>
|
2012-03-08 Yao Qi <yao@codesourcery.com>
|
||||||
Pedro Alves <palves@redhat.com>
|
Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
|
@ -415,6 +415,9 @@ signals.o: ../common/signals.c $(server_h) $(signals_def)
|
|||||||
linux-procfs.o: ../common/linux-procfs.c $(server_h)
|
linux-procfs.o: ../common/linux-procfs.c $(server_h)
|
||||||
$(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
|
$(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
|
||||||
|
|
||||||
|
linux-ptrace.o: ../common/linux-ptrace.c $(server_h)
|
||||||
|
$(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
|
||||||
|
|
||||||
common-utils.o: ../common/common-utils.c $(server_h)
|
common-utils.o: ../common/common-utils.c $(server_h)
|
||||||
$(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
|
$(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@ case "${target}" in
|
|||||||
srv_regobj="${srv_regobj} arm-with-vfpv3.o"
|
srv_regobj="${srv_regobj} arm-with-vfpv3.o"
|
||||||
srv_regobj="${srv_regobj} arm-with-neon.o"
|
srv_regobj="${srv_regobj} arm-with-neon.o"
|
||||||
srv_tgtobj="linux-low.o linux-osdata.o linux-arm-low.o linux-procfs.o"
|
srv_tgtobj="linux-low.o linux-osdata.o linux-arm-low.o linux-procfs.o"
|
||||||
|
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
|
||||||
srv_xmlfiles="arm-with-iwmmxt.xml"
|
srv_xmlfiles="arm-with-iwmmxt.xml"
|
||||||
srv_xmlfiles="${srv_xmlfiles} arm-with-vfpv2.xml"
|
srv_xmlfiles="${srv_xmlfiles} arm-with-vfpv2.xml"
|
||||||
srv_xmlfiles="${srv_xmlfiles} arm-with-vfpv3.xml"
|
srv_xmlfiles="${srv_xmlfiles} arm-with-vfpv3.xml"
|
||||||
@ -69,16 +70,19 @@ case "${target}" in
|
|||||||
;;
|
;;
|
||||||
bfin-*-*linux*) srv_regobj=reg-bfin.o
|
bfin-*-*linux*) srv_regobj=reg-bfin.o
|
||||||
srv_tgtobj="linux-low.o linux-osdata.o linux-bfin-low.o linux-procfs.o"
|
srv_tgtobj="linux-low.o linux-osdata.o linux-bfin-low.o linux-procfs.o"
|
||||||
|
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
|
||||||
srv_linux_usrregs=yes
|
srv_linux_usrregs=yes
|
||||||
srv_linux_thread_db=yes
|
srv_linux_thread_db=yes
|
||||||
;;
|
;;
|
||||||
crisv32-*-linux*) srv_regobj=reg-crisv32.o
|
crisv32-*-linux*) srv_regobj=reg-crisv32.o
|
||||||
srv_tgtobj="linux-low.o linux-osdata.o linux-crisv32-low.o linux-procfs.o"
|
srv_tgtobj="linux-low.o linux-osdata.o linux-crisv32-low.o linux-procfs.o"
|
||||||
|
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
|
||||||
srv_linux_regsets=yes
|
srv_linux_regsets=yes
|
||||||
srv_linux_thread_db=yes
|
srv_linux_thread_db=yes
|
||||||
;;
|
;;
|
||||||
cris-*-linux*) srv_regobj=reg-cris.o
|
cris-*-linux*) srv_regobj=reg-cris.o
|
||||||
srv_tgtobj="linux-low.o linux-osdata.o linux-cris-low.o linux-procfs.o"
|
srv_tgtobj="linux-low.o linux-osdata.o linux-cris-low.o linux-procfs.o"
|
||||||
|
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
|
||||||
srv_linux_usrregs=yes
|
srv_linux_usrregs=yes
|
||||||
srv_linux_thread_db=yes
|
srv_linux_thread_db=yes
|
||||||
;;
|
;;
|
||||||
@ -93,6 +97,7 @@ case "${target}" in
|
|||||||
srv_xmlfiles="${srv_xmlfiles} $srv_amd64_linux_xmlfiles"
|
srv_xmlfiles="${srv_xmlfiles} $srv_amd64_linux_xmlfiles"
|
||||||
fi
|
fi
|
||||||
srv_tgtobj="linux-low.o linux-osdata.o linux-x86-low.o i386-low.o i387-fp.o linux-procfs.o"
|
srv_tgtobj="linux-low.o linux-osdata.o linux-x86-low.o i386-low.o i387-fp.o linux-procfs.o"
|
||||||
|
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
|
||||||
srv_linux_usrregs=yes
|
srv_linux_usrregs=yes
|
||||||
srv_linux_regsets=yes
|
srv_linux_regsets=yes
|
||||||
srv_linux_thread_db=yes
|
srv_linux_thread_db=yes
|
||||||
@ -124,10 +129,12 @@ case "${target}" in
|
|||||||
;;
|
;;
|
||||||
ia64-*-linux*) srv_regobj=reg-ia64.o
|
ia64-*-linux*) srv_regobj=reg-ia64.o
|
||||||
srv_tgtobj="linux-low.o linux-osdata.o linux-ia64-low.o linux-procfs.o"
|
srv_tgtobj="linux-low.o linux-osdata.o linux-ia64-low.o linux-procfs.o"
|
||||||
|
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
|
||||||
srv_linux_usrregs=yes
|
srv_linux_usrregs=yes
|
||||||
;;
|
;;
|
||||||
m32r*-*-linux*) srv_regobj=reg-m32r.o
|
m32r*-*-linux*) srv_regobj=reg-m32r.o
|
||||||
srv_tgtobj="linux-low.o linux-osdata.o linux-m32r-low.o linux-procfs.o"
|
srv_tgtobj="linux-low.o linux-osdata.o linux-m32r-low.o linux-procfs.o"
|
||||||
|
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
|
||||||
srv_linux_usrregs=yes
|
srv_linux_usrregs=yes
|
||||||
srv_linux_thread_db=yes
|
srv_linux_thread_db=yes
|
||||||
;;
|
;;
|
||||||
@ -137,6 +144,7 @@ case "${target}" in
|
|||||||
srv_regobj=reg-m68k.o
|
srv_regobj=reg-m68k.o
|
||||||
fi
|
fi
|
||||||
srv_tgtobj="linux-low.o linux-osdata.o linux-m68k-low.o linux-procfs.o"
|
srv_tgtobj="linux-low.o linux-osdata.o linux-m68k-low.o linux-procfs.o"
|
||||||
|
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
|
||||||
srv_linux_usrregs=yes
|
srv_linux_usrregs=yes
|
||||||
srv_linux_regsets=yes
|
srv_linux_regsets=yes
|
||||||
srv_linux_thread_db=yes
|
srv_linux_thread_db=yes
|
||||||
@ -147,6 +155,7 @@ case "${target}" in
|
|||||||
srv_regobj=reg-m68k.o
|
srv_regobj=reg-m68k.o
|
||||||
fi
|
fi
|
||||||
srv_tgtobj="linux-low.o linux-osdata.o linux-m68k-low.o linux-procfs.o"
|
srv_tgtobj="linux-low.o linux-osdata.o linux-m68k-low.o linux-procfs.o"
|
||||||
|
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
|
||||||
srv_linux_usrregs=yes
|
srv_linux_usrregs=yes
|
||||||
srv_linux_regsets=yes
|
srv_linux_regsets=yes
|
||||||
srv_linux_thread_db=yes
|
srv_linux_thread_db=yes
|
||||||
@ -156,6 +165,7 @@ case "${target}" in
|
|||||||
srv_regobj="${srv_regobj} mips64-linux.o"
|
srv_regobj="${srv_regobj} mips64-linux.o"
|
||||||
srv_regobj="${srv_regobj} mips64-dsp-linux.o"
|
srv_regobj="${srv_regobj} mips64-dsp-linux.o"
|
||||||
srv_tgtobj="linux-low.o linux-osdata.o linux-mips-low.o linux-procfs.o"
|
srv_tgtobj="linux-low.o linux-osdata.o linux-mips-low.o linux-procfs.o"
|
||||||
|
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
|
||||||
srv_xmlfiles="mips-linux.xml"
|
srv_xmlfiles="mips-linux.xml"
|
||||||
srv_xmlfiles="${srv_xmlfiles} mips-dsp-linux.xml"
|
srv_xmlfiles="${srv_xmlfiles} mips-dsp-linux.xml"
|
||||||
srv_xmlfiles="${srv_xmlfiles} mips-cpu.xml"
|
srv_xmlfiles="${srv_xmlfiles} mips-cpu.xml"
|
||||||
@ -188,6 +198,7 @@ case "${target}" in
|
|||||||
srv_regobj="${srv_regobj} powerpc-isa205-altivec64l.o"
|
srv_regobj="${srv_regobj} powerpc-isa205-altivec64l.o"
|
||||||
srv_regobj="${srv_regobj} powerpc-isa205-vsx64l.o"
|
srv_regobj="${srv_regobj} powerpc-isa205-vsx64l.o"
|
||||||
srv_tgtobj="linux-low.o linux-osdata.o linux-ppc-low.o linux-procfs.o"
|
srv_tgtobj="linux-low.o linux-osdata.o linux-ppc-low.o linux-procfs.o"
|
||||||
|
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
|
||||||
srv_xmlfiles="rs6000/powerpc-32l.xml"
|
srv_xmlfiles="rs6000/powerpc-32l.xml"
|
||||||
srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-altivec32l.xml"
|
srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-altivec32l.xml"
|
||||||
srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-cell32l.xml"
|
srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-cell32l.xml"
|
||||||
@ -230,6 +241,7 @@ case "${target}" in
|
|||||||
srv_regobj="${srv_regobj} s390x-linux64v1.o"
|
srv_regobj="${srv_regobj} s390x-linux64v1.o"
|
||||||
srv_regobj="${srv_regobj} s390x-linux64v2.o"
|
srv_regobj="${srv_regobj} s390x-linux64v2.o"
|
||||||
srv_tgtobj="linux-low.o linux-osdata.o linux-s390-low.o linux-procfs.o"
|
srv_tgtobj="linux-low.o linux-osdata.o linux-s390-low.o linux-procfs.o"
|
||||||
|
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
|
||||||
srv_xmlfiles="s390-linux32.xml"
|
srv_xmlfiles="s390-linux32.xml"
|
||||||
srv_xmlfiles="${srv_xmlfiles} s390-linux32v1.xml"
|
srv_xmlfiles="${srv_xmlfiles} s390-linux32v1.xml"
|
||||||
srv_xmlfiles="${srv_xmlfiles} s390-linux32v2.xml"
|
srv_xmlfiles="${srv_xmlfiles} s390-linux32v2.xml"
|
||||||
@ -250,12 +262,14 @@ case "${target}" in
|
|||||||
;;
|
;;
|
||||||
sh*-*-linux*) srv_regobj=reg-sh.o
|
sh*-*-linux*) srv_regobj=reg-sh.o
|
||||||
srv_tgtobj="linux-low.o linux-osdata.o linux-sh-low.o linux-procfs.o"
|
srv_tgtobj="linux-low.o linux-osdata.o linux-sh-low.o linux-procfs.o"
|
||||||
|
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
|
||||||
srv_linux_usrregs=yes
|
srv_linux_usrregs=yes
|
||||||
srv_linux_regsets=yes
|
srv_linux_regsets=yes
|
||||||
srv_linux_thread_db=yes
|
srv_linux_thread_db=yes
|
||||||
;;
|
;;
|
||||||
sparc*-*-linux*) srv_regobj=reg-sparc64.o
|
sparc*-*-linux*) srv_regobj=reg-sparc64.o
|
||||||
srv_tgtobj="linux-low.o linux-osdata.o linux-sparc-low.o linux-procfs.o"
|
srv_tgtobj="linux-low.o linux-osdata.o linux-sparc-low.o linux-procfs.o"
|
||||||
|
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
|
||||||
srv_linux_regsets=yes
|
srv_linux_regsets=yes
|
||||||
srv_linux_thread_db=yes
|
srv_linux_thread_db=yes
|
||||||
;;
|
;;
|
||||||
@ -272,12 +286,14 @@ case "${target}" in
|
|||||||
srv_xmlfiles="${srv_xmlfiles} tic6x-gp.xml"
|
srv_xmlfiles="${srv_xmlfiles} tic6x-gp.xml"
|
||||||
srv_xmlfiles="${srv_xmlfiles} tic6x-c6xp.xml"
|
srv_xmlfiles="${srv_xmlfiles} tic6x-c6xp.xml"
|
||||||
srv_tgtobj="linux-low.o linux-osdata.o linux-tic6x-low.o linux-procfs.o"
|
srv_tgtobj="linux-low.o linux-osdata.o linux-tic6x-low.o linux-procfs.o"
|
||||||
|
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
|
||||||
srv_linux_regsets=yes
|
srv_linux_regsets=yes
|
||||||
srv_linux_usrregs=yes
|
srv_linux_usrregs=yes
|
||||||
srv_linux_thread_db=yes
|
srv_linux_thread_db=yes
|
||||||
;;
|
;;
|
||||||
x86_64-*-linux*) srv_regobj="$srv_amd64_linux_regobj $srv_i386_linux_regobj"
|
x86_64-*-linux*) srv_regobj="$srv_amd64_linux_regobj $srv_i386_linux_regobj"
|
||||||
srv_tgtobj="linux-low.o linux-osdata.o linux-x86-low.o i386-low.o i387-fp.o linux-procfs.o"
|
srv_tgtobj="linux-low.o linux-osdata.o linux-x86-low.o i386-low.o i387-fp.o linux-procfs.o"
|
||||||
|
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
|
||||||
srv_xmlfiles="$srv_i386_linux_xmlfiles $srv_amd64_linux_xmlfiles"
|
srv_xmlfiles="$srv_i386_linux_xmlfiles $srv_amd64_linux_xmlfiles"
|
||||||
srv_linux_usrregs=yes # This is for i386 progs.
|
srv_linux_usrregs=yes # This is for i386 progs.
|
||||||
srv_linux_regsets=yes
|
srv_linux_regsets=yes
|
||||||
@ -292,6 +308,7 @@ case "${target}" in
|
|||||||
|
|
||||||
xtensa*-*-linux*) srv_regobj=reg-xtensa.o
|
xtensa*-*-linux*) srv_regobj=reg-xtensa.o
|
||||||
srv_tgtobj="linux-low.o linux-osdata.o linux-xtensa-low.o linux-procfs.o"
|
srv_tgtobj="linux-low.o linux-osdata.o linux-xtensa-low.o linux-procfs.o"
|
||||||
|
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
|
||||||
srv_linux_regsets=yes
|
srv_linux_regsets=yes
|
||||||
;;
|
;;
|
||||||
*) echo "Error: target not supported by gdbserver."
|
*) echo "Error: target not supported by gdbserver."
|
||||||
|
@ -660,7 +660,7 @@ linux_attach_lwp_1 (unsigned long lwpid, int initial)
|
|||||||
fflush (stderr);
|
fflush (stderr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
/* If we fail to attach to a process, report an error. */
|
/* If we fail to attach to a process, report an error. */
|
||||||
error ("Cannot attach to lwp %ld: %s (%d)\n", lwpid,
|
error ("Cannot attach to lwp %ld: %s (%d)\n", lwpid,
|
||||||
strerror (errno), errno);
|
strerror (errno), errno);
|
||||||
|
@ -2465,37 +2465,6 @@ linux_handle_extended_wait (struct lwp_info *lp, int status,
|
|||||||
_("unknown ptrace event %d"), event);
|
_("unknown ptrace event %d"), event);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return non-zero if LWP is a zombie. */
|
|
||||||
|
|
||||||
static int
|
|
||||||
linux_lwp_is_zombie (long lwp)
|
|
||||||
{
|
|
||||||
char buffer[MAXPATHLEN];
|
|
||||||
FILE *procfile;
|
|
||||||
int retval;
|
|
||||||
int have_state;
|
|
||||||
|
|
||||||
xsnprintf (buffer, sizeof (buffer), "/proc/%ld/status", lwp);
|
|
||||||
procfile = fopen (buffer, "r");
|
|
||||||
if (procfile == NULL)
|
|
||||||
{
|
|
||||||
warning (_("unable to open /proc file '%s'"), buffer);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
have_state = 0;
|
|
||||||
while (fgets (buffer, sizeof (buffer), procfile) != NULL)
|
|
||||||
if (strncmp (buffer, "State:", 6) == 0)
|
|
||||||
{
|
|
||||||
have_state = 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
retval = (have_state
|
|
||||||
&& strcmp (buffer, "State:\tZ (zombie)\n") == 0);
|
|
||||||
fclose (procfile);
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Wait for LP to stop. Returns the wait status, or 0 if the LWP has
|
/* Wait for LP to stop. Returns the wait status, or 0 if the LWP has
|
||||||
exited. */
|
exited. */
|
||||||
|
|
||||||
@ -2549,10 +2518,10 @@ wait_lwp (struct lwp_info *lp)
|
|||||||
|
|
||||||
This is racy, what if the tgl becomes a zombie right after we check?
|
This is racy, what if the tgl becomes a zombie right after we check?
|
||||||
Therefore always use WNOHANG with sigsuspend - it is equivalent to
|
Therefore always use WNOHANG with sigsuspend - it is equivalent to
|
||||||
waiting waitpid but the linux_lwp_is_zombie is safe this way. */
|
waiting waitpid but linux_proc_pid_is_zombie is safe this way. */
|
||||||
|
|
||||||
if (GET_PID (lp->ptid) == GET_LWP (lp->ptid)
|
if (GET_PID (lp->ptid) == GET_LWP (lp->ptid)
|
||||||
&& linux_lwp_is_zombie (GET_LWP (lp->ptid)))
|
&& linux_proc_pid_is_zombie (GET_LWP (lp->ptid)))
|
||||||
{
|
{
|
||||||
thread_dead = 1;
|
thread_dead = 1;
|
||||||
if (debug_linux_nat)
|
if (debug_linux_nat)
|
||||||
@ -3499,7 +3468,7 @@ check_zombie_leaders (void)
|
|||||||
/* Check if there are other threads in the group, as we may
|
/* Check if there are other threads in the group, as we may
|
||||||
have raced with the inferior simply exiting. */
|
have raced with the inferior simply exiting. */
|
||||||
&& num_lwps (inf->pid) > 1
|
&& num_lwps (inf->pid) > 1
|
||||||
&& linux_lwp_is_zombie (inf->pid))
|
&& linux_proc_pid_is_zombie (inf->pid))
|
||||||
{
|
{
|
||||||
if (debug_linux_nat)
|
if (debug_linux_nat)
|
||||||
fprintf_unfiltered (gdb_stdlog,
|
fprintf_unfiltered (gdb_stdlog,
|
||||||
|
Loading…
Reference in New Issue
Block a user