Port to GDB-6.8pre.
-Index: gdb-6.8.50.20081214/gdb/amd64-linux-nat.c
+Index: gdb-6.8.50.20090802/gdb/amd64-linux-nat.c
===================================================================
---- gdb-6.8.50.20081214.orig/gdb/amd64-linux-nat.c 2008-12-14 21:17:01.000000000 +0100
-+++ gdb-6.8.50.20081214/gdb/amd64-linux-nat.c 2008-12-14 21:24:19.000000000 +0100
-@@ -50,6 +50,9 @@
- #include "amd64-tdep.h"
+--- gdb-6.8.50.20090802.orig/gdb/amd64-linux-nat.c 2009-06-17 20:44:23.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/amd64-linux-nat.c 2009-08-03 15:49:33.000000000 +0200
+@@ -51,6 +51,9 @@
#include "i386-linux-tdep.h"
#include "amd64-nat.h"
+ #include "i386-nat.h"
+#include "i387-tdep.h"
+#include "elf-bfd.h"
+#include "gdb_procfs32.h"
/* Mapping between the general-purpose registers in GNU/Linux x86-64
`struct user' format and GDB's register cache layout. */
-@@ -84,6 +87,35 @@ static int amd64_linux_gregset64_reg_off
+@@ -85,6 +88,35 @@ static int amd64_linux_gregset64_reg_off
GNU/Linux i386 registers are all 32-bit, but since we're
little-endian we get away with that. */
/* From <sys/reg.h> on GNU/Linux i386. */
static int amd64_linux_gregset32_reg_offset[] =
{
-@@ -102,6 +134,96 @@ static int amd64_linux_gregset32_reg_off
+@@ -103,6 +135,96 @@ static int amd64_linux_gregset32_reg_off
};
\f
+amd64_linux_elfcore_write_prpsinfo (bfd *abfd, char *buf, int *bufsiz,
+ const char *fname, const char *psargs)
+{
-+ if (gdbarch_ptr_bit(current_gdbarch) == 32)
++ if (gdbarch_ptr_bit (target_gdbarch) == 32)
+ {
+ int note_type;
+ char *note_name = "CORE";
+amd64_linux_elfcore_write_prstatus (bfd *abfd, char *buf, int *bufsiz,
+ long pid, int cursig, const void *gregs)
+{
-+ if (gdbarch_ptr_bit(current_gdbarch) == 32)
++ if (gdbarch_ptr_bit (target_gdbarch) == 32)
+ {
+ char *note_name = "CORE";
+ struct elf_prstatus32 prstat;
+ int *bufsiz, const void *fpregs, int size,
+ struct regcache *regcache)
+{
-+ if (gdbarch_ptr_bit(current_gdbarch) == 32)
++ if (gdbarch_ptr_bit (target_gdbarch) == 32)
+ {
+ char *note_name = "CORE";
+ elf_fpregset32_t fpregs32;
/* Transfering the general-purpose registers between GDB, inferiors
and core files. */
-@@ -431,6 +553,11 @@ _initialize_amd64_linux_nat (void)
+@@ -682,6 +804,11 @@ _initialize_amd64_linux_nat (void)
t->to_fetch_registers = amd64_linux_fetch_inferior_registers;
t->to_store_registers = amd64_linux_store_inferior_registers;
/* Register the target. */
linux_nat_add_target (t);
linux_nat_set_new_thread (t, amd64_linux_new_thread);
-Index: gdb-6.8.50.20081214/gdb/config.in
+Index: gdb-6.8.50.20090802/gdb/config.in
===================================================================
---- gdb-6.8.50.20081214.orig/gdb/config.in 2008-12-14 21:17:01.000000000 +0100
-+++ gdb-6.8.50.20081214/gdb/config.in 2008-12-14 21:34:50.000000000 +0100
-@@ -136,6 +136,9 @@
+--- gdb-6.8.50.20090802.orig/gdb/config.in 2009-08-03 09:50:57.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/config.in 2009-08-03 15:48:31.000000000 +0200
+@@ -146,6 +146,9 @@
/* Define to 1 if you have the <elf_hp.h> header file. */
#undef HAVE_ELF_HP_H
/* Define to 1 if your system has the etext variable. */
#undef HAVE_ETEXT
-@@ -465,6 +468,9 @@
+@@ -487,6 +490,9 @@
/* Define to 1 if you have the <sys/poll.h> header file. */
#undef HAVE_SYS_POLL_H
/* Define to 1 if you have the <sys/procfs.h> header file. */
#undef HAVE_SYS_PROCFS_H
-@@ -492,6 +498,9 @@
+@@ -514,6 +520,9 @@
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <sys/user.h> header file. */
#undef HAVE_SYS_USER_H
-Index: gdb-6.8.50.20081214/gdb/configure
+Index: gdb-6.8.50.20090802/gdb/configure
===================================================================
---- gdb-6.8.50.20081214.orig/gdb/configure 2008-12-14 21:17:01.000000000 +0100
-+++ gdb-6.8.50.20081214/gdb/configure 2008-12-14 21:33:30.000000000 +0100
-@@ -12026,6 +12026,268 @@ _ACEOF
+--- gdb-6.8.50.20090802.orig/gdb/configure 2009-08-03 09:50:57.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/configure 2009-08-03 15:48:31.000000000 +0200
+@@ -12545,6 +12545,268 @@ _ACEOF
fi
# elf_hp.h is for HP/UX 64-bit shared library support.
# FIXME: kettenis/20030102: In most cases we include these (ctype.h, time.h)
# unconditionally, so what's the point in checking these?
-Index: gdb-6.8.50.20081214/gdb/configure.ac
+Index: gdb-6.8.50.20090802/gdb/configure.ac
===================================================================
---- gdb-6.8.50.20081214.orig/gdb/configure.ac 2008-12-14 21:17:01.000000000 +0100
-+++ gdb-6.8.50.20081214/gdb/configure.ac 2008-12-14 21:32:35.000000000 +0100
-@@ -686,6 +686,11 @@ AC_SUBST(PYTHON_CFLAGS)
+--- gdb-6.8.50.20090802.orig/gdb/configure.ac 2009-08-03 09:50:57.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/configure.ac 2009-08-03 15:48:31.000000000 +0200
+@@ -744,6 +744,11 @@ AC_SUBST(PYTHON_CFLAGS)
AC_HEADER_DIRENT
AC_HEADER_STAT
AC_HEADER_STDC
# elf_hp.h is for HP/UX 64-bit shared library support.
# FIXME: kettenis/20030102: In most cases we include these (ctype.h, time.h)
# unconditionally, so what's the point in checking these?
-Index: gdb-6.8.50.20081214/gdb/gcore.c
+Index: gdb-6.8.50.20090802/gdb/gcore.c
===================================================================
---- gdb-6.8.50.20081214.orig/gdb/gcore.c 2008-12-14 21:17:01.000000000 +0100
-+++ gdb-6.8.50.20081214/gdb/gcore.c 2008-12-14 21:17:10.000000000 +0100
-@@ -320,6 +320,11 @@ gcore_create_callback (CORE_ADDR vaddr,
+--- gdb-6.8.50.20090802.orig/gdb/gcore.c 2009-08-03 12:28:56.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/gcore.c 2009-08-03 15:48:31.000000000 +0200
+@@ -324,6 +324,11 @@ gcore_create_callback (CORE_ADDR vaddr,
asection *osec;
flagword flags = SEC_ALLOC | SEC_HAS_CONTENTS | SEC_LOAD;
/* If the memory segment has no permissions set, ignore it, otherwise
when we later try to access it for read/write, we'll get an error
or jam the kernel. */
-Index: gdb-6.8.50.20081214/gdb/gdb_procfs32.h
+Index: gdb-6.8.50.20090802/gdb/gdb_procfs32.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20081214/gdb/gdb_procfs32.h 2008-12-14 21:32:56.000000000 +0100
++++ gdb-6.8.50.20090802/gdb/gdb_procfs32.h 2009-08-03 15:48:31.000000000 +0200
@@ -0,0 +1,128 @@
+#ifdef HAVE_SYS_PROCFS32_H
+#include <sys/procfs32.h>
+#endif /* _SYS_PROCFS32_H */
+
+#endif /* HAVE_SYS_PROCFS32_H */
-Index: gdb-6.8.50.20081214/gdb/gdb_user32.h
+Index: gdb-6.8.50.20090802/gdb/gdb_user32.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20081214/gdb/gdb_user32.h 2008-12-14 21:17:10.000000000 +0100
++++ gdb-6.8.50.20090802/gdb/gdb_user32.h 2009-08-03 15:48:31.000000000 +0200
@@ -0,0 +1,108 @@
+#ifdef HAVE_SYS_USER32_H
+#include <sys/user32.h>
+#endif /* _SYS_USER32_H */
+
+#endif /* HAVE_SYS_USER32_H */
-Index: gdb-6.8.50.20081214/gdb/linux-nat.c
+Index: gdb-6.8.50.20090802/gdb/linux-nat.c
===================================================================
---- gdb-6.8.50.20081214.orig/gdb/linux-nat.c 2008-12-14 21:17:01.000000000 +0100
-+++ gdb-6.8.50.20081214/gdb/linux-nat.c 2008-12-14 21:24:20.000000000 +0100
-@@ -213,6 +213,21 @@ static LONGEST (*super_xfer_partial) (st
+--- gdb-6.8.50.20090802.orig/gdb/linux-nat.c 2009-08-03 12:31:26.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/linux-nat.c 2009-08-03 15:48:31.000000000 +0200
+@@ -219,6 +219,21 @@ static LONGEST (*super_xfer_partial) (st
const gdb_byte *,
ULONGEST, LONGEST);
static int debug_linux_nat;
static void
show_debug_linux_nat (struct ui_file *file, int from_tty,
-@@ -3473,7 +3488,7 @@ linux_nat_do_thread_registers (bfd *obfd
+@@ -3586,7 +3601,7 @@ linux_nat_do_thread_registers (bfd *obfd
else
fill_gregset (regcache, &gregs, -1);
note_data,
note_size,
lwp,
-@@ -3523,10 +3538,10 @@ linux_nat_do_thread_registers (bfd *obfd
+@@ -3636,10 +3651,10 @@ linux_nat_do_thread_registers (bfd *obfd
else
fill_fpregset (regcache, &fpregs, -1);
}
return note_data;
-@@ -3595,9 +3610,9 @@ linux_nat_make_corefile_notes (bfd *obfd
+@@ -3822,9 +3837,9 @@ linux_nat_make_corefile_notes (bfd *obfd
psargs_end - string_end);
}
}
}
/* Dump information for threads. */
-Index: gdb-6.8.50.20081214/gdb/linux-nat.h
+Index: gdb-6.8.50.20090802/gdb/linux-nat.h
===================================================================
---- gdb-6.8.50.20081214.orig/gdb/linux-nat.h 2008-12-14 21:17:01.000000000 +0100
-+++ gdb-6.8.50.20081214/gdb/linux-nat.h 2008-12-14 21:24:11.000000000 +0100
-@@ -134,3 +134,12 @@ void linux_nat_switch_fork (ptid_t new_p
+--- gdb-6.8.50.20090802.orig/gdb/linux-nat.h 2009-08-03 10:52:00.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/linux-nat.h 2009-08-03 15:48:31.000000000 +0200
+@@ -144,3 +144,12 @@ void linux_nat_switch_fork (ptid_t new_p
/* Return the saved siginfo associated with PTID. */
struct siginfo *linux_nat_get_siginfo (ptid_t ptid);