From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by sourceware.org (Postfix) with ESMTPS id 6BC133839C68; Tue, 17 Aug 2021 20:26:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6BC133839C68 Received: by mail-pj1-x1030.google.com with SMTP id u21-20020a17090a8915b02901782c36f543so7235691pjn.4; Tue, 17 Aug 2021 13:26:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SSWBowBvOgK2/o6pdFwCWHU00x+FCQYKDgXfCzrDSCc=; b=gRZXrjGlSMUFwjY91AK46kVP1YQqF4XD9i8yfrRBk0Y+XwBXz2QhNx9hfgq2rKdIxF HbueGjJqrYf5w0/Nd/NENJqqcXXhZMTGKmK4cqUbHnroLhj6xLDOQLz2dXcO5GtMcvT5 E5mWi5zG2UmJTXppG+IpQv2DgKZh8D9Fsn/KpOj0+sa5NYXA0XYYcHQk97N1jC6WolSc jAB4z82DO3PDzeGKxa/4atma/chElP3klpOeeP5rE4zh8Ka9V83+TrJNtq/wrjUn+fl8 MxfprNcwoowpspfV2fgz01fTrOm5Ji6Rw26SoccKKr+H9Tyv4LWdKDbLJeijw7hbfskr Z2QA== X-Gm-Message-State: AOAM532lY9WRX/HV7K8WKWTvtFtSyUUp5+lSpV83kiVAuPvVIe8VjQFt Tet/r8PSlLxT/sl24GM0yMziE3QkOBtE4zL8cvY= X-Google-Smtp-Source: ABdhPJwJAWqaXYiOl6uyOgI++Evvqku7TvKoIIGBEc5WvCeVcYB6fQbPM4AKCCsRpklFPd05lNDKCK56sJtu3XblVtQ= X-Received: by 2002:a62:7e41:0:b029:3e0:9c3f:ab50 with SMTP id z62-20020a627e410000b02903e09c3fab50mr5334688pfc.57.1629232016661; Tue, 17 Aug 2021 13:26:56 -0700 (PDT) MIME-Version: 1.0 References: <20210817010629.593479-1-hjl.tools@gmail.com> <20210817010629.593479-3-hjl.tools@gmail.com> <20210817175733.GI1633923@zorba> In-Reply-To: <20210817175733.GI1633923@zorba> From: "H.J. Lu" Date: Tue, 17 Aug 2021 13:26:20 -0700 Message-ID: Subject: Re: [PATCH v2 2/2] Extend struct r_debug to support multiple namespaces To: Daniel Walker Cc: GNU C Library , GDB Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3024.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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: Tue, 17 Aug 2021 20:27:07 -0000 On Tue, Aug 17, 2021 at 10:57 AM Daniel Walker wrote: > > On Mon, Aug 16, 2021 at 06:06:29PM -0700, H.J. Lu wrote: > > Glibc does not provide an interface for debugger to access libraries > > loaded in multiple namespaces via dlmopen. > > > > The current rtld-debugger interface is described in the file: > > > > elf/rtld-debugger-interface.txt > > > > under the "Standard debugger interface" heading. This interface only > > provides access to the first link-map (LM_ID_BASE). > > > > Based on the patch from Conan C Huang : > > > > https://sourceware.org/pipermail/libc-alpha/2020-June/115448.html > > > > 1. Bump r_version to 2. This triggers the GDB bug: > > > > https://sourceware.org/bugzilla/show_bug.cgi?id=28236 > > > > 2. Add struct r_debug_extended to extend struct r_debug into a linked-list, > > where each element correlates to an unique namespace. > > 3. Add a hidden symbol, _r_debug_extended, for struct r_debug_extended. > > 4. Provide the compatibility symbol, _r_debug, with size of struct r_debug, > > as an alise of _r_debug_extended, for programs which reference _r_debug. > > > I've attached the GDB patch which was created at Cisco to support our version of > this type of feature which is similar to what you've created. You might be able > to make some small modifications to make it work for you. > > Daniel I will give it a try. Thanks. -- H.J.