From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 453EC3858D1E for ; Thu, 10 Feb 2022 23:08:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 453EC3858D1E Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-257-oEoNylMLOHOCduRQ_ptV7Q-1; Thu, 10 Feb 2022 18:08:26 -0500 X-MC-Unique: oEoNylMLOHOCduRQ_ptV7Q-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9A203835B47; Thu, 10 Feb 2022 23:08:25 +0000 (UTC) Received: from f35-zws-1 (unknown [10.2.16.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E1EF87AB40; Thu, 10 Feb 2022 23:08:24 +0000 (UTC) Date: Thu, 10 Feb 2022 16:08:23 -0700 From: Kevin Buettner To: "H.J. Lu via Gdb-patches" Subject: Re: [PATCH v3] Support glibc multiple namespace extension Message-ID: <20220210160823.35a8508e@f35-zws-1> In-Reply-To: References: Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.1 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: Thu, 10 Feb 2022 23:08:33 -0000 Hi H.J., This work looks pretty good to me. I found a couple of coding style nits and have a question/request; see below. On Sat, 2 Oct 2021 13:43:40 -0700 "H.J. Lu via Gdb-patches" wrote: [...] > diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c > index 3de1bb9c7f7..9d851ba8930 100644 > --- a/gdb/solib-svr4.c > +++ b/gdb/solib-svr4.c [...] > @@ -1335,6 +1366,18 @@ svr4_current_sos_direct (struct svr4_info *info) > if (lm) > svr4_read_so_list (info, lm, 0, &link_ptr, 0); > > + /* Get the next namespace from the r_next field. */ > + lm = solib_svr4_r_next (info->debug_base); > + while (lm) Due to the GDB coding standard, this test needs to be turned into an explicit comparison against 0. See: https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards#Comparison_With_nullptr_And_Zero (FWIW, I don't really like this part of our standard; I personally find it more readable to code it the way that you did. Also, I do realize that there are existing implicit tests against 0 in this file and elsewhere and that they do not conform to GDB's current coding standard. I'm in no hurry to fix them - but, obviously, I won't object if someone does.) > + { > + /* Get the link map in this namespace. */ > + CORE_ADDR link_map = solib_svr4_r_map (lm); > + if (link_map) Likewise, for the check above. > + svr4_read_so_list (info, link_map, 0, &link_ptr, 0); > + /* Go to the next namespace. */ > + lm = solib_svr4_r_next (lm); > + } > + > cleanup.release (); > > if (head == NULL) > @@ -1706,7 +1749,8 @@ solist_update_full (struct svr4_info *info) > failure. */ > > static int > -solist_update_incremental (struct svr4_info *info, CORE_ADDR lm) > +solist_update_incremental (struct svr4_info *info, CORE_ADDR debug_base, > + CORE_ADDR lm) > { > struct so_list *tail; > CORE_ADDR prev_lm; > @@ -1727,8 +1771,15 @@ solist_update_incremental (struct svr4_info *info, CORE_ADDR lm) > for (tail = info->solib_list; tail->next != NULL; tail = tail->next) > /* Nothing. */; > > - lm_info_svr4 *li = (lm_info_svr4 *) tail->lm_info; > - prev_lm = li->lm_addr; > + /* Don't check shared libraries in other namespaces when updating > + shared libraries in a new namespace. */ Shared libraries in other namespaces aren't being neglected though, right? Assuming that's true, could you add a sentence or two to your comment addressing this concern? Kevin