From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2070.outbound.protection.outlook.com [40.107.22.70]) by sourceware.org (Postfix) with ESMTPS id D81C33858C20 for ; Wed, 9 Mar 2022 07:25:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D81C33858C20 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R99X0+vBYrMqpUbD0hwAMvpj0o2KanO0YMwdLefn0dP9fEcbt9KBge2EpR9/STnrBE2M9cudcr2GtDTpQTKmL4WubCHZiZEvKeN2zQSscwFL52pO60zyAHe0SlJmlGaEkwYjzYAvYmQseBsoqVoaKE72OcIWLQMsshZtEnzTkE9NczCI34zlYUy3pzhXMninFg2XAKou0OlqCObVXaLoL+haZElDp5G6gODDAkLlTTK630CFllvBb8C2crruz1k+4h+MzVVwBxQS4XZoXtrR+FZb6TdWEuy1myjbdCRpDNOj7i9r3nzBJuxAdJHN652uXAGA9zJK2pX8fliu5illZA== 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=Fe6rRpWmT5DW2TQwjaYES/hCIGZMuUNQwe/3iEilV/w=; b=KhRlrtVj+SAXBwj7AK+vuTMrqec3TYS7EAgxSsVDr91CmhC500qg3eoORMX3Sos+RHcfAt3ERjnlFnSvoveAClrU0D1lFDyunIDNkhKCWGevS5+kVdH5mYdUDDGGU1GIABJCLt2Nwrixe6TcWElKivJ+rwNmIPzpEX7ajLiLspGTwnEufhl/YKMDzLaa82cJ6DZIRfaxVVSvvac90EKyHb00pPDmiOH10NYue+kUcWaaKcJAL5AXpoSVEE68vbbCBo52PlyoRSLAEnmNnT+gsQ18lsWxEIsmJv4MVOafmL+cRozL1BeOS4TCIcrOd9peswTWGp1A2Ycd+aYgHOBK3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none Received: from VI1PR0402MB2863.eurprd04.prod.outlook.com (2603:10a6:800:af::18) by AM0PR04MB4961.eurprd04.prod.outlook.com (2603:10a6:208:cf::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14; Wed, 9 Mar 2022 07:25:37 +0000 Received: from VI1PR0402MB2863.eurprd04.prod.outlook.com ([fe80::7573:6988:63b7:b709]) by VI1PR0402MB2863.eurprd04.prod.outlook.com ([fe80::7573:6988:63b7:b709%9]) with mapi id 15.20.5038.027; Wed, 9 Mar 2022 07:25:37 +0000 From: Adrian Oltean To: Tom Tromey , Adrian Oltean via Gdb Subject: Re: Semihosting in GDB 11.1 | Proposed patch for interrupting in sync mode Thread-Topic: Semihosting in GDB 11.1 | Proposed patch for interrupting in sync mode Thread-Index: AdgzhthCC5LnTaSaShSFUrrUznL4HA== Date: Wed, 9 Mar 2022 07:25:36 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1621dc13-ef04-410e-eab5-08da019e01cd x-ms-traffictypediagnostic: AM0PR04MB4961:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: S5yoyb7oHN4n+njSgz6rlpgsJIHN/a3Ztbb+GKQgNEgnRRRjNusq+36nEbrFcxrFJjyw9+YjBB9lhbf06mjYznVSmKyRQCw58mAGLlhBJJiAKH1cSwkcN8+kFvM/tmSOpXzT9WviJWSPV7kUm4G+vTgdrNDM3mwLMMXbi1/CzE+EB2UWEJZvMcwizeGlflMh2uTkHTn4qGmWDhNISZZhWxMOCPOcovEnntdqyVgHwWDT0SKntsX4h5Ua7kQWI5r5JvQdguRUs7D5I5U45k9sgnt02nWHf/ptRb5px0/fHzOgY+BwVfdqNlTMUSNuVLA1kZ/WGFWVS9SOmIw20WBEPIJL0QBDnMkBPQTX0YD1u+qIs5P48cyYGoxrxoMlbjR2IBo3A7CzEU1KCPuivl8rnE1ceC5CuqWkGZul8Vgw72PvcwIrafsgDfOZBvwOhcSA0vdHw5bJdFI5B2rttpzxDvuvewdf+te4+TuJNCCub8J9HSkolzX7w43tDdaO7I8ZB673n0vg6Axv9FEgASJEVWsCJkpgOtb8hLyxZl+FMsxlx7xQmXEVbtzLK2a/1Vx1l/vWl6U2si2JsRz8xx7JyIoTZflCH04yVhf4lE0Ai/ctKHLqiihzIlMn3oYdl/3VJwi4MdEHkoX4EdIt5oAq94cAkhvpRN+2wRh3pA0RvcXRF84STY+8U6upz4zj9uc8yYRKGYfcK3RQ/QCaiFU9wg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR0402MB2863.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(6506007)(7696005)(186003)(122000001)(44832011)(55016003)(53546011)(76116006)(66476007)(52536014)(66446008)(9686003)(66556008)(55236004)(110136005)(64756008)(8936002)(316002)(66946007)(8676002)(26005)(5660300002)(2906002)(33656002)(71200400001)(508600001)(83380400001)(38070700005)(38100700002)(86362001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?8g9R2FMAAPDOh3t11jk58imT4+4F7GLPHKDpP5AeC4YWJkpLNXXu1E356zsd?= =?us-ascii?Q?uQcMH1QcLK6mv5JGPbISilvNAIbpDMU9ViOqDuEW2ySMxtLEe0wbtjhbRpks?= =?us-ascii?Q?CCIrc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r7uCrBABaxJ?= =?us-ascii?Q?ek7zulh1/4nqPnMjxjVPGZQDJrD2b3Mwsl1vsd6RPqmSxNJ76+R0iLvv8NPs?= =?us-ascii?Q?8OTXYeQ7kCgflYcc2O46mNQoCuRuaQZfynB7zVwi4tL+HYNhSufJ0R1MaCNJ?= =?us-ascii?Q?Q+4O2jg9ywYbVr9tF3GD2ZG5yfLpdBjAxItdoIthZ0NsTb+9Qd/4zcxqfnUG?= =?us-ascii?Q?cZBaZ5Xuqw6wxI3vP1HoqtdmDKGvxleDrSz9Izz4QAF3e+oBDY+LhXE5O7af?= =?us-ascii?Q?P917AFUN+7Z/OscImFm3TlUFmJ6U+RYsnlacY1j91TCK7FSwVL+QT/kzE3hZ?= =?us-ascii?Q?IxDcAiVvUP8MQBQAPpX4U5bcfy2w4iUcEOoiuMhHU92E+Wa3CDjrWzuSyqgw?= =?us-ascii?Q?Edcya/+9hLaN3FJ1FbrY5QyKuQYWV87Hn3tAcUTGJRh/8HfVGAH5DHLGcIcj?= =?us-ascii?Q?Ms+qEMEej+SrR2RR0Zk1mSChwnIKwhGI7HMFPOnlfithysUvXE039iDCGcdy?= =?us-ascii?Q?iCbvqELXzWp6CTRbOG1N814bWtLqWeY57XVCxxozgnm8qezUJ0cECZmR/mUl?= =?us-ascii?Q?t5oLea+E2I2nBWe7Mqfw+h2GgqD/qVyy2TC3jVet7Uryn68Rr+dL1zHF/SL3?= =?us-ascii?Q?OSAqEuDpRAQfwpFYMI7g8bI=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR0402MB2863.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1621dc13-ef04-410e-eab5-08da019e01cd X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Mar 2022 07:25:37.0579 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: GW/GmHmWFeiaP5W6MEExf67w/Utee8Akv/hSYKv6SC1a7RFBZ1tU0cO8IxyYwhwhUm2kYlJPGMBf5okZeeIKUw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4961 X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Mar 2022 07:25:41 -0000 Hi Tom, Unfortunately, I could not find ways to adapt all the other components I ha= ve around GDB to=20 work with target-async mode enabled. It is what it is... Regarding the 'H' packet, I had a second look in the RSP specs where it's s= tated that '0' indicates an arbitrary process/thread. So, as you mentioned, I changed the GDB server= code to simply ensure there's a valid thread stopped marked as 'current'. The original imp= lementation incorrectly assimilated '0' with 'first thread' (always). Thank you, Adrian -----Original Message----- From: Tom Tromey =20 Sent: Wednesday, March 9, 2022 12:10 AM To: Adrian Oltean via Gdb Cc: Adrian Oltean Subject: [EXT] Re: Semihosting in GDB 11.1 | Proposed patch for interruptin= g in sync mode Caution: EXT Email >>>>> Adrian Oltean via Gdb writes: > 1. I need to run GDB client in all-stop mode with target-async set to off= . > This seems to be a must in order to make some python scripts=20 > (containing > gdb.post_event('continue')) interact correctly with Eclipse CDT and=20 > with some automation I have around the python scripts. I think it would be better on the whole to figure out a way to make this wo= rk with target-async. In the long run I'd prefer that gdb remove sync targ= et wait entirely -- that the default be target-async everywhere. > but I'd like to know if there's any chance I'll break any use case=20 > with these changes. I don't have the answer to that I'm afraid. > Is the described behavior a known issue inside GDB? Or do I have to=20 > change something in the server to correct the described behavior? > [remote] Sending packet: $Hg0#df I think this request means to switch to any thread for subsequent non-conti= nue/step requests. So, ignoring it is almost the right thing to do, I thin= k the idea is just to ensure that some stopped thread is selected. Tom