From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2066.outbound.protection.outlook.com [40.107.244.66]) by sourceware.org (Postfix) with ESMTPS id 9B5C13858006 for ; Tue, 13 Feb 2024 15:37:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9B5C13858006 Authentication-Results: sourceware.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=amd.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9B5C13858006 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.244.66 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1707838625; cv=pass; b=QtuLZS5h6QJeizUU2ZpRRTs8585itBslb0G3pmsNMakdrwwo98pN4pLPhmyAUjLK0orj9E/Qx5Bs0pPYV+w1MCgsWXmDSvO4/p067TkuLcYLF+d0on660Q4UiwjoT4+OMbMGT8euEuOBu1yZ7HTOr/TSyuQbZclz7+cFPVXSYqg= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1707838625; c=relaxed/simple; bh=pPUC+gw9dyA1+GqWX6og5CGssM7RbVIs5VSEHqYrNjs=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=GmzfqRabIYw4ksIkHCgAN650/gOIaBJxp74G8SeKZ0TZ3u/Q351xgxky4VhxI4Q4t4O0p/0Xc0gxW6LXtcODoFlfy07irqURcfvWXDFvlkBQilQMzwPk3hLNrr0DFTR6/fZIWtaichu11TvxAU0Gj1qPBTm9tNhn+jIgM8J/tiE= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DGi0l7QLyDpQHEpEdFyFI73Q/InU9uIgTYzTE28MZlSAiN1PB9apFE8TpPxlldQNPnU6fmuogsYQ3fp5IDbXu5kOA7Ua3WYXrE4YlgMA4aEYAuy1hIeKuYM29iewRz37Etl7o6I3XWPLYnFAoYzEj4KS8EdCxdwHpiSClBoIpqzu2+hhGqSPzEb6EwUssleIxaKPy6NBjQVCahKEESfc8oqZyLjkvfTsGUmAXS5spSlxOSbr5qJFNo1oqzET+t5YEJjaYX+Q5gofbukjX6Cj6EB9pZtTUv6viox4ClkduMuw75OAoPig7lSBcET5QHVUEw/JktH9yZe8wMETWmjieQ== 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=V88P9j8B8n5H5XzURwO1pIjm/px2qbJ9OVXK4Wfuyl4=; b=Jn2vOkxdsEOu7Jojf3Z9W0Owq+tcraS182zn/0xZ9OvUrqoohgIthptQOffWC7/a8BWYrh1bSEpmSVYHFxczR61YlOaRBoeCZkMc/s47ZMVAKb2rHshIsrpEMsPFZdGXryWOIugY3jKszDIXD9iRuYx77h+8kbBIXCmlCsULg/T1snGmHfnZBhUzxOZT9ambh/W3CYWNIrNm1sK9dSveboaD8XK1/wGNB8o2RwkiRjeqR8QbhBJy68/wTor7i774ARSEXEGIaEAkCRCTrUThPw+TqCRT/LNr2eGqf/cLr7IfzTueev7vS4BKJ5q4J7b/RrDfw65LtjgCQLSvZE7riQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=palves.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=V88P9j8B8n5H5XzURwO1pIjm/px2qbJ9OVXK4Wfuyl4=; b=ooebqnYfBe1885Trrb5eYqo8opms2Z+NoXeOmC66Z0kezby4APfH23ly+UvuQGChQjM4Xb9S7Eq7bP0RzTGuM2gT5JiULxgR2vKFQ1q/MSpDrKKizl/REHzXRNwwrKaRYp8QpF0W6MP+m1HMbXjPNI4htdAHza+ZlIUfuMf+348= Received: from SJ0PR05CA0015.namprd05.prod.outlook.com (2603:10b6:a03:33b::20) by MW3PR12MB4473.namprd12.prod.outlook.com (2603:10b6:303:56::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.23; Tue, 13 Feb 2024 15:37:00 +0000 Received: from SJ1PEPF00001CE5.namprd03.prod.outlook.com (2603:10b6:a03:33b:cafe::37) by SJ0PR05CA0015.outlook.office365.com (2603:10b6:a03:33b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.26 via Frontend Transport; Tue, 13 Feb 2024 15:37:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ1PEPF00001CE5.mail.protection.outlook.com (10.167.242.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7292.25 via Frontend Transport; Tue, 13 Feb 2024 15:36:59 +0000 Received: from khazad-dum (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 13 Feb 2024 09:36:58 -0600 Date: Tue, 13 Feb 2024 15:36:50 +0000 From: Lancelot SIX To: Pedro Alves CC: Subject: Re: [PATCH 2/3] Improve vRun error reporting Message-ID: <20240213153630.okemgelkklyrf3r4@khazad-dum> References: <20240212200153.882582-1-pedro@palves.net> <20240212200153.882582-3-pedro@palves.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20240212200153.882582-3-pedro@palves.net> X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE5:EE_|MW3PR12MB4473:EE_ X-MS-Office365-Filtering-Correlation-Id: e5bcf87d-834d-4bac-f990-08dc2ca99e8c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lhDfv6uezKASDJUN8+kafJILmm/rcQhjHv60VRtYda4rAuyVdLqg7Thr8QqpGkiY2NL98H18iwCTcHp4WekTOc1jCjkIZIdBUCK7zXu+Z8E0tgiJU5pCNtqb58JK1xR+hn5X80YD5Sb3K9GTA1639Daptp9R5EIiFYImBbQ76dMSlfieBVIhBx7E5onM1zrgCRhTELdl0pygZfW+4eL/dbrs5sarjVXYnd3jfwcT1nbtj3CPjNt3Wx2nxgN8pHfRHMgot7V1CfyT8Ksv1AVjifmd5C3SiDvQmxdseqINsdCdq9dpe4SeDWujs/kJmZsdXwI9AfV0ycvaPXEj9PBzmsH8WeTUw1Wb4bOraYsg318if2mCaMLDdfa3BAHTHNLDGnFgFOUxcEpEq7rvhMSkmoT8b9pSwRWFVNYQ+i/LFgawZM/dwckzphP/zrsBFYbD/67IaSWa0W39iuDvFNxzo+BSCU1ijnJic6ewqOB9YGElTxcTRUHbCVkrhIQGKhj63w3g5CG0IDWgteQ8Ttah+z74/CDPGGt9GtDp2DzK0o3injuMMuJ60vO0TLsEY92Nlo1lBEP3PWtvfSlGueAstA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(376002)(346002)(136003)(396003)(230922051799003)(186009)(1800799012)(64100799003)(451199024)(82310400011)(36840700001)(46966006)(40470700004)(55016003)(33716001)(9686003)(966005)(2906002)(5660300002)(4326008)(86362001)(426003)(81166007)(1076003)(356005)(336012)(478600001)(82740400003)(6666004)(316002)(8936002)(83380400001)(8676002)(70586007)(26005)(41300700001)(6916009)(70206006)(16526019);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2024 15:36:59.9652 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e5bcf87d-834d-4bac-f990-08dc2ca99e8c X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE5.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4473 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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: Hi, I only glanced at this patch, but it seems to me that is would conflict with this patch: commit 7e9d8a3627c8a80b76c250b6881b7eb6fc2f4443 Date: Fri Nov 24 14:33:42 2023 +0100 remote.c: Make packet_check_result return a structure https://sourceware.org/pipermail/gdb-patches/2024-February/206483.html I expect that this patch would remove the need for verbose_error_message, you just need to have some changes in remote_target::extended_remote_run. Best, Lancelot. On Mon, Feb 12, 2024 at 08:01:52PM +0000, Pedro Alves wrote: > After the previous commit, if starting the inferior process with "run" > (vRun packet) fails, GDBserver reports an error using the "E." verbose > error packet. On the GDB side, however, GDB doesn't yet do anything > with verbose error strings when handling vRun errors. This commit > fixes that. > > This makes remote debugging output the same as native output, when > possible, another small step in the "local/remote parity" project. > > E.g., before, against GNU/Linux GDBserver: > > (gdb) run > Starting program: .../gdb.base/run-fail-twice/run-fail-twice.nox > Running ".../gdb.base/run-fail-twice/run-fail-twice.nox" on the remote target failed > > After, against GNU/Linux GDBserver (same as native): > > (gdb) run > Starting program: .../gdb.base/run-fail-twice/run-fail-twice.nox > During startup program exited with code 126. > > Change-Id: Ib386f267522603f554b52a885b15229c9639e870 > --- > gdb/remote.c | 23 +++++++++++++++++++++-- > 1 file changed, 21 insertions(+), 2 deletions(-) > > diff --git a/gdb/remote.c b/gdb/remote.c > index b58dbd4cb66..dca5add260a 100644 > --- a/gdb/remote.c > +++ b/gdb/remote.c > @@ -2400,6 +2400,19 @@ add_packet_config_cmd (const unsigned int which_packet, const char *name, > } > } > > +/* Strings that starts with "E.", are verbose error messages, like > + "E.ERROR_MESSAGE". If BUF is such an error message, return a > + pointer to message after the period. Otherwise return NULL. */ > + > +static const char * > +verbose_error_message (const char *buf) > +{ > + if (buf[0] == 'E' && buf[1] == '.') > + return buf + 2; > + else > + return nullptr; > +} > + > static enum packet_result > packet_check_result (const char *buf) > { > @@ -2415,7 +2428,7 @@ packet_check_result (const char *buf) ss> > /* Always treat "E." as an error. This will be used for > more verbose error messages, such as E.memtypes. */ > - if (buf[0] == 'E' && buf[1] == '.') > + if (verbose_error_message (buf) != nullptr) > return PACKET_ERROR; > > /* The packet may or may not be OK. Just assume it is. */ > @@ -10502,7 +10515,13 @@ remote_target::extended_remote_run (const std::string &args) > case PACKET_UNKNOWN: > return -1; > case PACKET_ERROR: > - if (remote_exec_file[0] == '\0') > + /* If we have a verbose error message, print just that. This > + makes remote debugging output the same as native output, when > + possible. */ > + if (const char *msg = verbose_error_message (rs->buf.data ()); > + msg != nullptr) > + error (("%s"), msg); > + else if (remote_exec_file[0] == '\0') > error (_("Running the default executable on the remote target failed; " > "try \"set remote exec-file\"?")); > else > > -- > 2.43.0 >