Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH]  Make target shareable accross fork inferiors in AIX.
@ 2026-06-22  7:04 Aditya Vidyadhar Kamath
  2026-06-23 13:07 ` Ulrich Weigand
  0 siblings, 1 reply; 3+ messages in thread
From: Aditya Vidyadhar Kamath @ 2026-06-22  7:04 UTC (permalink / raw)
  To: ulrich.weigand, simon.marchi, tom
  Cc: gdb-patches, Aditya.Kamath1, sangamesh.swamy

From: Aditya Kamath <Aditya.Kamath1@ibm.com>

Currently in AIX when we follow a child or do not dtach the child during multi-process debugging we get,

(gdb) set detach-on-fork off
(gdb) r
Starting program: /gdb_tests/multi-thread-fork
[New inferior 2 (process 32965026)]
target.c:1194: internal-error: Attempt to push unshareable target: native.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
----- Backtrace -----
0x10092c69b gdb_internal_backtrace_1
        /home/binutils-gdb/gdb/bt-utils.c:122
0x10092c7bf _Z22gdb_internal_backtracev
        /home/binutils-gdb/gdb/bt-utils.c:175
0x10004fdef internal_vproblem
        /home/binutils-gdb/gdb/utils.c:424
0x100050307 _Z15internal_verrorPKciS0_Pc
        /home/binutils-gdb/gdb/utils.c:504

The reason being AIX missed out on making the rs6000_nat_target sharable for the child.

So align AIX native fork handling with Linux by marking rs6000_nat_target shareable.
This avoids internal errors during fork (), during detach-on-fork off and follow-fork-mode child.
---
 gdb/rs6000-aix-nat.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gdb/rs6000-aix-nat.c b/gdb/rs6000-aix-nat.c
index 57eb428cc37..54039d3dc02 100644
--- a/gdb/rs6000-aix-nat.c
+++ b/gdb/rs6000-aix-nat.c
@@ -101,6 +101,11 @@ class rs6000_nat_target final : public inf_ptrace_target
      support.  */
   void follow_fork (inferior *, ptid_t, target_waitkind, bool, bool) override;
 
+  /* Keep AIX as well sharable across inferiors while following fork() 
+     like child process in sync with Linux.  */
+  bool is_shareable () override
+  { return true; }
+
   const struct target_desc *read_description ()  override;
 
   int insert_fork_catchpoint (int) override;
-- 
2.51.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-24  9:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-22  7:04 [PATCH] Make target shareable accross fork inferiors in AIX Aditya Vidyadhar Kamath
2026-06-23 13:07 ` Ulrich Weigand
2026-06-24  9:16   ` Aditya Kamath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox