[PATCH 3/8] gdb: Update Haiku support for 16.x

Jérôme Duval
2026-03-12T17:28:17Z

---
gdb/haiku-nat.c | 4 ++--
gdb/haiku-tdep.h | 6 +++---
gdb/nat/haiku-nat.h | 6 +++---
gdb/nat/haiku-nub-message.h | 6 +++---
gdb/nat/haiku-osdata.h | 6 +++---
gdb/solib-haiku.c | 7 ++++++-
gdb/solib-haiku.h | 6 +++---
7 files changed, 23 insertions(+), 18 deletions(-)

diff --git a/gdb/haiku-nat.c b/gdb/haiku-nat.c
index 3faab245..c1d768c9 100644
--- a/gdb/haiku-nat.c
+++ b/gdb/haiku-nat.c
@@ -635,7 +635,7 @@ haiku_relocate_main_executable (inferior *inf)
}

if (inf->pspace->symfile_object_file == nullptr)
- symbol_file_add_main (inf->pspace->exec_filename.get (),
+ symbol_file_add_main (inf->pspace->exec_filename (),
SYMFILE_DEFER_BP_RESET);

objfile *objf = inf->pspace->symfile_object_file;
@@ -650,7 +650,7 @@ static void
haiku_enable_breakpoints_if_ready (inferior *inf)
{
if (strcmp (haiku_nat::pid_to_exec_file (inf->pid),
- inf->pspace->exec_filename.get ())
+ inf->pspace->exec_filename ())
!= 0)
{
/* Not ready yet. The inferior is still executing a wrapper
diff --git a/gdb/haiku-tdep.h b/gdb/haiku-tdep.h
index b53e3fbe..2efc2f64 100644
--- a/gdb/haiku-tdep.h
+++ b/gdb/haiku-tdep.h
@@ -17,8 +17,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */

-#ifndef HAIKU_TDEP_H
-#define HAIKU_TDEP_H
+#ifndef GDB_HAIKU_TDEP_H
+#define GDB_HAIKU_TDEP_H

#include "gdb_bfd.h"

@@ -41,4 +41,4 @@ gdb_bfd_ref_ptr haiku_bfd_open_commpage ();

CORE_ADDR haiku_get_commpage_address ();

-#endif /* HAIKU_TDEP_H */
+#endif /* GDB_HAIKU_TDEP_H */
diff --git a/gdb/nat/haiku-nat.h b/gdb/nat/haiku-nat.h
index 4a057a45..189027fd 100644
--- a/gdb/nat/haiku-nat.h
+++ b/gdb/nat/haiku-nat.h
@@ -17,8 +17,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */

-#ifndef NAT_HAIKU_NAT_H
-#define NAT_HAIKU_NAT_H
+#ifndef GDB_NAT_HAIKU_NAT_H
+#define GDB_NAT_HAIKU_NAT_H

#include <functional>

@@ -426,4 +426,4 @@ extern bool debug_haiku_nat;
#define HAIKU_NAT_SCOPED_DEBUG_ENTER_EXIT \
scoped_debug_enter_exit (debug_haiku_nat, "haiku-nat")

-#endif /* NAT_HAIKU_NAT_H */
+#endif /* GDB_NAT_HAIKU_NAT_H */
diff --git a/gdb/nat/haiku-nub-message.h b/gdb/nat/haiku-nub-message.h
index 04212a3a..fc41efe9 100644
--- a/gdb/nat/haiku-nub-message.h
+++ b/gdb/nat/haiku-nub-message.h
@@ -17,8 +17,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */

-#ifndef NAT_HAIKU_NUB_MESSAGE_H
-#define NAT_HAIKU_NUB_MESSAGE_H
+#ifndef GDB_NAT_HAIKU_NUB_MESSAGE_H
+#define GDB_NAT_HAIKU_NUB_MESSAGE_H

#include "gnulib/config.h"

@@ -138,4 +138,4 @@ haiku_send_nub_message (port_id nub_port,
return (result < B_OK) ? result : reply.error;
}

-#endif /* NAT_HAIKU_NUB_MESSAGE_H */
+#endif /* GDB_NAT_HAIKU_NUB_MESSAGE_H */
diff --git a/gdb/nat/haiku-osdata.h b/gdb/nat/haiku-osdata.h
index 01e87e4d..182ecfac 100644
--- a/gdb/nat/haiku-osdata.h
+++ b/gdb/nat/haiku-osdata.h
@@ -17,10 +17,10 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */

-#ifndef NAT_HAIKU_OSDATA_H
-#define NAT_HAIKU_OSDATA_H
+#ifndef GDB_NAT_HAIKU_OSDATA_H
+#define GDB_NAT_HAIKU_OSDATA_H

extern LONGEST haiku_common_xfer_osdata (const char *annex, gdb_byte *readbuf,
ULONGEST offset, ULONGEST len);

-#endif /* NAT_HAIKU_OSDATA_H */
+#endif /* GDB_NAT_HAIKU_OSDATA_H */
diff --git a/gdb/solib-haiku.c b/gdb/solib-haiku.c
index ba9e548f..0ec56b5c 100644
--- a/gdb/solib-haiku.c
+++ b/gdb/solib-haiku.c
@@ -75,7 +75,7 @@ haiku_solib_create_inferior_hook (int from_tty)
solib_target_so_ops.solib_create_inferior_hook (from_tty);
}

-static intrusive_list<solib>
+static owning_intrusive_list<solib>
haiku_current_sos ()
{
return solib_target_so_ops.current_sos ();
@@ -112,4 +112,9 @@ const struct solib_ops haiku_so_ops = {
.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 5f6a90fe..bd023f5b 100644
--- a/gdb/solib-haiku.h
+++ b/gdb/solib-haiku.h
@@ -17,11 +17,11 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */

-#ifndef SOLIB_HAIKU_H
-#define SOLIB_HAIKU_H
+#ifndef GDB_SOLIB_HAIKU_H
+#define GDB_SOLIB_HAIKU_H

struct solib_ops;

extern const struct solib_ops haiku_so_ops;

-#endif /* solib-haiku.h */
+#endif /* GDB_SOLIB_HAIKU_H */
--
2.43.0