Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Aditya Vidyadhar Kamath <akamath996@gmail.com>
To: ulrich.weigand@de.ibm.com, simon.marchi@polymtl.ca, tom@tromey.com
Cc: gdb-patches@sourceware.org, Aditya.Kamath1@ibm.com,
	sangamesh.swamy@in.ibm.com
Subject: [PATCH]  Make target shareable accross fork inferiors in AIX.
Date: Mon, 22 Jun 2026 12:34:56 +0530	[thread overview]
Message-ID: <20260622070455.77224-2-akamath996@gmail.com> (raw)

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


             reply	other threads:[~2026-06-22  7:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-22  7:04 Aditya Vidyadhar Kamath [this message]
2026-06-23 13:07 ` Ulrich Weigand
2026-06-24  9:16   ` Aditya Kamath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260622070455.77224-2-akamath996@gmail.com \
    --to=akamath996@gmail.com \
    --cc=Aditya.Kamath1@ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sangamesh.swamy@in.ibm.com \
    --cc=simon.marchi@polymtl.ca \
    --cc=tom@tromey.com \
    --cc=ulrich.weigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox