gdb: Fix and enable for x64.

This commit is contained in:
Augustin Cavalier
2018-09-02 01:56:03 -04:00
parent 2827de872c
commit 0ee98d9e05
2 changed files with 75 additions and 13 deletions

View File

@@ -24,7 +24,7 @@ SOURCE_URI="https://ftp.gnu.org/gnu/gdb/gdb-6.3a.tar.bz2"
CHECKSUM_SHA256="f89b8f7bdddc7d9f111a1a1968b231165b8f1ff09843e4201076d0b77e0be244"
PATCHES="gdb-6.3.patch"
ARCHITECTURES="x86_gcc2 x86 !x86_64"
ARCHITECTURES="x86_gcc2 x86 x86_64"
PROVIDES="
gdb = $portVersion
@@ -47,6 +47,7 @@ BUILD_REQUIRES="
BUILD_PREREQUIRES="
haiku_devel
cmd:awk
cmd:cmp
cmd:bison
cmd:flex
cmd:gcc
@@ -56,6 +57,11 @@ BUILD_PREREQUIRES="
cmd:yacc
"
PATCH()
{
sed -i "s/for i in socket; do/for i in network; do/g" gdb/configure
}
BUILD()
{
if [ $targetArchitecture = x86_gcc2 ] || [ $targetArchitecture = x86 ]; then

View File

@@ -1,23 +1,25 @@
From 9d7e13ad2525af53757122d532ac3851e9065471 Mon Sep 17 00:00:00 2001
From f8ef37b6f0c824c1583278177b81312aef057361 Mon Sep 17 00:00:00 2001
From: Augustin Cavalier <waddlesplash@gmail.com>
Date: Wed, 11 Feb 2015 10:07:54 -0500
Date: Sun, 2 Sep 2018 01:12:58 -0400
Subject: [PATCH] Merge changes from Haiku's main repo.
Includes some other fixes by me to get the build system fully working.
---
bfd/config.bfd | 4 +
bfd/config.bfd | 8 +
config.sub | 3 +
gdb/Makefile.in | 2 +-
gdb/amd64-haiku-nat.c | 96 +++
gdb/amd64-haiku-tdep.c | 61 ++
gdb/config/i386/haiku.mh | 7 +
gdb/config/i386/haiku.mt | 5 +
gdb/config/i386/haiku64.mh | 7 +
gdb/config/i386/haiku64.mt | 5 +
gdb/config/i386/nm-haiku.h | 27 +
gdb/config/i386/tm-haiku.h | 27 +
gdb/config/nm-haiku.h | 25 +
gdb/config/tm-haiku.h | 25 +
gdb/configure.host | 1 +
gdb/configure.tgt | 1 +
gdb/configure.host | 3 +
gdb/configure.tgt | 2 +
gdb/defs.h | 2 +
gdb/haiku-nat.c | 1742 ++++++++++++++++++++++++++++++++++++++++++++
gdb/haiku-nat.h | 42 ++
@@ -32,11 +34,13 @@ Includes some other fixes by me to get the build system fully working.
readline/histfile.c | 4 +-
readline/input.c | 2 +-
readline/support/wcwidth.c | 1 +
27 files changed, 2635 insertions(+), 8 deletions(-)
29 files changed, 2654 insertions(+), 8 deletions(-)
create mode 100644 gdb/amd64-haiku-nat.c
create mode 100644 gdb/amd64-haiku-tdep.c
create mode 100644 gdb/config/i386/haiku.mh
create mode 100644 gdb/config/i386/haiku.mt
create mode 100644 gdb/config/i386/haiku64.mh
create mode 100644 gdb/config/i386/haiku64.mt
create mode 100644 gdb/config/i386/nm-haiku.h
create mode 100644 gdb/config/i386/tm-haiku.h
create mode 100644 gdb/config/nm-haiku.h
@@ -50,10 +54,21 @@ Includes some other fixes by me to get the build system fully working.
create mode 100644 gdb/solib-haiku.h
diff --git a/bfd/config.bfd b/bfd/config.bfd
index 549397b..c6621f9 100644
index 549397b..79ceda9 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -572,6 +572,10 @@ case "${targ}" in
@@ -532,6 +532,10 @@ case "${targ}" in
targ_defvec=bfd_elf64_x86_64_vec
targ_selvecs="bfd_elf32_i386_vec i386coff_vec bfd_efi_app_ia32_vec"
;;
+ x86_64-*-haiku*)
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386coff_vec bfd_efi_app_ia32_vec"
+ ;;
x86_64-*-netbsd* | x86_64-*-openbsd*)
targ_defvec=bfd_elf64_x86_64_vec
targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
@@ -572,6 +576,10 @@ case "${targ}" in
targ_defvec=bfd_elf32_i386_vec
targ_selvecs="i386pe_vec i386pei_vec"
;;
@@ -79,7 +94,7 @@ index edb6b66..36a7851 100755
;;
*)
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 966f887..8cbc2ce 100644
index 966f887..bfe9a41 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -374,7 +374,7 @@ INSTALLED_LIBS=-lbfd -lreadline -lopcodes -liberty \
@@ -284,6 +299,30 @@ index 0000000..e60affb
+TDEPFILES= i386-tdep.o i386-haiku-tdep.o haiku-tdep.o i387-tdep.o \
+ solib.o solib-haiku.o symfile-mem.o
+DEPRECATED_TM_FILE= tm-haiku.h
diff --git a/gdb/config/i386/haiku64.mh b/gdb/config/i386/haiku64.mh
new file mode 100644
index 0000000..6381f4e
--- /dev/null
+++ b/gdb/config/i386/haiku64.mh
@@ -0,0 +1,7 @@
+# Host: Intel x86_64 running Haiku
+
+NAT_FILE= nm-haiku.h
+NATDEPFILES= haiku-nat.o amd64-haiku-nat.o inf-child.o fork-child.o
+
+# No core file support yet.
+# corelow.o core-aout.o
diff --git a/gdb/config/i386/haiku64.mt b/gdb/config/i386/haiku64.mt
new file mode 100644
index 0000000..cdacbb9
--- /dev/null
+++ b/gdb/config/i386/haiku64.mt
@@ -0,0 +1,5 @@
+# Target: Intel x86_64 running Haiku
+
+TDEPFILES= amd64-tdep.o amd64-haiku-tdep.o haiku-tdep.o i386-haiku-tdep.o \
+ i386-tdep.o i387-tdep.o solib.o solib-haiku.o symfile-mem.o
+DEPRECATED_TM_FILE= tm-haiku.h
diff --git a/gdb/config/i386/nm-haiku.h b/gdb/config/i386/nm-haiku.h
new file mode 100644
index 0000000..b392360
@@ -413,7 +452,7 @@ index 0000000..cdead7b
+/* Support for shared libraries. */
+#include "solib.h"
diff --git a/gdb/configure.host b/gdb/configure.host
index f730891..867bef1 100644
index f730891..9ae107c 100644
--- a/gdb/configure.host
+++ b/gdb/configure.host
@@ -86,6 +86,7 @@ i[34567]86-*-unixware*) gdb_host=i386v4 ;;
@@ -424,8 +463,17 @@ index f730891..867bef1 100644
ia64-*-aix*) gdb_host=aix ;;
ia64-*-linux*) gdb_host=linux ;;
@@ -149,6 +150,8 @@ vax-*-ultrix*) gdb_host=vax ;;
x86_64-*-linux*) gdb_host=linux64 ;;
x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
gdb_host=fbsd64 ;;
+x86_64-*-haiku*)
+ gdb_host=haiku64 ;;
x86_64-*-netbsd* | x86_64-*-knetbsd*-gnu)
gdb_host=nbsd64 ;;
x86_64-*-openbsd*) gdb_host=obsd64 ;;
diff --git a/gdb/configure.tgt b/gdb/configure.tgt
index 0b1f627..93ca8ae 100644
index 0b1f627..4b75a9a 100644
--- a/gdb/configure.tgt
+++ b/gdb/configure.tgt
@@ -98,6 +98,7 @@ i[34567]86-*-netware*) gdb_target=i386
@@ -436,6 +484,14 @@ index 0b1f627..93ca8ae 100644
i[34567]86-*-*) gdb_target=i386 ;;
ia64-*-aix*) gdb_target=aix ;;
@@ -217,6 +218,7 @@ v850*-*-*) gdb_target=v850
x86_64-*-linux*) gdb_target=linux64
build_gdbserver=yes
;;
+x86_64-*-haiku*) gdb_target=haiku64 ;;
x86_64-*-netbsd* | x86_64-*-knetbsd*-gnu)
gdb_target=nbsd64 ;;
x86_64-*-openbsd*) gdb_target=obsd64 ;;
diff --git a/gdb/defs.h b/gdb/defs.h
index fd96665..21dcda7 100644
--- a/gdb/defs.h
@@ -2941,5 +2997,5 @@ index ace9a3a..29f5593 100644
struct interval {
--
2.2.2
2.16.4