- Upgrade to the upstream gdb-6.8.50 snapshot.

This commit is contained in:
Jan Kratochvil 2008-12-14 14:05:20 +00:00
commit 407ebe9063
73 changed files with 3708 additions and 10930 deletions

View file

@ -1,5 +1,8 @@
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=216711
FIXME: This workaround should be dropped and
glibc/sysdeps/unix/sysv/linux/x86_64/clone.S should get CFI for the child
instead.
2006-12-17 Jan Kratochvil <jan.kratochvil@redhat.com>
@ -20,10 +23,10 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=216711
Port to GDB-6.7.
Index: gdb-6.7/gdb/amd64-linux-tdep.c
Index: gdb-6.8.50.20081128/gdb/amd64-linux-tdep.c
===================================================================
--- gdb-6.7.orig/gdb/amd64-linux-tdep.c 2007-08-23 20:08:26.000000000 +0200
+++ gdb-6.7/gdb/amd64-linux-tdep.c 2007-10-16 15:57:03.000000000 +0200
--- gdb-6.8.50.20081128.orig/gdb/amd64-linux-tdep.c 2008-12-08 10:56:17.000000000 +0100
+++ gdb-6.8.50.20081128/gdb/amd64-linux-tdep.c 2008-12-08 21:11:08.000000000 +0100
@@ -234,6 +234,80 @@ amd64_linux_register_reggroup_p (struct
/* Set the program counter for process PTID to PC. */
@ -65,12 +68,12 @@ Index: gdb-6.7/gdb/amd64-linux-tdep.c
+#define LINUX_CLONE_LEN (sizeof linux_clone_code)
+
+static int
+amd64_linux_clone_running (struct frame_info *next_frame)
+amd64_linux_clone_running (struct frame_info *this_frame)
+{
+ CORE_ADDR pc = frame_pc_unwind (next_frame);
+ CORE_ADDR pc = get_frame_pc (this_frame);
+ unsigned char buf[LINUX_CLONE_LEN];
+
+ if (!safe_frame_unwind_memory (next_frame, pc - LINUX_CLONE_LEN, buf,
+ if (!safe_frame_unwind_memory (this_frame, pc - LINUX_CLONE_LEN, buf,
+ LINUX_CLONE_LEN))
+ return 0;
+
@ -81,9 +84,9 @@ Index: gdb-6.7/gdb/amd64-linux-tdep.c
+}
+
+static int
+amd64_linux_outermost_frame (struct frame_info *next_frame)
+amd64_linux_outermost_frame (struct frame_info *this_frame)
+{
+ CORE_ADDR pc = frame_pc_unwind (next_frame);
+ CORE_ADDR pc = get_frame_pc (this_frame);
+ char *name;
+
+ find_pc_partial_function (pc, &name, NULL, NULL);
@ -97,7 +100,7 @@ Index: gdb-6.7/gdb/amd64-linux-tdep.c
+ subtle changes in specific glibc revisions. */
+ if (name == NULL || strcmp (name, "clone") == 0
+ || strcmp ("__clone", name) == 0)
+ return (amd64_linux_clone_running (next_frame) != 0);
+ return (amd64_linux_clone_running (this_frame) != 0);
+
+ return 0;
+}
@ -114,32 +117,32 @@ Index: gdb-6.7/gdb/amd64-linux-tdep.c
/* GNU/Linux uses SVR4-style shared libraries. */
set_solib_svr4_fetch_link_map_offsets
(gdbarch, svr4_lp64_fetch_link_map_offsets);
Index: gdb-6.7/gdb/amd64-tdep.c
Index: gdb-6.8.50.20081128/gdb/amd64-tdep.c
===================================================================
--- gdb-6.7.orig/gdb/amd64-tdep.c 2007-10-12 17:48:39.000000000 +0200
+++ gdb-6.7/gdb/amd64-tdep.c 2007-10-16 15:57:03.000000000 +0200
@@ -849,11 +849,16 @@ amd64_frame_this_id (struct frame_info *
--- gdb-6.8.50.20081128.orig/gdb/amd64-tdep.c 2008-12-08 10:56:17.000000000 +0100
+++ gdb-6.8.50.20081128/gdb/amd64-tdep.c 2008-12-08 21:05:12.000000000 +0100
@@ -1044,11 +1044,16 @@ amd64_frame_this_id (struct frame_info *
{
struct amd64_frame_cache *cache =
amd64_frame_cache (next_frame, this_cache);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
amd64_frame_cache (this_frame, this_cache);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (this_frame));
/* This marks the outermost frame. */
if (cache->base == 0)
return;
+ /* Detect OS dependent outermost frames; such as `clone'. */
+ if (tdep->outermost_frame_p && tdep->outermost_frame_p (next_frame))
+ if (tdep->outermost_frame_p && tdep->outermost_frame_p (this_frame))
+ return;
+
(*this_id) = frame_id_build (cache->base + 16, cache->pc);
}
Index: gdb-6.7/gdb/i386-tdep.c
Index: gdb-6.8.50.20081128/gdb/i386-tdep.c
===================================================================
--- gdb-6.7.orig/gdb/i386-tdep.c 2007-10-12 17:48:39.000000000 +0200
+++ gdb-6.7/gdb/i386-tdep.c 2007-10-16 15:57:03.000000000 +0200
@@ -2355,6 +2355,9 @@ i386_gdbarch_init (struct gdbarch_info i
--- gdb-6.8.50.20081128.orig/gdb/i386-tdep.c 2008-12-08 10:56:17.000000000 +0100
+++ gdb-6.8.50.20081128/gdb/i386-tdep.c 2008-12-08 11:00:43.000000000 +0100
@@ -2698,6 +2698,9 @@ i386_gdbarch_init (struct gdbarch_info i
tdep->sc_pc_offset = -1;
tdep->sc_sp_offset = -1;
@ -149,24 +152,24 @@ Index: gdb-6.7/gdb/i386-tdep.c
/* The format used for `long double' on almost all i386 targets is
the i387 extended floating-point format. In fact, of all targets
in the GCC 2.95 tree, only OSF/1 does it different, and insists
Index: gdb-6.7/gdb/i386-tdep.h
Index: gdb-6.8.50.20081128/gdb/i386-tdep.h
===================================================================
--- gdb-6.7.orig/gdb/i386-tdep.h 2007-08-23 20:08:34.000000000 +0200
+++ gdb-6.7/gdb/i386-tdep.h 2007-10-16 15:57:32.000000000 +0200
--- gdb-6.8.50.20081128.orig/gdb/i386-tdep.h 2008-12-08 10:56:17.000000000 +0100
+++ gdb-6.8.50.20081128/gdb/i386-tdep.h 2008-12-08 21:07:47.000000000 +0100
@@ -106,6 +106,9 @@ struct gdbarch_tdep
/* ISA-specific data types. */
struct type *i386_mmx_type;
struct type *i386_sse_type;
+
+ /* Detect OS dependent outermost frames; such as `clone'. */
+ int (*outermost_frame_p) (struct frame_info *next_frame);
+ int (*outermost_frame_p) (struct frame_info *this_frame);
};
/* Floating-point registers. */
Index: gdb-6.7/gdb/testsuite/gdb.threads/bt-clone-stop.c
Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/bt-clone-stop.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.7/gdb/testsuite/gdb.threads/bt-clone-stop.c 2007-10-16 15:57:03.000000000 +0200
+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/bt-clone-stop.c 2008-12-08 11:00:43.000000000 +0100
@@ -0,0 +1,39 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -207,10 +210,10 @@ Index: gdb-6.7/gdb/testsuite/gdb.threads/bt-clone-stop.c
+ for (;;)
+ pause();
+}
Index: gdb-6.7/gdb/testsuite/gdb.threads/bt-clone-stop.exp
Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/bt-clone-stop.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.7/gdb/testsuite/gdb.threads/bt-clone-stop.exp 2007-10-16 15:57:03.000000000 +0200
+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/bt-clone-stop.exp 2008-12-08 11:00:43.000000000 +0100
@@ -0,0 +1,61 @@
+# Copyright 2006 Free Software Foundation, Inc.
+