From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id RgctKCbglWL2bgkAWB0awg (envelope-from ) for ; Tue, 31 May 2022 05:30:14 -0400 Received: by simark.ca (Postfix, from userid 112) id 9AC271E221; Tue, 31 May 2022 05:30:14 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=RNsaSPtc; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 5871D1E00D for ; Tue, 31 May 2022 05:30:13 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 00E0C3856DC0 for ; Tue, 31 May 2022 09:30:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 00E0C3856DC0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1653989413; bh=Md7cyEbhALrt4/JwRb3gzgDCmruQPobwjMLTAJ0XUqk=; h=To:Subject:Date:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=RNsaSPtc8KPlM460FJPEZuTiafYgs5Y0jikx+D23KcfspaB7u8zuT4h7J5wXGUqiJ uyDesDkYe90hlSroGRWrsfc9y0ztJdgNFuAmIee72JQWvpiHMVK2UPc0hRqRvOzSWc 9uzs8gMcR689cfwYJU/kgQkCQIpPgJQlagZ8I7vs= Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by sourceware.org (Postfix) with ESMTPS id E1CC63857BB2 for ; Tue, 31 May 2022 09:29:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E1CC63857BB2 X-IronPort-AV: E=McAfee;i="6400,9594,10363"; a="274924357" X-IronPort-AV: E=Sophos;i="5.91,264,1647327600"; d="scan'208";a="274924357" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 02:29:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,264,1647327600"; d="scan'208";a="605580495" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga008.jf.intel.com with ESMTP; 31 May 2022 02:29:51 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 31 May 2022 02:29:51 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 31 May 2022 02:29:50 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Tue, 31 May 2022 02:29:50 -0700 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.42) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Tue, 31 May 2022 02:29:50 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HHtf1nV7wCwhcF6vGp+4AOLofLRN/prZm7uTfo0GUrSd+a3UXM0q27PJfD0cu8F78iS+oJ1tgjaQ6nGD+f9dRfp+HCzFty3KjbLBDR89/BNw6RwuAZ6MAR7uQR6XI+OZ6PLjKk2Bhs6VoFc3nrQK7Cw6zj6dTAE48kgD/0+/XPi4Mq8aWdUkuTzNDg3ArN332ORNO5CU1MRnV+v6xrVYjPuHV2RVoEJUXHEWSO85sbz+scCrhFIwd0YgktUuKfaRoYEYExuFJfXOfLvQMHAw3DT/JyN9IsghPev1ZVdhW8OtHcibB/fMuSV272fO74zIQO7RKoAdjN39RUD0bFyvbw== 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=NGoFWYvwPzJl5TdhbgbEOEt0EsBENN9RHxW2qIq1knE=; b=PZhsfT71vmXz3aQi01oYK00n2W1kw4QXOSZMROk0GbEB8LVp2T5GfNxCcb0EesJsCCmfYWVccdiO9SMvAtuzNRFcTOlVc1DKO5+PK4wzocdpkPxjP9SioVH+CcPx3Ssd50b47bu/GmujbCz0SUt2cBwv8D2v8p2s7F3lZE5asB7gM3RQ4uyAYs7R9nwWTtl1F60MD3/vtb0mr23/7gD932krUpf4qWuHegJHMvNTaRjVRDM+d/FnXNiR5+wd7nKXK2B+JgfklqJ3agrYraMeRdBYoobTbpNTA73+OAuJIB4/q6YDG5waXIuwaP0e4DUvqfoB7pfo4Cjc91z5YnuLyw== 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 MW3PR11MB4681.namprd11.prod.outlook.com (2603:10b6:303:57::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Tue, 31 May 2022 09:29:49 +0000 Received: from DM8PR11MB5749.namprd11.prod.outlook.com ([fe80::4c:7f74:797d:837e]) by DM8PR11MB5749.namprd11.prod.outlook.com ([fe80::4c:7f74:797d:837e%5]) with mapi id 15.20.5293.019; Tue, 31 May 2022 09:29:49 +0000 To: Kevin Buettner , Ben Woodard Subject: RE: [PATCH v4] gdb, gdbserver: support dlmopen() Thread-Topic: [PATCH v4] gdb, gdbserver: support dlmopen() Thread-Index: AQHX27+g14KH1lzgikK5e/1QZuBpxq0w/ZwAgAjE28A= Date: Tue, 31 May 2022 09:29:49 +0000 Message-ID: References: <20211117142812.3685162-1-markus.t.metzger@intel.com> <20220525101204.087efe18@f35-zws-1> In-Reply-To: <20220525101204.087efe18@f35-zws-1> 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: 80e6b337-d62d-4053-6e20-08da42e81bd8 x-ms-traffictypediagnostic: MW3PR11MB4681: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: obZsOtgNaS42RvshshQmXyFUOapxsNoC7xSqx8FtszMYrUaclAkbQlk1iADgQ7ZrFAeJ6BznEtERlQE6XL44TJwjlFTTE3rUaZljJr3OEci50vctjeZco7bVVmjCCKmH6zel1T8RVvU0lFC9xu9qc63ZKRNlgPk1G+GUqM5o8d0eLcB8U88lw5rHdAQ75KR46OTn5PRj8H2zF+7uetVQNRGFb+xqy/dL4vbpCcyFusFdNlr+fg5l0C7Avts4driydyHz1IyyaEnSRoZWuG7X3OaXwG/bdoWRSGxIkm+OTn7X9fUYRHOKvTgPnC054csQzdLKUOjeKE35N93alflXnJbI6NofljTnzGTKJL8HVzcuoippGGWdEcdzuTSbVPvTXL76lcwAH9VozLY5cTKBTPdjDZs5/Nfw7FfHuTapZoejbvGrAAM/SVhu/bLS4mf8btZhqd2TUSXExnxPqB6i9MpJLlNKoIMysSeTt6T9Ae3rg4Z0uLrAlYJJTmfp99pxR+42QAd5cTBnyS5z61/dyrsAr0GZqir4hYA/i9RoC5poFdR7SLDxCDHb/JlI0d0skaA13Yhq3RPIAuEPrf7zTWNdbU6cNz3eyh3txlxYkhJmkoTKraDv2NXo2r7cjbrNfwxZK+YG+E+XDF40JQist5CY+0qHk+iEOBM1w+uEw7xIYyYi8RQqQbW292iMu/hjA1DEYGsMKvAMZlE/Q38GVA== 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)(83380400001)(110136005)(508600001)(52536014)(8936002)(7696005)(6506007)(38100700002)(5660300002)(33656002)(64756008)(86362001)(26005)(55016003)(66476007)(186003)(66946007)(66556008)(66446008)(9686003)(76116006)(8676002)(4326008)(2906002)(71200400001)(38070700005)(122000001)(82960400001)(316002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?TUgl+NLzeXl0s5emBuOMwul8i9HEqBQ/cvJLHzW26Mlgl+8OieQHnjyJqUXU?= =?us-ascii?Q?hZvwgiVjORR8PaaTWDfLOGP18H9a21zN5I/2BWdczaCZd+9xGZvb17lV9Dhp?= =?us-ascii?Q?Lc+yR6Rw0v978U3IMPxpyNbcu4JJXllW04xsXBgyVkotp2vjZh6naxhqzcGl?= =?us-asc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cUXqZeIcewPbymtG0p3Fx?= =?us-ascii?Q?r12mKBToE/r5SGFSLfP9dMPSXB5wiZdFrxv87TgEFPkxDfvV9fYk6ZhZpghS?= =?us-ascii?Q?25zOB+8bCor0CdHlFrnXYFOGlOuSPbd7WZQF7QkYMgsuMfKURIMgfP5wLbVx?= =?us-ascii?Q?lxtDOiuUaSy5AsSxwhzvbkh2TgHt22U+2JjRyNkMNg977yxwlJzTRnbV2puP?= =?us-ascii?Q?e95bM/f0Yn1B/Y6PPHP7U6pUAoC+4jkTz0zaT17haJK5q+vGIXhUUbRzALjK?= =?us-ascii?Q?GTlxEjCDfrZzZEv3YVNKdtYTobTCmtxlACsNd5E6CVZShkPy5ioUx/wFZsKK?= =?us-ascii?Q?SUPiBJcz1kAH7oIsMayrbVDlokRuT+9MhURmsFUkoNPal3Tyw5kjRz8qH9m6?= =?us-ascii?Q?HUQpBWVYsdremsUBFYoLq+Fat8jTEQwAkJkbI8Hr1oZE/Rq1EcfsXqFtx3ZI?= =?us-ascii?Q?e3ju7E8vA8ffrcbMWbb4g3JvYK3uFGti319JIo9WPBXP+B4NXl+AI8dCtVLH?= =?us-ascii?Q?+EF0HPB+q1Bbt94rrcIt0cWY/m28bGUoADKH6DFDSkb0QoxCs+ujy9UDqERk?= =?us-ascii?Q?RIy7qu38Kc4wSK/UGILlHK28EFhpE4PAVlfHkAI8y0V7JDrOLZX4j2eFsFCY?= =?us-ascii?Q?5TZtt2eV3NI6i2qk0DQu7BLg4dx1nlzcSh3EHT5KXRZ7ADLPOMFnlXS8ffBd?= =?us-ascii?Q?fWnbTbSGKjs0CwNWFizEH1RzRLf3zPc=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: 80e6b337-d62d-4053-6e20-08da42e81bd8 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 May 2022 09:29:49.2736 (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: y0rSJaTCKATdZl6IWwY7wdU5/g3ubYg6CIDlfM7ShXDdawwT9yTmzfls7LHP99Ly0q9G9w49442UAgIS3XLepFe7pTyrnbWKiz/Yr+SUezs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR11MB4681 X-OriginatorOrg: intel.com Content-Transfer-Encoding: quoted-printable 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: , From: "Metzger, Markus T via Gdb-patches" Reply-To: "Metzger, Markus T" Cc: "gdb-patches@sourceware.org" Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Thanks Kevin and Ben, for your positive feedback on the usefulness of this. The patch has grown into a small series when I added gdbserver support and changed several occurrences of direct objfiles traversal with calls to gdbarch_iterate_over_objfiles_in_search_order() to take namespaces into account. The latest version can be found in users/mmetzger/dlmopen. I'll also send it as v5 with a few opens left. >While I'm convinced that other work will be needed to improve GDB's UI >to both display linker namespaces (e.g. in the "info shared" command) >and accept namespace qualifiers when specifying a symbol (e.g. with a >breakpoint command), I think that this current patch is useful as >is. I.e., I'd like to see it (or a modest update) go in as soon as >possible. Indeed, there are a few known issues and many direct objfiles traversals in GDB that all assume that there can be at most one global symbol of the same name. Fixing all of them will be a fair amount of work. Ben Woodard: >How do I specify the filename.c TU which is part of the libstdc++.so which= is >linked into one of the audit libraries rather than the one that is linked = into the >app. Path to the filename isn't sufficient because they could have both be= en built >in the same directory structure from different sources. That is why I beli= eve that >we need some way to know which shared objects are in which namespace and >some way to specify which linkage namespace to search. > >Since the linkage namespaces are on a linked list in glibc, I thought refe= rring to >the default namespace as 0 and counting the depth and then reusing the C++ >namespace qualifier might be a good idea but it is not something that I am= hung >up on. If someone has a better idea, great. I currently keep namespaces hidden and local to SVr4. The rest of GDB does= n't know about them. The official namespace id that dlinfo(RTLD_DI_LMID) provides is available f= or dynamic linker notifications but not during the (initial) load map scan - o= r I haven't found it. I use the address of the r_debug(_ext) object as identif= ier. We could simply number them, as Ben suggests, using the ordinal in the r_debug chain. This may be confusing to users who are aware of the actual namespace id, though. To make GDB aware of namespaces, we'd probably want to partition solibs and objfiles by namespace. This will be a big patch when we change program_space::objfiles() to take a namespace id argument and update all users. Ideally, I think we'd want objfiles to be shared so we only read the debug info once per unique instance and relocate it lazily but GDB is currently n= ot doing that and it doesn't sound entirely trivial. 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