* common/linux-ptrace.c (linux_ptrace_test_ret_to_nx): Call also kill
for CHILD, ignore PTRACE_KILL errors, move the inner block variable
kill_status to outer block.
The "you have broken" bit of this text reads to me as if I had broken
it myself somehow. This patch eliminates that ambiguity.
2013-02-25 Pedro Alves <palves@redhat.com>
* common/linux-ptrace.c (linux_ptrace_test_ret_to_nx): Change
warning text.
We need to cast the pointer up to 64bits so that the push works on x32
targets. For 64bit targets, this makes no difference.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Two modifications:
1. The addition of 2013 to the copyright year range for every file;
2. The use of a single year range, instead of potentially multiple
year ranges, as approved by the FSF.
ARI fixes: move gdb_wait and gdb_stat headers to common subdirectory.
* gdb_stat.h: Delete. Moved to common directory.
* common/gdb_stat.h: New file.
* gdb_wait.h: Delete. Moved to common directory.
* common/gdb_wait.h: New file.
* Makefile.in (H_FILES_NO_SRC): Adapt to new header
location.
* contrib/ari/gdb_ari.sh (wait.h rule): Adapt to new gdb_wait.h
location.
(stat.h rule): Adapt to new gdb_stat.h location.
* common/linux-osdata.c: Include "gdb_stat.h" header instead of
<sys/stat.h> header.
* common/linux-ptrace.c: Include "gdb_wait.h" header instead of
<sys/wait.h> header.
gdbserver ChangeLog entry:
2012-11-15 Pierre Muller <muller@sourceware.org>
* configure.ac (AC_CHECK_HEADERS): Add wait.h header.
* config.in: Regenerate.
* configure: Regenerate.
* linux-low.c: Use "gdb_stat.h" header instead of <sys/stat.h> header.
Use "gdb_wait.h" header instead of <sys/wait.h> header.
* lynx-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
* remote-utils.c: Use "gdb_stat.h" header instead of <sys/stat.h>
header.
* server.c: Remove HAVE_WAIT_H conditional. Use "gdb_wait.h" header
instead of <sys/wait.h> header.
* spu-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
* common/linux-ptrace.c: Change __i386__ to __i386__ || __x86_64__.
(linux_ptrace_test_ret_to_nx): Extend comment for x86_64. Change
__i386__ to __i386__ || __x86_64__. Extend code also for __x86_64__.
Extend code also for PaX support. Convert all gdb_assert to warning
calls.
* common/linux-procfs.c (linux_proc_get_int): New, from
linux_proc_get_tgid, change its LWPID type to pid_t, add parameter
field.
(linux_proc_get_tgid): Only call linux_proc_get_int.
(linux_proc_get_tracerpid): New.
(linux_proc_pid_has_state): New, from linux_proc_pid_is_zombie.
(linux_proc_pid_is_stopped, linux_proc_pid_is_zombie): Only call
linux_proc_pid_has_state.
* common/linux-procfs.h (linux_proc_get_tracerpid): New declaration.
* common/linux-ptrace.c: Include linux-procfs.h and buffer.h.
(linux_ptrace_attach_warnings): New.
* common/linux-ptrace.h (struct buffer, linux_ptrace_attach_warnings):
New declaration.
* linux-nat.c: Include exceptions.h, linux-ptrace.h and buffer.h.
(linux_nat_attach): New variables ex, buffer, message and message_s.
Wrap to_attach by TRY_CATCH and call linux_ptrace_attach_warnings.
gdb/gdbserver/
* linux-low.c (linux_attach_lwp_1): New variable buffer. Call
linux_ptrace_attach_warnings.
gdb/testsuite/
* gdb.base/attach-twice.c: New files.
* gdb.base/attach-twice.exp: New files.