* [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
* Re: [PATCH] Make target shareable accross fork inferiors in AIX.
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
0 siblings, 1 reply; 3+ messages in thread
From: Ulrich Weigand @ 2026-06-23 13:07 UTC (permalink / raw)
To: akamath996, tom, simon.marchi
Cc: gdb-patches, SANGAMESH MALLAYYA, Aditya Kamath
Aditya Vidyadhar Kamath <akamath996@gmail.com> wrote:
>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; }
>+
This is OK.
Thanks,
Ulrich
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Make target shareable accross fork inferiors in AIX.
2026-06-23 13:07 ` Ulrich Weigand
@ 2026-06-24 9:16 ` Aditya Kamath
0 siblings, 0 replies; 3+ messages in thread
From: Aditya Kamath @ 2026-06-24 9:16 UTC (permalink / raw)
To: Ulrich Weigand, akamath996, tom, simon.marchi
Cc: gdb-patches, SANGAMESH MALLAYYA
[-- Attachment #1: Type: text/plain, Size: 1227 bytes --]
Thank you.
I have pushed the commit.
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=f0769adf6fb5afeb6826982990afad8e6260b1bc
From: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
Date: Tuesday, 23 June 2026 at 6:37 PM
To: akamath996@gmail.com <akamath996@gmail.com>; tom@tromey.com <tom@tromey.com>; simon.marchi@polymtl.ca <simon.marchi@polymtl.ca>
Cc: gdb-patches@sourceware.org <gdb-patches@sourceware.org>; SANGAMESH MALLAYYA <sangamesh.swamy@in.ibm.com>; Aditya Kamath <Aditya.Kamath1@ibm.com>
Subject: Re: [PATCH] Make target shareable accross fork inferiors in AIX.
Aditya Vidyadhar Kamath <akamath996@gmail.com> wrote:
>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; }
>+
This is OK.
Thanks,
Ulrich
[-- Attachment #2: Type: text/html, Size: 3187 bytes --]
^ 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