From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id ED79E3858CDA for ; Tue, 1 Nov 2022 13:55:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ED79E3858CDA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ibm.com Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2A1Dig7x016222; Tue, 1 Nov 2022 13:55:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : mime-version; s=pp1; bh=PpX8Q2S+9JvJCmYQCzmdk0TPCnmjvCFP00/Vwhf5Zck=; b=kP3HlowcsMuZc/RPFiklAt3N/iWc8PL4h/m6l/F12/zbGPGhtiX4FTGRL6PdZzKMecwb PoUjGy+g6iVbWJa+g5eBX3f5WN0W37em59k9/oP0uPfH512b7jL/XAouoaL4IKSeDD4v 0AtAzftVT9+mi42TBAS6i++LLgcSoBJV951Cr9KqCZTTr41h2tFsQD2STsB9cbZhacSW j/hBLHgG40ICY4WfTii3xKk8EMQd0HwT7ehW4aQSOYSYsNrNXYgTKk80dhVaPcbi9/LN HQZZnBDBIDC02wqTqBtfLDbhMlCEUfew1ZiFgE0CrbVZ9l0Xsftj8CefOZ3dovC7k2IH QA== Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2171.outbound.protection.outlook.com [104.47.57.171]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3kjrugdt5b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 01 Nov 2022 13:55:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=giw9qp/sA1BbPHPAwG2vBJkFKKBg3KQTCwjx8LGgfkOEnPHtTrRzd5Cfutr78Pc9XmkLn6/m7rsNv94B1/b5a8h064rl0IB+aajLXVhXJVQbJQl2uW31xfj83dbsNx4Cyd+UMso5fmZGv6nc7q7ak2Jd0W7BWw7L4W9MLkGoW7IfGxkKiXqDzn5B/L1e0rDOz7hyHa+ggh3mVEI15NWF38eFpVGZT0FnuDv77FUas2r1SBJQ/eY8SMG3lYW93NjLAbhFTuTWqmK2OwMtvt+33CfsyGWROiMswUfSA7DPa7DGcQPZjhTQUrDTY6C217yzEtnIZ/AZhrkn0uYgKHPK8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PpX8Q2S+9JvJCmYQCzmdk0TPCnmjvCFP00/Vwhf5Zck=; b=nox70I8+ons4Wju7yiYsnLImjSIAQPV4VaZVo/gvsjgpJZnQ2RQgmaFVN5B7B/iGhziCI4rYvubvO1GzKEz2QneHUzxPipKSEPLT+A5ErxL28VWxy7yuZN/DBbb4vzRPszLi4RId2DzzCJrqC0zsnTAYNdfRgftMK8JucPBanuaU8j880C/srIaLkYwpPC5bU2JgQI32sXFiMUfg770orXRGu8YuHMOoJuQhnFSyHqQUHFHibaqZqbKTXqYY6Q/VlUx1bnviP+kaVAfQJctSklHJesXebZTbEBzDmrUF+9VKVAQrgDQATznXW/2GokV1mIHZjDaSZjvCUP4GHDeOgQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ibm.com; dmarc=pass action=none header.from=ibm.com; dkim=pass header.d=ibm.com; arc=none Received: from CH2PR15MB3544.namprd15.prod.outlook.com (2603:10b6:610:5::26) by CY4PR15MB1478.namprd15.prod.outlook.com (2603:10b6:903:fe::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.14; Tue, 1 Nov 2022 13:55:35 +0000 Received: from CH2PR15MB3544.namprd15.prod.outlook.com ([fe80::c10d:739:fb18:284e]) by CH2PR15MB3544.namprd15.prod.outlook.com ([fe80::c10d:739:fb18:284e%3]) with mapi id 15.20.5769.021; Tue, 1 Nov 2022 13:55:35 +0000 From: Aditya Kamath1 To: Ulrich Weigand , "simark@simark.ca" , "gdb-patches@sourceware.org" CC: Sangamesh Mallayya Subject: Re: [PATCH] Enable multi process debugging for AIX Thread-Topic: [PATCH] Enable multi process debugging for AIX Thread-Index: AQHYtiqs7fBWvNWu7U6EFq8QRxtmC64V4wdUgA4pNoCABnmrIw== Date: Tue, 1 Nov 2022 13:55:35 +0000 Message-ID: References: <44ad453e-6196-d334-312f-d5d0414f4476@simark.ca> <709f1a28ed9d4b0d4aac5cb6d6946e2de452a3ec.camel@de.ibm.com> In-Reply-To: <709f1a28ed9d4b0d4aac5cb6d6946e2de452a3ec.camel@de.ibm.com> Accept-Language: en-IN, en-US Content-Language: en-IN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CH2PR15MB3544:EE_|CY4PR15MB1478:EE_ x-ms-office365-filtering-correlation-id: bfbb62a4-5bf4-4f2c-559f-08dabc10c027 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cPWiMTT8Zae8lDwKr2oMGhWQGNDXmlPGf9+ucC0yy4xfAfIQCKDsmSjWVz04f6UQ9jrVDzXI5HjFyN87YADW2U/HQ+lbMbI8liPU7vSXhiviGg/jEbGgm3aO835Boea50Kc19hEKuz+BK9/tePoOyK0TPmNiP9y4JmO6ly/PgdtBX634JZof29+jch3tLTqo2xeduxX+LXm+mKjyHVNr+5J2eEqcCAvc7Rt7c7/eXxb4RtXlEo4j3BtK1Dd88ycQU4Sa7hAfmSEbYrd0jWn3MIi9vCLwhlIuccqIrvpQCtbPdvVvuvO/stW+/Q8xnlClnzJRdBFy1Owxr3q+MvzuQp9dFTuKMaoyENriayt/yv650A5OSDLY9urpIkLdASMpb5ZDc3DslB5tuQD95vx8f2ZbnpBNSl2OOEG1BqEXbyWfAgArCmLbUkCZgP0vtw4s+ftywCIP5FVvYVU4Zd1nPK38Opc1P60U2zwyMb1pYDiW3bjEwt7zgabAcTkULQMiQ3QOCKhihZvKoA+foIBgXmGpGor9eKg3PbOY9uB6CPaCRrAI47zHPC1zwRVX/tGMfPfP0/6Qy/4+uaSsiEXFAZDVCGnTKRncP/CtYmDXXbS5bvrCDl5l3hy2f/pp6BY9HErtcmco62IaBzbmVufcF1BM481MZTnbPjVy2bZSw+pUN8OzZtObeD7PxBogOpJrq39tWXjeJphfjcf3Ah356hkGwUZraYPLMHL/8Dt5j6Ypwqo0whd/mYnqd3mi8VL0M6nyHi3flfTi2/RRY7I4pA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH2PR15MB3544.namprd15.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(39860400002)(366004)(376002)(136003)(346002)(396003)(451199015)(478600001)(19627405001)(71200400001)(110136005)(66899015)(38070700005)(2906002)(186003)(41300700001)(122000001)(9686003)(38100700002)(316002)(66946007)(76116006)(64756008)(66446008)(66556008)(66476007)(8676002)(4326008)(91956017)(53546011)(5660300002)(33656002)(55016003)(86362001)(7696005)(6506007)(8936002)(52536014);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?q1McOmTRjIPozHCWJkU6NVk5sX5LWhbotuUIZ0auuzey8FxcmIhw1zhGts0E?= =?us-ascii?Q?u8D6q8EhymUYYmz9HUzLD60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q?YVudpX/T0qmbpkq/VTohIPci/w7QVPDlisKxSCoW4eltjYub8bwCIpWxlHiv?= =?us-ascii?Q?V3kPyk98KTZkiIzODvQX7/gnj0YOIqGAEiDHgmbvHbBHerKZk21BifpnoAK7?= =?us-ascii?Q?XLXb3tsIv+j4lb27cXVlnBSClUXDtWVK6/EAESERpKV7ar3l96C1FFTJIQnF?= =?us-ascii?Q?aYzC3/k7+GZRxf7W2U5Ed94gQYMkb3GICkId44U1bAzowoAkElsymLLAi7/E?= =?us-ascii?Q?APY/k17BZ56//5BXZNsyqCdN+FvLG+N64NmjR0ujnH6difZ2ercnEF0ikBQv?= =?us-ascii?Q?/ibOMMNtViI/+9eKLzzsKEGNXEPZoAGbXaUmcotLBCJrE+jE/6Fw+7qHyMgi?= =?us-ascii?Q?N0j7q7p2IoiY3EQ4dMwp9dd9FJQmEvUKJGBOm4+e4P+ZILRBNoheo8btfK81?= =?us-ascii?Q?TaE++Inq/M5lAGUagKeQn9ejcmHbPIKaJP8iGyJ22Db0PSjPvhvDFgUtpOSY?= =?us-ascii?Q?UpxsawfR2LST1+DPVWKbICsFNiP4l1ngB4lUdOZbueiJEkLv2HGwGceOxoID?= =?us-ascii?Q?i8wAmLfjvqqYfSiRnslqkzRSqK78M7Y6Rbo4g9EejkQgjwmIPoCyYnE91rMD?= =?us-ascii?Q?hK0Yz2GuTjCvNO6+YDP8bunUMkGWpvklmZWZBpMS9Um/MZeUcouzFrmY4nVI?= =?us-ascii?Q?k3AWLpU2dGaE67v+OWK2+LKFdysV9PxJkfcB8Lv75H67?= Content-Type: multipart/alternative; boundary="_000_CH2PR15MB35441C85018B3AAA2EA46801D6369CH2PR15MB3544namp_" MIME-Version: 1.0 X-OriginatorOrg: ibm.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH2PR15MB3544.namprd15.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bfbb62a4-5bf4-4f2c-559f-08dabc10c027 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2022 13:55:35.5179 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: fcf67057-50c9-4ad4-98f3-ffca64add9e9 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: vFMt1HdFfza7Nl0exU8VRfkl5wBA80PbOFjR6i2zIr36VRdA/b8g6eEF+3r9fOjCJWwwZ1T8QZPeX0eLFuKacQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR15MB1478 X-Proofpoint-GUID: u8fT0KUXOVXUXrvlIb3N10Ymvzh09tGJ X-Proofpoint-ORIG-GUID: u8fT0KUXOVXUXrvlIb3N10Ymvzh09tGJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-01_06,2022-11-01_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 priorityscore=1501 mlxscore=0 suspectscore=0 phishscore=0 impostorscore=0 lowpriorityscore=0 spamscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211010103 X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --_000_CH2PR15MB35441C85018B3AAA2EA46801D6369CH2PR15MB3544namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Ulrich, >There is one difference between AIX and the way freebsd can handle. >freebsd gets the parent child relationship via a structure which has >this info. This is obtained using LWP_INFO option in the ptrace () call. >However, in AIX we do not have the same luxury of LWP_INFO. Is there any other way of figuring out what the parent process of the new child is? Maybe you should just do that when you get the child event. I fully did not get the above suggestion " Maybe you should just do that wh= en you get the child event ". Kindly let me know what you are trying to tell me in this co= ntext. Have a nice day ahead. Thanks and regards, Aditya ________________________________ From: Ulrich Weigand Sent: 28 October 2022 16:29 To: simark@simark.ca ; Aditya Kamath1 ; gdb-patches@sourceware.org Cc: Sangamesh Mallayya Subject: Re: [PATCH] Enable multi process debugging for AIX Aditya Kamath1 wrote: >I have addressed your issue of having a fork () events from other threads. To clarify: I was not only concerned about *fork* events from other threads, but *any* events from other threads. For example, if a multi-threaded process forks, is it possible that in the time between the parent and child fork events arrive, some other thread hits a breakpoint and that event is reported to GDB? Or if GDB is already debugging multiple processes, could some event from a completely different process arrive in between? >I have kept an assertion as well just in case I get some other event >apart from fork () comes in while I figure out the parent child relationsh= ip. >Ideally, I shouldn't get any other event in AIX. I believe in the scenarios above, you would run into that assertion. I still think that the proper fix is to *not* have any secondary loop around waitpid. Instead, just use the main GDB event loop; it'll get back to you once the second event arrives, and in the meantime other intervening events will be processed as usual. >There is one difference between AIX and the way freebsd can handle. >freebsd gets the parent child relationship via a structure which has >this info. This is obtained using LWP_INFO option in the ptrace () call. >However, in AIX we do not have the same luxury of LWP_INFO. Is there any other way of figuring out what the parent process of the new child is? Maybe you should just do that when you get the child event. >Coming to the W_SFWTED, this also is taken care. Kindly see the >did_aix_inferior_fork () function. This logic seems a bit strange to me: >+ /* If multi-process debug mode is enabled, the status >+ location is set to W_SFWTED. */ >+ >+ status =3D status & 0xff; >+ >+ /* Eliminate the last few bits. If the W_SFWTED is set >+ which is equal to 0x7e, it is a fork event otherwise >+ it is not. */ >+ >+ if (status ^ W_SFWTED) >+ return false; >+ else >+ return true; I understand W_SFWTED is not a bit mask, but simply a value. So shouldn't you just test for "status =3D=3D W_SFWTED"? Also, I'm not sure where the "& 0xff" comes into play. What are the contents of the high bits? The AIX documentation doesn't seem to say ... Bye, Ulrich --_000_CH2PR15MB35441C85018B3AAA2EA46801D6369CH2PR15MB3544namp_--