From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by sourceware.org (Postfix) with ESMTPS id 44A043857C44 for ; Tue, 15 Mar 2022 13:53:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 44A043857C44 X-IronPort-AV: E=McAfee;i="6200,9189,10286"; a="319526065" X-IronPort-AV: E=Sophos;i="5.90,183,1643702400"; d="scan'208";a="319526065" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2022 06:53:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,183,1643702400"; d="scan'208";a="646231241" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by orsmga004.jf.intel.com with ESMTP; 15 Mar 2022 06:53:20 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 15 Mar 2022 06:53:19 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 15 Mar 2022 06:53:19 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21 via Frontend Transport; Tue, 15 Mar 2022 06:53:19 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.170) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.21; Tue, 15 Mar 2022 06:53:19 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O0hAmRzgAsWG8nKtPa0DAzRGCX+KlYnGDHDCVJ6eFaA9PX7GdOwJKUlzln/2nfQg1r7IZ2Tt6Sz7gYbvkx8mtx1LURQDZTwnYQToUtegnrsBQVZmy0sCorcY6Hlk/fbhrMIDhZAiUwVqboFea5Ud7UUH6lQCw4dM4OVjf39PSHUxkXZFBc7xeT/ol0zeL665igPauYuVBMYx6QGkLdBK6OH5HxvXQiJB0XKiwnPdWuxukHqoj2zgJ6zW7jSGoDtcqnpI70XvLeUazmJn+OjOunG+Yf/+htYGaz/5QzOUXLY3zd4ZDcmYFAgHeENY24cYxrPbqXz6Z0Js5V2SCH7bOg== 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=DBXb5pyzAzIJSyv5I6wkQlOg53A2fGdOZi+1K5+p35c=; b=bKRe4pfLMkaLsIB0akkRa+VDxFS2Oimy6+E5Su2/4QONjEtqX0vMuY950j4PvdURwn1ysvvbcSMUUcfB0slMByp2Ke+LOmPc7tgeh/agS6IVYncBOoLeyjkPpcnaeAZlzZwfMvH3iVCZR2rmswfh0D8wFuPIHNoCsdpgFPSzEdwBFZKsYvzzSQlNOhltu4UKvsYbPSCL8NyFxK5D25gPEGwKEMI/En+HA8LOrxEHXOUpne1s8JZy/TjrH9u40yM0VquOv7W+F58Vskc1cE2lI7VOfikKqCMrs/1gH83XGBXvl36uR1NzWkgHxGtsLGrNkPRt3s/JgwGAA28bqWnoHg== 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 DM8PR11MB5749.namprd11.prod.outlook.com (2603:10b6:8:10::15) by BN6PR11MB1635.namprd11.prod.outlook.com (2603:10b6:405:d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.14; Tue, 15 Mar 2022 13:53:17 +0000 Received: from DM8PR11MB5749.namprd11.prod.outlook.com ([fe80::8072:5ca1:297a:f7f9]) by DM8PR11MB5749.namprd11.prod.outlook.com ([fe80::8072:5ca1:297a:f7f9%4]) with mapi id 15.20.5061.029; Tue, 15 Mar 2022 13:53:17 +0000 From: "Metzger, Markus T" To: Andrew Burgess CC: "gdb-patches@sourceware.org" Subject: RE: [PATCH] gdb/x86: handle stap probe arguments in xmm registers Thread-Topic: [PATCH] gdb/x86: handle stap probe arguments in xmm registers Thread-Index: AQHYOFsrWTZ0152K8EKUVAIExYX4/6zAW+xw Date: Tue, 15 Mar 2022 13:53:17 +0000 Message-ID: References: <20220315105446.3348835-1-aburgess@redhat.com> In-Reply-To: <20220315105446.3348835-1-aburgess@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.401.20 dlp-product: dlpe-windows x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a0e98ca4-540a-490a-11e4-08da068b286f x-ms-traffictypediagnostic: BN6PR11MB1635: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: k5m+xyFLKaXuk3aPo0B1yp00sDjl+nWucEdx9t2UZwUYWZCNL+wuKF2Lv9+kYzCaG9oVl7Cp3n7UUfTpPNCAv/kBe8d0GDdK2ZUsNky22FxWyvqfjlxYdj400dAWsiIIfJSX4ijjjmHMBxHWo+Sx73kJudXc0wN3+DdyYzb3zSuiCHU8abCSXPh6NijU8Zzbze1IPgzPAmlIboJ8xtDkXBqRoQA8sWZ0wr3YZYI2BvIPqvqQxCyNeFUKaBHhr5kACoHbt32JMtXoZinlZZn5syJ7Ie3WjLpL2uCXwGL/NzlRT1L/NxXJfJy0PweO3kSGiyU46f+SzKt0SGozkh7mNIGBvZQfmk6k4cIT3Jw4g5V6kYu53ubxVjO6OJOnN9wy/YIRrzZkiXQ66oEhPkfhd6HiN2AhnOtnJBh/tOoqa2Z407LjJFbIHZ17+1fN/T4ZegLyCelWmKkHNRgn+WBxxCObYQKSIN2v5qrRMs7mbz3VEaKvjFkcfZxw8/fHGh9s3VTa3D3fpgCh4JwhCJG5eAONOzs/vn1jFrCdYFIqrsx4kmd4wpotGPYRPCGtMA1Bcfm4maJIKh7dEhS/CAFRx4szkqvW3eSR6AZ9b9tnLGtQrZ3sEWvtpwlonq1VmROf2BOvqYeqcbgPYcKnVXmQav49piDGYlvKHUX3cIKNk6B6dlpbEDl45WvCGk7fc3PgnwPXz1AYYHN4XJ51bVBEkKGRXLk8oW/0RwYJG5EL3CY/G6Wba4A9F9k0sqx3L8RyDIZ8hF8zZ1PvDeGHmjxdREOCbFFsZr9YsnfG19my9I4= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM8PR11MB5749.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(122000001)(38100700002)(26005)(316002)(6916009)(82960400001)(5660300002)(9686003)(38070700005)(7696005)(186003)(6506007)(83380400001)(55016003)(66446008)(66476007)(4326008)(71200400001)(66556008)(66946007)(76116006)(64756008)(52536014)(8676002)(8936002)(2906002)(86362001)(508600001)(84970400001)(33656002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?DI4XEWExF6Yd4qI8gn+pflrKpIqR7kfcYjLmza+uNlbuc/X4cqir9ljPXDGo?= =?us-ascii?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iHYE/Okyq?= =?us-ascii?Q?m3g8H+k+3654kfqGQ7ZDpHipdMFZKl3XEspy0tLG9O/u2dBldkIxOXtJNqOm?= =?us-ascii?Q?V4/lWM1dtwPcgtmN754UrBJrrNPZkvA9qc7KatuHO0k7e4hxn5+qFVMdLspa?= =?us-ascii?Q?AJPy3N2o7uuo+ZjKo5VJq9CJRyxIBtsK4VHlDOIZ7Dpa+RhBtWaAGKy/qa4Y?= =?us-ascii?Q?JDRMyjgHNKBKPXoBjbafnNFafDPWiESZApgRNQbE+XOFTqFGvzKdqrlz2mzC?= =?us-ascii?Q?lAxtuS1ztUQT7LZ88GFiRBeVKDcojqYi6n6kj1sUn2v6QGm5mg4h3U0pzbjo?= =?us-ascii?Q?+Nu+mDgfljbk5/8FKRdKQ4YWF1ovX+5f4mBzGRHu7pTV+4mSsbY36yGVV4Xr?= =?us-ascii?Q?775GpvkSqDbgHxWtudmivU89oy7UFXlVYWd+splUmj0k9APjm1vJru3CwQr8?= =?us-ascii?Q?hk4xyM5wkvp8AEIb3z1E/LnweSYPLHFB5so1h1/YhU3XrSKbN6RpOk9Pmpme?= =?us-ascii?Q?/V5+dYtfmX9SbGzeJAyp+0uH+XzcddLbUohUKnHcbFu+xZ9Z1i3hrg=3D=3D?= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8PR11MB5749.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a0e98ca4-540a-490a-11e4-08da068b286f X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Mar 2022 13:53:17.3841 (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: cC9Q8SKPTV53qTUQcS459UfZC0xNSb9SHo99hFNlTOvIzvsnJyqTUJWqb58nNyhPZnHfQuNw8pQVlM2hhdjJgejtS51IKw3HDljeFaOYbNs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1635 X-OriginatorOrg: intel.com Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, 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-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2022 13:53:25 -0000 Hello Andrew, >On x86 machines with xmm register, and with recent versions of >systemtap (and gcc?), it can occur that stap probe arguments will be >placed into xmm registers. I ran into the same problem with solib probes stapsdt 0x00000042 NT_STAPSDT (SystemTap probe descrip= tors) Provider: rtld Name: unmap_complete Location: 0x0000000000002d88, Base: 0x000000000002ecdb, Semaphore: 0x00= 00000000000000 Arguments: -8@-112(%rbp) 8@%xmm1 which results in Invalid cast. warning: Probes-based dynamic linker interface failed. Reverting to original interface. on dlclose() and can be observed with gdb.base/unload.exp. It doesn't lead to a FAIL but the test could easily be extended to catch this. I extended gdb_continue_to_breakpoint to catch this case for another test I wrote for linker namespaces. diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index a35d08a05de..ab7058121e5 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -729,6 +729,12 @@ proc gdb_continue_to_breakpoint {name {location_patter= n .*}} { = set kfail_pattern "Process record does not support instruction 0xfae64= at.*" gdb_test_multiple "continue" $full_name { + -re "Corrupted shared library list.*$gdb_prompt $" { + fail "$full_name: shared library list corrupted" + } + -re "Invalid cast\.\r\nwarning: Probes-based dynamic linker interfa= ce failed.*$gdb_prompt $" { + fail "$full_name: probes interface failure" + } -re "(?:Breakpoint|Temporary breakpoint) .* (at|in) $location_patte= rn\r\n$gdb_prompt $" { pass $full_name } >My second plan involves adding a new expression type to GDB called >unop_extract_operation. This new expression takes a value and a type, >during evaluation the value contents are fetched, and then a new value >is extracted from the value contents (based on type). This is similar >to the following C expression: > > result_value =3D *((output_type *) &input_value); > >Obviously we can't actually build this expression in this case, as the >input_value is in a register, but hopefully the above makes it clearer >what I'm trying to do. The extract approach looks good to me and I can confirm that your patch fixes the issue I've seen with dlclose() and the probe interface. I was about to try changing the register operator to provide the expected type but then I started wondering why we would want to assign a type to registers, at all. A register provides storage but the actual interpretation of that storage is left to the instructions that operate on the register and, as we can see here, compilers may use that storage in novel ways. I see how it might be nice to have some default display type for printing values in 'info reg'. But also that has become a challenge with vector registers where we interpret the bits as vectors of different length and element type. Maybe we should leave it completely to the command that prints register values (e.g. 'info reg') to define the type in which to interpret the bits (e.g. via a set of options) and leave register values themselves untyped. Regards, Markus. 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