gdb: bump to 17.1

also add patch for master
This commit is contained in:
Jérôme Duval
2026-03-11 17:26:26 +01:00
parent e8819654f2
commit f6ee642a75
3 changed files with 8329 additions and 47 deletions

View File

@@ -17,17 +17,17 @@ Pascal (and many other languages). Those programs might be executing \
on the same machine as GDB (native) or on another machine (remote). \
GDB can run on most popular UNIX and Microsoft Windows variants."
HOMEPAGE="https://sourceware.org/gdb/"
COPYRIGHT="2024 Free Software Foundation, Inc."
COPYRIGHT="2024-2025 Free Software Foundation, Inc."
LICENSE="GNU GPL v2
GNU GPL v3"
REVISION="1"
SOURCE_URI="https://ftp.gnu.org/gnu/gdb/gdb-$portVersion.tar.xz"
CHECKSUM_SHA256="bcfcd095528a987917acf9fff3f1672181694926cc18d609c99d0042c00224c5"
CHECKSUM_SHA256="14996f5f74c9f68f5a543fdc45bca7800207f91f92aeea6c2e791822c7c6d876"
PATCHES="gdb-$portVersion.patchset"
ARCHITECTURES="x86_64 ?x86 !x86_gcc2"
binutilsVersion="2.43"
binutilsVersion="2.45"
PROVIDES="
gdb = $portVersion

View File

@@ -1,4 +1,4 @@
From e524cecc46de3ec07141e8ffa5e23739a6714a95 Mon Sep 17 00:00:00 2001
From 5d17dd53bdebba3a5810f1358686b3dd4c620ae8 Mon Sep 17 00:00:00 2001
From: Trung Nguyen <me@trungnt2910.com>
Date: Mon, 29 Jul 2024 22:55:42 +1000
Subject: gdb/remote: fix assertion failure during startup
@@ -106,10 +106,10 @@ further debugging may prove unreliable.
0x7f6329102e64 _Z15execute_commandPKci
diff --git a/gdb/remote.c b/gdb/remote.c
index e00ddc0..d2f1c6e 100644
index 1d8d9b1..823677c 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -7738,8 +7738,11 @@ remote_notif_stop_can_get_pending_events (remote_target *remote,
@@ -7768,8 +7768,11 @@ remote_notif_stop_can_get_pending_events (remote_target *remote,
instead. If we fetch all queued events from stub, remote stub
may exit and we have no chance to process them back in
remote_wait_ns. */
@@ -123,7 +123,7 @@ index e00ddc0..d2f1c6e 100644
return 0;
}
@@ -7936,7 +7939,7 @@ remote_target::queued_stop_reply (ptid_t ptid)
@@ -7966,7 +7969,7 @@ remote_target::queued_stop_reply (ptid_t ptid)
remote_state *rs = get_remote_state ();
stop_reply_up r = remote_notif_remove_queued_reply (ptid);
@@ -136,7 +136,7 @@ index e00ddc0..d2f1c6e 100644
2.51.0
From 1d046da9f6aeee3b1137dcc5100dbac1049b8c91 Mon Sep 17 00:00:00 2001
From bc5bcee3a9f742ad13c572945678b683c8b6ead6 Mon Sep 17 00:00:00 2001
From: Trung Nguyen <57174311+trungnt2910@users.noreply.github.com>
Date: Tue, 28 May 2024 22:31:22 +1000
Subject: gdbserver: Initial Haiku support
@@ -4127,10 +4127,10 @@ index 0000000..01e87e4
+
+#endif /* NAT_HAIKU_OSDATA_H */
diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
index 365dcf2..7460650 100644
index dbcc18a..7572c04 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -600,6 +600,12 @@ gdbreplay.o: gdbreplay.cc
@@ -592,6 +592,12 @@ gdbreplay.o: gdbreplay.cc
$(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) $(CXXFLAGS) \
-include gdbsupport/common-defs.h $(COMPILE.post) $<
@@ -4144,10 +4144,10 @@ index 365dcf2..7460650 100644
# Dependency tracking.
#
diff --git a/gdbserver/configure b/gdbserver/configure
index 32980e5..6855a18 100755
index 1554296..c8b47d7 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -8722,7 +8722,7 @@ return socketpair ();
@@ -8487,7 +8487,7 @@ return socketpair ();
return 0;
}
_ACEOF
@@ -4157,10 +4157,10 @@ index 32980e5..6855a18 100755
ac_res="none required"
else
diff --git a/gdbserver/configure.srv b/gdbserver/configure.srv
index ffc8494..48cc5e7 100644
index 6281cda..3747013 100644
--- a/gdbserver/configure.srv
+++ b/gdbserver/configure.srv
@@ -405,6 +405,15 @@ case "${gdbserver_host}" in
@@ -415,6 +415,15 @@ case "${gdbserver_host}" in
srv_tgtobj="${srv_tgtobj} nat/netbsd-nat.o"
srv_tgtobj="${srv_tgtobj} arch/amd64.o"
;;
@@ -5166,7 +5166,7 @@ index 0000000..1167305
+
+#endif /* GDBSERVER_HAIKU_LOW_H */
diff --git a/gdbserver/remote-utils.cc b/gdbserver/remote-utils.cc
index 67225c5..133b4f1 100644
index 15f073d..fd9bb10 100644
--- a/gdbserver/remote-utils.cc
+++ b/gdbserver/remote-utils.cc
@@ -111,6 +111,10 @@ static int listen_desc = -1;
@@ -5181,7 +5181,7 @@ index 67225c5..133b4f1 100644
gdb_connected (void)
{
diff --git a/gdbsupport/signals.cc b/gdbsupport/signals.cc
index 2cf641b..be2df0b 100644
index f4065cc..8b1d607 100644
--- a/gdbsupport/signals.cc
+++ b/gdbsupport/signals.cc
@@ -333,6 +333,11 @@ gdb_signal_from_host (int hostsig)
@@ -5209,7 +5209,7 @@ index 2cf641b..be2df0b 100644
#if defined (REALTIME_LO)
retsig = 0;
diff --git a/include/gdb/signals.def b/include/gdb/signals.def
index 677b01e..d21d339 100644
index 22eaf54..1f36dc4 100644
--- a/include/gdb/signals.def
+++ b/include/gdb/signals.def
@@ -196,7 +196,9 @@ SET (GDB_EXC_BREAKPOINT, 150, "EXC_BREAKPOINT", "Breakpoint")
@@ -5227,20 +5227,28 @@ index 677b01e..d21d339 100644
2.51.0
From 3d16f65608526c71104e8bd77d7a57088950fd44 Mon Sep 17 00:00:00 2001
From 51c5570193439f45cf0a0d4131270e2de8f70177 Mon Sep 17 00:00:00 2001
From: Trung Nguyen <me@trungnt2910.com>
Date: Mon, 1 Jul 2024 10:32:51 +0700
Subject: gdb: Initial Haiku support
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 6d627b6..509a1af 100644
index 743a769..f595cfd 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -613,6 +613,14 @@ GDB_CFLAGS = \
@@ -615,6 +615,22 @@ GDB_CFLAGS = \
-DLOCALEDIR="\"$(localedir)\"" \
$(DEFS)
+# Special rule for Haiku-specific files to avoid name clashes.
+nat/haiku-%.o: GDB_CFLAGS = \
+ -I. \
+ -I$(srcdir) \
+ -I$(srcdir)/config \
+ -DLOCALEDIR="\"$(localedir)\"" \
+ $(DEFS)
+
+# Special rule for Haiku-specific files to avoid name clashes.
+nat/haiku-%.o: GDB_CFLAGS = \
+ -I. \
@@ -5252,15 +5260,15 @@ index 6d627b6..509a1af 100644
# MH_CFLAGS, if defined, has host-dependent CFLAGS from the config directory.
GLOBAL_CFLAGS = $(MH_CFLAGS)
@@ -739,6 +747,7 @@ ALL_64_TARGET_OBS = \
amd64-darwin-tdep.o \
@@ -742,6 +758,7 @@ ALL_64_TARGET_OBS = \
amd64-dicos-tdep.o \
amd64-fbsd-tdep.o \
amd64-gnu-tdep.o \
+ amd64-haiku-tdep.o \
amd64-linux-tdep.o \
amd64-netbsd-tdep.o \
amd64-obsd-tdep.o \
@@ -821,6 +830,7 @@ ALL_TARGET_OBS = \
@@ -825,6 +842,7 @@ ALL_TARGET_OBS = \
ft32-tdep.o \
glibc-tdep.o \
h8300-tdep.o \
@@ -5268,7 +5276,7 @@ index 6d627b6..509a1af 100644
hppa-bsd-tdep.o \
hppa-linux-tdep.o \
hppa-netbsd-tdep.o \
@@ -832,6 +842,7 @@ ALL_TARGET_OBS = \
@@ -836,6 +854,7 @@ ALL_TARGET_OBS = \
i386-fbsd-tdep.o \
i386-gnu-tdep.o \
i386-go32-tdep.o \
@@ -5276,32 +5284,34 @@ index 6d627b6..509a1af 100644
i386-linux-tdep.o \
i386-netbsd-tdep.o \
i386-obsd-tdep.o \
@@ -886,6 +897,7 @@ ALL_TARGET_OBS = \
@@ -890,6 +909,7 @@ ALL_TARGET_OBS = \
solib-darwin.o \
solib-dsbt.o \
solib-frv.o \
+ solib-haiku.o \
solib-svr4.o \
solib-svr4-linux.o \
sparc-linux-tdep.o \
sparc-netbsd-tdep.o \
@@ -1495,6 +1507,7 @@ HFILES_NO_SRCDIR = \
solib.h \
solib-aix.h \
@@ -1660,7 +1680,9 @@ HFILES_NO_SRCDIR = \
solib-darwin.h \
solib-dsbt.h \
solib-frv.h \
+ solib-haiku.h \
solib.h \
+ solib-haiku.h \
solib-svr4.h \
solib-svr4-linux.h \
solib-target.h \
solist.h \
@@ -1698,6 +1711,8 @@ ALLDEPFILES = \
amd64-dicos-tdep.c \
@@ -1801,6 +1823,8 @@ ALLDEPFILES = \
amd64-fbsd-nat.c \
amd64-fbsd-tdep.c \
amd64-gnu-tdep.c \
+ amd64-haiku-nat.c \
+ amd64-haiku-tdep.c \
amd64-linux-nat.c \
amd64-linux-tdep.c \
amd64-nat.c \
@@ -1738,6 +1753,8 @@ ALLDEPFILES = \
@@ -1841,6 +1865,8 @@ ALLDEPFILES = \
glibc-tdep.c \
go32-nat.c \
h8300-tdep.c \
@@ -5310,16 +5320,16 @@ index 6d627b6..509a1af 100644
hppa-bsd-tdep.c \
hppa-linux-nat.c \
hppa-linux-tdep.c \
@@ -1755,6 +1772,8 @@ ALLDEPFILES = \
@@ -1857,6 +1883,8 @@ ALLDEPFILES = \
i386-fbsd-nat.c \
i386-fbsd-tdep.c \
i386-gnu-nat.c \
i386-gnu-tdep.c \
+ i386-haiku-nat.c \
+ i386-haiku-tdep.c \
i386-linux-nat.c \
i386-linux-tdep.c \
i386-netbsd-nat.c \
@@ -1848,6 +1867,7 @@ ALLDEPFILES = \
@@ -1950,6 +1978,7 @@ ALLDEPFILES = \
sh-tdep.c \
sol2-tdep.c \
solib-aix.c \
@@ -5637,10 +5647,10 @@ index 0000000..086e631
+ amd64_haiku_init_abi);
+}
diff --git a/gdb/configure b/gdb/configure
index 1531f62..4ead228 100755
index d0bdba6..c7d20fe 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -20016,7 +20016,7 @@ return socketpair ();
@@ -19917,7 +19917,7 @@ return socketpair ();
return 0;
}
_ACEOF
@@ -5650,7 +5660,7 @@ index 1531f62..4ead228 100755
ac_res="none required"
else
diff --git a/gdb/configure.host b/gdb/configure.host
index 22855cd..52fb68b 100644
index fdd6519..f56ffd2 100644
--- a/gdb/configure.host
+++ b/gdb/configure.host
@@ -111,6 +111,7 @@ i[34567]86-*-msdosdjgpp*) gdb_host=go32 ;;
@@ -5670,7 +5680,7 @@ index 22855cd..52fb68b 100644
gdb_host_obs=mingw-hdep.o
;;
diff --git a/gdb/configure.nat b/gdb/configure.nat
index 9e78091..fffac27 100644
index 2bd67ae..bf5586c 100644
--- a/gdb/configure.nat
+++ b/gdb/configure.nat
@@ -74,6 +74,11 @@ case ${gdb_host} in
@@ -5685,7 +5695,7 @@ index 9e78091..fffac27 100644
cygwin*)
NATDEPFILES='x86-nat.o nat/x86-dregs.o windows-nat.o nat/windows-nat.o'
;;
@@ -475,6 +480,26 @@ case ${gdb_host} in
@@ -496,6 +501,26 @@ case ${gdb_host} in
;;
esac
;;
@@ -5713,7 +5723,7 @@ index 9e78091..fffac27 100644
case ${gdb_host_cpu} in
powerpc)
diff --git a/gdb/configure.tgt b/gdb/configure.tgt
index f7b9e32..eb65890 100644
index f969c9e..52cb59a 100644
--- a/gdb/configure.tgt
+++ b/gdb/configure.tgt
@@ -128,6 +128,8 @@ case "${targ}" in
@@ -5725,7 +5735,7 @@ index f7b9e32..eb65890 100644
esac
# 3. Get the rest of objects.
@@ -305,6 +307,10 @@ i[34567]86-*-openbsd*)
@@ -310,6 +312,10 @@ i[34567]86-*-openbsd*)
# Target: OpenBSD/i386
gdb_target_obs="i386-bsd-tdep.o i386-obsd-tdep.o bsd-uthread.o"
;;
@@ -5736,7 +5746,7 @@ index f7b9e32..eb65890 100644
i[34567]86-*-solaris2* | x86_64-*-solaris2*)
# Target: Solaris x86_64
gdb_target_obs="${i386_tobjs} ${amd64_tobjs} \
@@ -731,6 +737,11 @@ x86_64-*-openbsd*)
@@ -749,6 +755,11 @@ x86_64-*-openbsd*)
i386-bsd-tdep.o i386-obsd-tdep.o \
bsd-uthread.o"
;;
@@ -7129,7 +7139,7 @@ index 0000000..5f6a90f
+
+#endif /* solib-haiku.h */
diff --git a/gdbsupport/osabi.def b/gdbsupport/osabi.def
index 637da26..ae994f8 100644
index 2e98e32..4e6eccc 100644
--- a/gdbsupport/osabi.def
+++ b/gdbsupport/osabi.def
@@ -41,6 +41,7 @@ GDB_OSABI_DEF (LINUX, "GNU/Linux", "linux(-gnu[^-]*)?")
@@ -7144,7 +7154,7 @@ index 637da26..ae994f8 100644
2.51.0
From 6401432b070fe0196a6ff7caa438132198f6b259 Mon Sep 17 00:00:00 2001
From 48c43062323ba6d4ed1d9448620a6f0a538adbf4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
Date: Sat, 7 Mar 2026 21:55:17 +0100
Subject: gdb: Update Haiku support for 16.x
@@ -7299,7 +7309,7 @@ index 5f6a90f..bd023f5 100644
2.51.0
From 5a6a53cd454f6d400bd5c46698a847d00fd9fb2a Mon Sep 17 00:00:00 2001
From 70beabd9e0466d7d272412fb1b4a3ac940e4be22 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
Date: Sat, 7 Mar 2026 21:56:27 +0100
Subject: gdbserver: Update Haiku support for 16.x
@@ -7473,3 +7483,321 @@ index 41295d5..b0551b8 100644
--
2.51.0
From 9069c145be8711b6321472314deb60ffc3597daa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
Date: Wed, 11 Mar 2026 17:00:20 +0100
Subject: gdb: Update Haiku support for 17.x
diff --git a/gdb/amd64-haiku-nat.c b/gdb/amd64-haiku-nat.c
index e622e66..6ce9fc7 100644
--- a/gdb/amd64-haiku-nat.c
+++ b/gdb/amd64-haiku-nat.c
@@ -143,9 +143,7 @@ amd64_haiku_nat_target::store_registers (struct regcache *regcache, int regno)
static amd64_haiku_nat_target the_amd64_haiku_nat_target;
-void _initialize_amd64_haiku_nat ();
-void
-_initialize_amd64_haiku_nat ()
+INIT_GDB_FILE (amd64_haiku_nat)
{
haiku_target = &the_amd64_haiku_nat_target;
diff --git a/gdb/amd64-haiku-tdep.c b/gdb/amd64-haiku-tdep.c
index 086e631..476d6db 100644
--- a/gdb/amd64-haiku-tdep.c
+++ b/gdb/amd64-haiku-tdep.c
@@ -132,9 +132,7 @@ amd64_haiku_osabi_sniffer (bfd *abfd)
return GDB_OSABI_HAIKU;
}
-void _initialize_amd64_haiku_tdep ();
-void
-_initialize_amd64_haiku_tdep ()
+INIT_GDB_FILE (amd64_haiku_tdep)
{
gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour,
amd64_haiku_osabi_sniffer);
diff --git a/gdb/haiku-nat.c b/gdb/haiku-nat.c
index c1d768c..4dcaf23 100644
--- a/gdb/haiku-nat.c
+++ b/gdb/haiku-nat.c
@@ -733,9 +733,7 @@ is_catching_syscalls_for (ptid_t ptid)
/* Initialization. */
-void _initialize_haiku_nat ();
-void
-_initialize_haiku_nat ()
+INIT_GDB_FILE (haiku_nat)
{
/* We cannot do this in target_op's own callbacks, since they are called too
early after attaching or an exec event. At that point, symfile_object_file
diff --git a/gdb/haiku-tdep.c b/gdb/haiku-tdep.c
index 3b866a5..f0fd1d2 100644
--- a/gdb/haiku-tdep.c
+++ b/gdb/haiku-tdep.c
@@ -32,7 +32,7 @@
void
haiku_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
- set_gdbarch_so_ops (gdbarch, &haiku_so_ops);
+ set_gdbarch_make_solib_ops (gdbarch, make_haiku_solib_ops);
}
/* See haiku-tdep.h. */
diff --git a/gdb/i386-haiku-nat.c b/gdb/i386-haiku-nat.c
index b41fcca..7f00e54 100644
--- a/gdb/i386-haiku-nat.c
+++ b/gdb/i386-haiku-nat.c
@@ -29,9 +29,7 @@ struct i386_haiku_nat_target final : public haiku_nat_target
static i386_haiku_nat_target the_i386_haiku_nat_target;
-void _initialize_i386_haiku_nat ();
-void
-_initialize_i386_haiku_nat ()
+INIT_GDB_FILE (i386_haiku_nat)
{
haiku_target = &the_i386_haiku_nat_target;
diff --git a/gdb/i386-haiku-tdep.c b/gdb/i386-haiku-tdep.c
index fd8011f..38ddefb 100644
--- a/gdb/i386-haiku-tdep.c
+++ b/gdb/i386-haiku-tdep.c
@@ -49,9 +49,7 @@ i386_haiku_osabi_sniffer (bfd *abfd)
return GDB_OSABI_HAIKU;
}
-void _initialize_i386_haiku_tdep ();
-void
-_initialize_i386_haiku_tdep ()
+INIT_GDB_FILE (i386_haiku_tdep)
{
gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour,
i386_haiku_osabi_sniffer);
diff --git a/gdb/solib-haiku.c b/gdb/solib-haiku.c
index 0ec56b5..588bbc0 100644
--- a/gdb/solib-haiku.c
+++ b/gdb/solib-haiku.c
@@ -23,9 +23,34 @@
#include "haiku-tdep.h"
#include "inferior.h"
#include "objfiles.h"
+#include "solib.h"
#include "solib-haiku.h"
#include "solib-target.h"
-#include "solist.h"
+
+
+/* solib_ops for Haiku systems. */
+
+struct haiku_solib_ops : public target_solib_ops
+{
+ using target_solib_ops::target_solib_ops;
+
+ void relocate_section_addresses (solib &so, target_section *) const override;
+ void clear_solib (program_space *pspace) const override;
+ void create_inferior_hook (int from_tty) const override;
+ owning_intrusive_list<solib> current_sos () const override;
+ bool open_symbol_file_object (int from_tty) const override;
+ bool in_dynsym_resolve_code (CORE_ADDR pc) const override;
+ gdb_bfd_ref_ptr bfd_open (const char *pathname) const override;
+};
+
+/* See solib-haiku.h. */
+
+solib_ops_up
+make_haiku_solib_ops (program_space *pspace)
+{
+ return std::make_unique<haiku_solib_ops> (pspace);
+}
+
/* For other targets, the solib implementation usually reads hints from the
dynamic linker in the active address space, which could be anything from a
@@ -37,10 +62,10 @@
This is basically a wrapper around solib-target.c. */
-static void
-haiku_relocate_section_addresses (solib &so, struct target_section *sec)
+void
+haiku_solib_ops::relocate_section_addresses (solib &so, struct target_section *sec) const
{
- if (so.so_name == "commpage")
+ if (so.name == "commpage")
{
CORE_ADDR commpage_address = haiku_get_commpage_address ();
sec->addr = commpage_address;
@@ -49,72 +74,55 @@ haiku_relocate_section_addresses (solib &so, struct target_section *sec)
so.addr_low = commpage_address;
so.addr_high = commpage_address + HAIKU_COMMPAGE_SIZE;
}
- else
+ /*else
{
- solib_target_so_ops.relocate_section_addresses (so, sec);
- }
+ solib_target_so_ops::relocate_section_addresses (so, sec);
+ }*/
}
-static void
+/*static void
haiku_clear_so (const solib &so)
{
if (solib_target_so_ops.clear_so != nullptr)
solib_target_so_ops.clear_so (so);
-}
+}*/
-static void
-haiku_clear_solib (program_space *pspace)
+void
+haiku_solib_ops::clear_solib (program_space *pspace) const
{
- if (solib_target_so_ops.clear_solib != nullptr)
- solib_target_so_ops.clear_solib (pspace);
+ target_solib_ops::clear_solib (pspace);
}
-static void
-haiku_solib_create_inferior_hook (int from_tty)
+void
+haiku_solib_ops::create_inferior_hook (int from_tty) const
{
- solib_target_so_ops.solib_create_inferior_hook (from_tty);
+ target_solib_ops::create_inferior_hook (from_tty);
}
-static owning_intrusive_list<solib>
-haiku_current_sos ()
+owning_intrusive_list<solib>
+haiku_solib_ops::current_sos () const
{
- return solib_target_so_ops.current_sos ();
+ return target_solib_ops::current_sos ();
}
-static int
-haiku_open_symbol_file_object (int from_tty)
+bool
+haiku_solib_ops::open_symbol_file_object (int from_tty) const
{
- return solib_target_so_ops.open_symbol_file_object (from_tty);
+ return target_solib_ops::open_symbol_file_object (from_tty);
}
-static int
-haiku_in_dynsym_resolve_code (CORE_ADDR pc)
+bool
+haiku_solib_ops::in_dynsym_resolve_code (CORE_ADDR pc) const
{
/* No dynamic resolving implemented in Haiku yet.
Return what the generic code has to say. */
- return solib_target_so_ops.in_dynsym_resolve_code (pc);
+ return target_solib_ops::in_dynsym_resolve_code (pc);
}
-static gdb_bfd_ref_ptr
-haiku_bfd_open (const char *pathname)
+gdb_bfd_ref_ptr
+haiku_solib_ops::bfd_open (const char *pathname) const
{
if (strcmp (pathname, "commpage") == 0)
return haiku_bfd_open_commpage ();
- return solib_target_so_ops.bfd_open (pathname);
+ return target_solib_ops::bfd_open (pathname);
}
-
-const struct solib_ops haiku_so_ops = {
- .relocate_section_addresses = haiku_relocate_section_addresses,
- .clear_so = haiku_clear_so,
- .clear_solib = haiku_clear_solib,
- .solib_create_inferior_hook = haiku_solib_create_inferior_hook,
- .current_sos = haiku_current_sos,
- .open_symbol_file_object = haiku_open_symbol_file_object,
- .in_dynsym_resolve_code = haiku_in_dynsym_resolve_code,
- .bfd_open = haiku_bfd_open,
- nullptr,
- nullptr,
- nullptr,
- nullptr,
- default_find_solib_addr,
-};
diff --git a/gdb/solib-haiku.h b/gdb/solib-haiku.h
index bd023f5..092b2c5 100644
--- a/gdb/solib-haiku.h
+++ b/gdb/solib-haiku.h
@@ -20,8 +20,10 @@
#ifndef GDB_SOLIB_HAIKU_H
#define GDB_SOLIB_HAIKU_H
-struct solib_ops;
+#include "solib.h"
-extern const struct solib_ops haiku_so_ops;
+/* Return a new solib_ops for Haiku systems. */
+
+extern solib_ops_up make_haiku_solib_ops (program_space *pspace);
#endif /* GDB_SOLIB_HAIKU_H */
--
2.51.0
From 599a7118c7af4f2ada42d610a5c782b4d86a97f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
Date: Wed, 11 Mar 2026 17:03:47 +0100
Subject: gdbserver: Update Haiku support for 17.x
diff --git a/gdbserver/haiku-low.cc b/gdbserver/haiku-low.cc
index b0551b8..0b81919 100644
--- a/gdbserver/haiku-low.cc
+++ b/gdbserver/haiku-low.cc
@@ -39,7 +39,7 @@ bool debug_haiku_nat = false;
int
haiku_process_target::create_inferior (const char *program,
- const std::vector<char *> &program_args)
+ const std::string &program_args)
{
haiku_nat_debug_printf ("program=%s", program);
@@ -70,15 +70,13 @@ haiku_process_target::create_inferior (const char *program,
perror_with_name (("haiku_nat::continue_process"));
};
- std::string str_program_args = construct_inferior_arguments (program_args);
-
client_state &cs = get_client_state ();
if (cs.disable_randomization)
get_environ ()->set ("DISABLE_ASLR", "1");
else
get_environ ()->unset ("DISABLE_ASLR");
- pid_t pid = fork_inferior (program, str_program_args.c_str (),
+ pid_t pid = fork_inferior (program, program_args.c_str (),
get_environ ()->envp (), haiku_traceme,
haiku_init_trace, nullptr, nullptr, nullptr);
diff --git a/gdbserver/haiku-low.h b/gdbserver/haiku-low.h
index 1167305..3c92b90 100644
--- a/gdbserver/haiku-low.h
+++ b/gdbserver/haiku-low.h
@@ -24,7 +24,7 @@ class haiku_process_target : public process_stratum_target
{
public:
int create_inferior (const char *program,
- const std::vector<char *> &program_args) override;
+ const std::string &program_args) override;
void post_create_inferior () override;
--
2.51.0

File diff suppressed because it is too large Load Diff