Rebase to FSF GDB 7.9.50.20150531 (pre-7.10 trunk snapshot).

This commit is contained in:
Jan Kratochvil 2015-05-31 20:47:21 +02:00
commit 32f92b2e34
32 changed files with 1228 additions and 2609 deletions

View file

@ -37,10 +37,10 @@ gdb/gdbserver/
(linux_create_inferior, linux_tracefork_child): Call it instead of
direct ptrace.
Index: gdb-7.8.90.20150125/gdb/nat/linux-ptrace.c
Index: gdb-7.9.50.20150520/gdb/nat/linux-ptrace.c
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/nat/linux-ptrace.c 2015-01-25 08:36:55.710884511 +0100
+++ gdb-7.8.90.20150125/gdb/nat/linux-ptrace.c 2015-01-25 08:38:43.157347627 +0100
--- gdb-7.9.50.20150520.orig/gdb/nat/linux-ptrace.c 2015-05-31 18:16:54.348890746 +0200
+++ gdb-7.9.50.20150520/gdb/nat/linux-ptrace.c 2015-05-31 18:17:19.584046540 +0200
@@ -25,6 +25,10 @@
#include <stdint.h>
@ -49,10 +49,10 @@ Index: gdb-7.8.90.20150125/gdb/nat/linux-ptrace.c
+# include <selinux/selinux.h>
+#endif /* HAVE_SELINUX_SELINUX_H */
+
/* Stores the currently supported ptrace options. A value of
-1 means we did not check for features yet. A value of 0 means
there are no supported features. */
@@ -53,6 +57,8 @@ linux_ptrace_attach_fail_reason (pid_t p
/* Stores the ptrace options supported by the running kernel.
A value of -1 means we did not check for features yet. A value
of 0 means there are no supported features. */
@@ -49,6 +53,8 @@ linux_ptrace_attach_fail_reason (pid_t p
buffer_xml_printf (buffer, _("process %d is a zombie "
"- the process has already terminated"),
(int) pid);
@ -61,7 +61,7 @@ Index: gdb-7.8.90.20150125/gdb/nat/linux-ptrace.c
}
/* See linux-ptrace.h. */
@@ -595,6 +601,22 @@ linux_ptrace_init_warnings (void)
@@ -583,6 +589,22 @@ linux_ptrace_init_warnings (void)
linux_ptrace_test_ret_to_nx ();
}
@ -81,26 +81,26 @@ Index: gdb-7.8.90.20150125/gdb/nat/linux-ptrace.c
+#endif /* HAVE_LIBSELINUX */
+}
+
/* Set additional ptrace flags to use. Some such flags may be checked
by the implementation above. This function must be called before
any other function in this file; otherwise the flags may not take
Index: gdb-7.8.90.20150125/gdb/nat/linux-ptrace.h
/* Extract extended ptrace event from wait status. */
int
Index: gdb-7.9.50.20150520/gdb/nat/linux-ptrace.h
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/nat/linux-ptrace.h 2015-01-25 08:37:02.800915071 +0100
+++ gdb-7.8.90.20150125/gdb/nat/linux-ptrace.h 2015-01-25 08:38:16.565233009 +0100
@@ -98,6 +98,7 @@ extern void linux_ptrace_attach_fail_rea
--- gdb-7.9.50.20150520.orig/gdb/nat/linux-ptrace.h 2015-05-31 18:16:54.348890746 +0200
+++ gdb-7.9.50.20150520/gdb/nat/linux-ptrace.h 2015-05-31 18:17:19.584046540 +0200
@@ -149,6 +149,7 @@ extern void linux_ptrace_attach_fail_rea
extern char *linux_ptrace_attach_fail_reason_string (ptid_t ptid, int err);
extern void linux_ptrace_init_warnings (void);
+extern void linux_ptrace_create_warnings (struct buffer *buffer);
extern void linux_check_ptrace_features (void);
extern void linux_enable_event_reporting (pid_t pid, int attached);
extern void linux_disable_event_reporting (pid_t pid);
extern int linux_supports_tracefork (void);
Index: gdb-7.8.90.20150125/gdb/configure.ac
Index: gdb-7.9.50.20150520/gdb/configure.ac
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/configure.ac 2015-01-25 08:36:55.712884520 +0100
+++ gdb-7.8.90.20150125/gdb/configure.ac 2015-01-25 08:37:02.801915075 +0100
@@ -2117,6 +2117,10 @@ case $host_os in
--- gdb-7.9.50.20150520.orig/gdb/configure.ac 2015-05-31 18:16:54.348890746 +0200
+++ gdb-7.9.50.20150520/gdb/configure.ac 2015-05-31 18:17:19.585046546 +0200
@@ -2130,6 +2130,10 @@ case $host_os in
esac
AC_DEFINE_UNQUOTED(GDBINIT,"$gdbinit",[The .gdbinit filename.])
@ -111,11 +111,11 @@ Index: gdb-7.8.90.20150125/gdb/configure.ac
dnl Handle optional features that can be enabled.
# Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
Index: gdb-7.8.90.20150125/gdb/gdbserver/configure.ac
Index: gdb-7.9.50.20150520/gdb/gdbserver/configure.ac
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/gdbserver/configure.ac 2015-01-25 08:36:55.712884520 +0100
+++ gdb-7.8.90.20150125/gdb/gdbserver/configure.ac 2015-01-25 08:37:02.801915075 +0100
@@ -461,6 +461,10 @@ if $want_ipa ; then
--- gdb-7.9.50.20150520.orig/gdb/gdbserver/configure.ac 2015-05-31 18:16:54.348890746 +0200
+++ gdb-7.9.50.20150520/gdb/gdbserver/configure.ac 2015-05-31 18:17:19.585046546 +0200
@@ -499,6 +499,10 @@ if $want_ipa ; then
fi
fi
@ -126,11 +126,11 @@ Index: gdb-7.8.90.20150125/gdb/gdbserver/configure.ac
AC_SUBST(GDBSERVER_DEPFILES)
AC_SUBST(GDBSERVER_LIBS)
AC_SUBST(srv_xmlbuiltin)
Index: gdb-7.8.90.20150125/gdb/gdbserver/linux-low.c
Index: gdb-7.9.50.20150520/gdb/gdbserver/linux-low.c
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/gdbserver/linux-low.c 2015-01-25 08:36:55.714884529 +0100
+++ gdb-7.8.90.20150125/gdb/gdbserver/linux-low.c 2015-01-25 08:37:02.803915084 +0100
@@ -591,6 +591,29 @@ add_lwp (ptid_t ptid)
--- gdb-7.9.50.20150520.orig/gdb/gdbserver/linux-low.c 2015-05-31 18:16:54.348890746 +0200
+++ gdb-7.9.50.20150520/gdb/gdbserver/linux-low.c 2015-05-31 18:17:19.587046558 +0200
@@ -749,6 +749,29 @@ add_lwp (ptid_t ptid)
return lwp;
}
@ -160,7 +160,7 @@ Index: gdb-7.8.90.20150125/gdb/gdbserver/linux-low.c
/* Start an inferior process and returns its pid.
ALLARGS is a vector of program-name and args. */
@@ -632,7 +655,7 @@ linux_create_inferior (char *program, ch
@@ -772,7 +795,7 @@ linux_create_inferior (char *program, ch
if (pid == 0)
{
close_most_fds ();
@ -169,11 +169,11 @@ Index: gdb-7.8.90.20150125/gdb/gdbserver/linux-low.c
#ifndef __ANDROID__ /* Bionic doesn't use SIGRTMIN the way glibc does. */
signal (__SIGRTMIN + 1, SIG_DFL);
Index: gdb-7.8.90.20150125/gdb/inf-ptrace.c
Index: gdb-7.9.50.20150520/gdb/inf-ptrace.c
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/inf-ptrace.c 2015-01-25 08:36:55.715884533 +0100
+++ gdb-7.8.90.20150125/gdb/inf-ptrace.c 2015-01-25 08:37:02.803915084 +0100
@@ -67,7 +67,15 @@ static void
--- gdb-7.9.50.20150520.orig/gdb/inf-ptrace.c 2015-05-31 18:16:54.348890746 +0200
+++ gdb-7.9.50.20150520/gdb/inf-ptrace.c 2015-05-31 18:17:19.588046565 +0200
@@ -79,7 +79,15 @@ static void
inf_ptrace_me (void)
{
/* "Trace me, Dr. Memory!" */
@ -189,36 +189,28 @@ Index: gdb-7.8.90.20150125/gdb/inf-ptrace.c
}
/* Start a new inferior Unix child process. EXEC_FILE is the file to
Index: gdb-7.8.90.20150125/gdb/linux-nat.c
Index: gdb-7.9.50.20150520/gdb/linux-nat.c
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/linux-nat.c 2015-01-25 08:36:55.717884541 +0100
+++ gdb-7.8.90.20150125/gdb/linux-nat.c 2015-01-25 08:37:52.054127362 +0100
@@ -1109,6 +1109,7 @@ linux_nat_create_inferior (struct target
#ifdef HAVE_PERSONALITY
int personality_orig = 0, personality_set = 0;
#endif /* HAVE_PERSONALITY */
--- gdb-7.9.50.20150520.orig/gdb/linux-nat.c 2015-05-31 18:16:54.348890746 +0200
+++ gdb-7.9.50.20150520/gdb/linux-nat.c 2015-05-31 18:17:56.214272683 +0200
@@ -1179,6 +1179,7 @@ linux_nat_create_inferior (struct target
{
struct cleanup *restore_personality
= maybe_disable_address_space_randomization (disable_randomization);
+ volatile struct gdb_exception ex;
/* The fork_child mechanism is synchronous and calls target_wait, so
we have to mask the async mode. */
@@ -1133,7 +1134,10 @@ linux_nat_create_inferior (struct target
@@ -1186,7 +1187,28 @@ linux_nat_create_inferior (struct target
/* Make sure we report all signals during startup. */
linux_nat_pass_signals (ops, 0, NULL);
- linux_ops->to_create_inferior (ops, exec_file, allargs, env, from_tty);
+ TRY_CATCH (ex, RETURN_MASK_ERROR)
+ TRY
+ {
+ linux_ops->to_create_inferior (ops, exec_file, allargs, env, from_tty);
+ }
#ifdef HAVE_PERSONALITY
if (personality_set)
@@ -1145,6 +1149,24 @@ linux_nat_create_inferior (struct target
safe_strerror (errno));
}
#endif /* HAVE_PERSONALITY */
+
+ if (ex.reason < 0)
+ CATCH (ex, RETURN_MASK_ERROR)
+ {
+ struct buffer buffer;
+ char *message, *buffer_s;
@ -235,14 +227,15 @@ Index: gdb-7.8.90.20150125/gdb/linux-nat.c
+
+ throw_error (ex.error, "%s%s", buffer_s, message);
+ }
}
+ END_CATCH
/* Callback for linux_proc_attach_tgid_threads. Attach to PTID if not
Index: gdb-7.8.90.20150125/gdb/config.in
do_cleanups (restore_personality);
}
Index: gdb-7.9.50.20150520/gdb/config.in
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/config.in 2015-01-25 08:36:55.718884546 +0100
+++ gdb-7.8.90.20150125/gdb/config.in 2015-01-25 08:37:02.805915092 +0100
@@ -213,6 +213,9 @@
--- gdb-7.9.50.20150520.orig/gdb/config.in 2015-05-31 18:16:54.348890746 +0200
+++ gdb-7.9.50.20150520/gdb/config.in 2015-05-31 18:17:19.589046571 +0200
@@ -261,6 +261,9 @@
/* Define if librpm library is being used. */
#undef HAVE_LIBRPM
@ -252,7 +245,7 @@ Index: gdb-7.8.90.20150125/gdb/config.in
/* Define to 1 if you have the <libunwind-ia64.h> header file. */
#undef HAVE_LIBUNWIND_IA64_H
@@ -342,6 +345,9 @@
@@ -393,6 +396,9 @@
/* Define to 1 if you have the `scm_new_smob' function. */
#undef HAVE_SCM_NEW_SMOB
@ -262,11 +255,11 @@ Index: gdb-7.8.90.20150125/gdb/config.in
/* Define to 1 if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
Index: gdb-7.8.90.20150125/gdb/configure
Index: gdb-7.9.50.20150520/gdb/configure
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/configure 2015-01-25 08:36:55.722884563 +0100
+++ gdb-7.8.90.20150125/gdb/configure 2015-01-25 08:37:02.809915110 +0100
@@ -13270,6 +13270,64 @@ cat >>confdefs.h <<_ACEOF
--- gdb-7.9.50.20150520.orig/gdb/configure 2015-05-31 18:16:54.348890746 +0200
+++ gdb-7.9.50.20150520/gdb/configure 2015-05-31 18:17:19.594046602 +0200
@@ -13730,6 +13730,64 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
@ -331,11 +324,11 @@ Index: gdb-7.8.90.20150125/gdb/configure
# Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
# except that the argument to --with-sysroot is optional.
Index: gdb-7.8.90.20150125/gdb/gdbserver/config.in
Index: gdb-7.9.50.20150520/gdb/gdbserver/config.in
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/gdbserver/config.in 2015-01-25 08:36:55.724884572 +0100
+++ gdb-7.8.90.20150125/gdb/gdbserver/config.in 2015-01-25 08:37:02.809915110 +0100
@@ -75,6 +75,9 @@
--- gdb-7.9.50.20150520.orig/gdb/gdbserver/config.in 2015-05-31 18:16:54.348890746 +0200
+++ gdb-7.9.50.20150520/gdb/gdbserver/config.in 2015-05-31 18:17:19.594046602 +0200
@@ -113,6 +113,9 @@
/* Define to 1 if you have the `mcheck' library (-lmcheck). */
#undef HAVE_LIBMCHECK
@ -345,7 +338,7 @@ Index: gdb-7.8.90.20150125/gdb/gdbserver/config.in
/* Define if the target supports branch tracing. */
#undef HAVE_LINUX_BTRACE
@@ -142,6 +145,9 @@
@@ -186,6 +189,9 @@
/* Define to 1 if you have the `pwrite' function. */
#undef HAVE_PWRITE
@ -355,11 +348,11 @@ Index: gdb-7.8.90.20150125/gdb/gdbserver/config.in
/* Define to 1 if you have the <sgtty.h> header file. */
#undef HAVE_SGTTY_H
Index: gdb-7.8.90.20150125/gdb/gdbserver/configure
Index: gdb-7.9.50.20150520/gdb/gdbserver/configure
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/gdbserver/configure 2015-01-25 08:36:55.726884580 +0100
+++ gdb-7.8.90.20150125/gdb/gdbserver/configure 2015-01-25 08:37:02.811915118 +0100
@@ -6199,6 +6199,64 @@ if $want_ipa ; then
--- gdb-7.9.50.20150520.orig/gdb/gdbserver/configure 2015-05-31 18:16:54.348890746 +0200
+++ gdb-7.9.50.20150520/gdb/gdbserver/configure 2015-05-31 18:17:19.596046614 +0200
@@ -7022,6 +7022,64 @@ if $want_ipa ; then
fi
fi