From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by sourceware.org (Postfix) with ESMTPS id 5B3C43858D32 for ; Wed, 27 Dec 2023 18:42:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5B3C43858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5B3C43858D32 Authentication-Results: server2.sourceware.org; arc=fail smtp.remote-ip=192.55.52.88 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1703702534; cv=fail; b=MZGONX2n/cpASm1yuikJvvQ+BC1aepWtbJ+1K8FZXqY1nsyIL9TRcK6kYmMOvBgFFat42lcdTDJCU5cwas16CEwwAt9LEtmIRZwRN4RSlvm4VpFU7MUfUHF9eVvgIXJCMNSG/Fotida/QinNMY3sQSE76JbPZaK/DeTH1L2R67E= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1703702534; c=relaxed/simple; bh=ejJWG3yXpetwUijJPq6MKciXq5AHBr41oSenua0/H4k=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=j7maUKWRRPlFHkCeD8AAZTJcbh9mz33dTA4NtDxtMi45KHfU+P57NuCRxHpH8NwVi4Rk+luEs+Aif4HE/6ytO0kTUbpNaeJsdBaBW8ZNlpIHkst5ZAJo4dBPfBzfdWJjenW0gWehRYBIk+AAW01wmDR/vPwWQCUKtHMAX4Fo3Kw= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703702531; x=1735238531; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version:content-transfer-encoding; bh=ejJWG3yXpetwUijJPq6MKciXq5AHBr41oSenua0/H4k=; b=bE9E8OIAxAQl18kqiuwdSOxjGeRjBWs+Z/Qn073Raj6oEHpyrxFC9uJx pn44nHDeNVzp0p8mXLwPJGMu2OzY0ieqE3HNh2XNhnzcGy01c2fwJBQsb vThZwX+vIVY5TC5gqOnyH6MQawroAXGEg46fTrRikxl33AqxWzWU01R62 PeazVUaI2RoHOInad1EongoQRKsAk75dG1bVdr6DO2UPUolDdQqHZ3pwD 1I2mKD6MTdQJtxlH6YFUfOyAMNWZCcAYrCijbH4r4djUaZGp2CtZRG6W/ QRXYLjMDmJqPnTtADVcfsdNff1bwFFWCMzmf8FkBFmQmz1vYbMNnd3zsW g==; X-IronPort-AV: E=McAfee;i="6600,9927,10936"; a="427644950" X-IronPort-AV: E=Sophos;i="6.04,310,1695711600"; d="scan'208";a="427644950" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Dec 2023 10:41:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,310,1695711600"; d="scan'208";a="26637582" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orviesa001.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 27 Dec 2023 10:41:57 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 27 Dec 2023 10:41:55 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Wed, 27 Dec 2023 10:41:55 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.168) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 27 Dec 2023 10:41:55 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B9EZtReEeZ18/uAn0uS8JxNjB9jQ0ZWUGxI5RDmorDySxWD1zWW8pzhBQVsAeqF+ahMK4hmUO7ibUsy+zfEZkkN//liPDBAkKnRIxL8a9HlWyzvlg7UpOXGex1rhvdw0K7Jk0Ued2MZO2lFo2lM1CJhVKr6GyeFaRUQ9ExV9r9cZ/U91iB+Hp2r0460M+6cV+NMf/KUjVGhE8z0ZkVVt8HIxEout5u90ZylZCgH8YAc2jhWCetI7R5Wee/RjxyEjt2ve7AyZt7RKmlDm7Io9D/cCdrOopDK7+04XJNfSVoLpDf41l+VrVkmy+VGUbTPfQlEuA3ejOq0pjOPuDC9/QQ== 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=HNkciWiQuj2NoqnTJ9wmWUo01gGJH3Cl1slao1Q7WMg=; b=ZGJpag7DRIIBo3BLD0IU7fOcPBMW636xyLC43cc7DTYPQtvJeAtK5BMYa8LvUGAMqzj/cgJvmtjih6G5Uom0bkq7ZXSss1Ky/Rp12TmgkBJwUTbmsl+FqE/eOJ4UAdZxuIactf6P6xT1JF6a14DU8UiCBy6gm+NVonxCiTixI+hNwAGcTiAxXzCWw17ZkdUXp8fEz8uAXdNabu7dweCEC71qMGfUGLhH96gZ2yBmgMkp8n5pd1czhcX72yGGFFYsL8i5xXagljoShjfZXIxJqLGzwAKOVt9hHtSn8f6k5bVaokJSi8wSkIK6MMl5ghqe8Nc6yXMIhgXx1tvINiUqew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM4PR11MB7303.namprd11.prod.outlook.com (2603:10b6:8:108::21) by DS0PR11MB7622.namprd11.prod.outlook.com (2603:10b6:8:144::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27; Wed, 27 Dec 2023 18:41:53 +0000 Received: from DM4PR11MB7303.namprd11.prod.outlook.com ([fe80::b960:9754:455d:b195]) by DM4PR11MB7303.namprd11.prod.outlook.com ([fe80::b960:9754:455d:b195%7]) with mapi id 15.20.7113.027; Wed, 27 Dec 2023 18:41:53 +0000 From: "Aktemur, Tankut Baris" To: Eli Zaretskii , John Baldwin CC: "gdb-patches@sourceware.org" Subject: RE: [PATCH v4 2/2] gdb: raise and handle NOT_AVAILABLE_ERROR when accessing frame PC Thread-Topic: [PATCH v4 2/2] gdb: raise and handle NOT_AVAILABLE_ERROR when accessing frame PC Thread-Index: AQHaMcBHdYbnwcUSq0WEM67ZrKmmALCyvEOAgACR1riACjWHoA== Date: Wed, 27 Dec 2023 18:41:52 +0000 Message-ID: References: <6fb2a95f5999118e30ac972503be4bec35b092ac.1702909611.git.tankut.baris.aktemur@intel.com> <1aa5010d-e17c-484b-b0cb-c1bf67b2f71d@FreeBSD.org> <838r5ogiqs.fsf@gnu.org> In-Reply-To: <838r5ogiqs.fsf@gnu.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM4PR11MB7303:EE_|DS0PR11MB7622:EE_ x-ms-office365-filtering-correlation-id: 60ed8a43-ac5b-4c72-96ef-08dc070b7e7a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 8RyRufnC90k+Hxp06lqo+XPQEfqh66VQiiHj+Qj61vZI80cjLNjMpEHJVWyFHVN9ObYm4moNH7LnDsz8kU2G+QRg+F5kEmHYZ4S3NEvC2X44GOm+R7EXeQde45UrXaA5KeOwSomJzM6dUOYOEB78SiAmzTKNId1AZhe5IYVsMhTrhvcZDMNreiZ3L7kzvFwdB9Jl7XoQyA1J6WhDEvvh4UJYlWfZF4DbZzbmXg8Tf/KnKJsPjkDiy1o4JAzD3xXU0WcgJ581iYcIKIjMIe7dfcfh+gNqdMn9GRkJa29oxDVdoxbLS8qSStNHSHr63IDUarN51B1a6CsZh+LTwdAFuHPh9FQ0Vb2+wuXwcwaky2r5hLtzfpm2e0GB8wBis6wicAarj92SyR33AzpecZuYpEFi3WEPkcBR5LRZU823k2m+Pmz23bLHDIJTpbuukACihjuxrQPIPHbsYigS92aa/BM4nnq9gxsTfh9myCRTaM70lTuuqG5H5QS8CAKYY2jfBV1GyX6H5Oz5i3H4IFsCkHwu/HUCu/+tYAppIxKdA6/Sk3m5iyF1FE1/900Y6vlGyLdBMROXVsSBS4FXCir0jdd0uCfL5NkOKFXiZ8+Uijw= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR11MB7303.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(376002)(39860400002)(366004)(346002)(136003)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(41300700001)(38070700009)(5660300002)(2906002)(33656002)(53546011)(110136005)(6506007)(7696005)(9686003)(83380400001)(71200400001)(478600001)(8936002)(26005)(4326008)(86362001)(8676002)(55016003)(52536014)(122000001)(38100700002)(82960400001)(66556008)(316002)(66446008)(66946007)(66476007)(64756008)(76116006);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?vpa/oeVLDXVTlS0zaElyHQC1UWlHP6DzVAk3WJa8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mp/z4FE6aH+xWL3/lnwgLE1nZKdtpiUxozeMANjODZYm08I?= =?us-ascii?Q?E+J0qIZPezvNAaMOiLkis6c50RFUbiDPuGM9Bx0cLPFlB7KA5glFPF/3wnUO?= =?us-ascii?Q?u2QpXLs/QBhKeA/2CTdne96jGWmhQGpEnVKqrtx8QG9QMnR/DJLsTtftDvfF?= =?us-ascii?Q?yYrb6ByE16atCS2UPxkZn7n1cj2q+Iyu+c5sqGeitsVV9p1Ezc5hhpJpUIvt?= =?us-ascii?Q?+1ijA5fomky5zNq4uvJF/mv/wp3/beShjtxCbe06ywWSYUZd5EUL7OcN6zbZ?= =?us-ascii?Q?fCg0WVVY/p3Bj2vzGljm7o/BZNrCW6Uw/Gbg7IKTGTAEdjqdaZk/iuAl+gY5?= =?us-ascii?Q?XM1eBGqUGl9Tp9eumyduY/xOxM3kWHBAwoJd3EJEH9V0JncYbT+WzznxhiBN?= =?us-ascii?Q?1j+AcPe/mNNG8imCt6LkqvhcI31WpujYaqn8bt5RZqGZ54RZgBU2iHmewYsE?= =?us-ascii?Q?hABzOJlEfFvbXMOWVjIWBc3hUWutXpCrScGnQe7LG6R70fpMndwfIaFvnyh9?= =?us-ascii?Q?UgdiS7oworUIdVNiApMltEvPhs2KaD+R7gUNM9tl6X0LZe7o/ShKKWrSae8l?= =?us-ascii?Q?48hzVj2TSn7nY/A0q25Q0UCcPW8Md6DjN4KOdNKAwlHg//EmA+wXnjq17RiA?= =?us-ascii?Q?VSdNrb0RVlUdxSF+yjxdR+Kii7ecrwRtX7TOjjJW8IvFrGTbrGAIQdZuzJcu?= =?us-ascii?Q?9w=3D=3D?= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB7303.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 60ed8a43-ac5b-4c72-96ef-08dc070b7e7a X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2023 18:41:52.7119 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 0OAnyepB491pNFQT/HzgSl7J2exzL10O59FkT2GQPflpF6LGnGnydoU5PL9Eml1BFhI/FyxaPgCTUrJB/D5yq3qoKzHYCMB5/X3FSGsr9F0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7622 X-OriginatorOrg: intel.com Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,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: On Thursday, December 21, 2023 7:42 AM, Eli Zaretskii wrote: > > Date: Wed, 20 Dec 2023 14:00:03 -0800 > > From: John Baldwin > > > > > --- a/gdb/amd64-linux-nat.c > > > +++ b/gdb/amd64-linux-nat.c > > > @@ -223,7 +223,10 @@ amd64_linux_nat_target::fetch_registers (struct = regcache *regcache, > int regnum) > > > elf_gregset_t regs; > > > > > > if (ptrace (PTRACE_GETREGS, tid, 0, (long) ®s) < 0) > > > - perror_with_name (_("Couldn't get registers")); > > > + { > > > + std::string msg =3D perror_string (_("Couldn't get registers")); > > > + throw_error (NOT_AVAILABLE_ERROR, "%s", msg.c_str ()); > > > + } > > > > Should other nat backends for other OS's (and other arches) also > > make this change when failing to fetch registers? > = > That's probably a good idea, yes. Yes. I didn't do that, however, because I don't have a chance to do regres= sion testing for the other targets. > But I also wonder whether the difference between > = > Couldn't get registers: No such process. > = > or > = > Could not read registers; remote failure reply 'E01' > = > and > = > > = > or > = > Backtrace stopped: not enough registers or memory available to unwind f= urther > = > is such a significant improvement in terms of UX. Both the "before" > and "after" messages allude to issues that are extremely technical and > obscure, IMO. If anything, "No such process" sounds better to me than > "", because the former explicitly > explains the reason in high-level terms understood by anyone, while > the latter alludes to the PC register, which is a GDB abstraction, and > the fact that some register is not available doesn't necessarily tell > me what is wrong in practical terms. > = > IOW, it seems to me that, when we catch the error, we ought to produce > some meaningful message, and with this change we don't yet do that. > = > Does this make sense? We can remember the reason in regcache for why a particular register became unavailable and use that reason in the error messages. With such a change, the output for the first case would become (gdb) start ... (gdb) info inferior Num Description Connection Executable * 1 process 1017286 1 (native) /tmp/a.out (gdb) shell kill -9 1017286 (gdb) maintenance flush register-cache Register cache flushed. (gdb) info threads Id Target Id Frame * 1 Thread 0x7ffff7d87740 (LWP 1017286) "a.out" (gdb) backtrace #0 Backtrace stopped: not enough registers or memory available to unwind= further (gdb) inferior 1 [Switching to inferior 1 [process 1017286] (/tmp/a.out)] [Switching to thread 1 (Thread 0x7ffff7d87740 (LWP 1017286))] #0 (gdb) thread [Current thread is 1 (Thread 0x7ffff7d87740 (LWP 1017286))] (gdb) Does this look acceptable? Regards -Baris Intel Deutschland GmbH Registered Address: Am Campeon 10, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva = Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928