From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lndn.lancelotsix.com (lndn.lancelotsix.com [51.195.220.111]) by sourceware.org (Postfix) with ESMTPS id 4ABDE3858D1E for ; Fri, 13 Oct 2023 18:35:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4ABDE3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=lancelotsix.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=lancelotsix.com Received: from octopus (cust120-dsl54.idnet.net [212.69.54.120]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id C0B198A6AA; Fri, 13 Oct 2023 18:35:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lancelotsix.com; s=2021; t=1697222110; bh=Z8LPFH7Z2NR2f1Ewv+F3V3lFM6kyBd8O6FogTeD6erU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eBAuQsqcy7hCqnsUXsITWKL0Bp+JfPx7uUabqjCLCAaI2hqtA6EGPivcu/y5rfQyH 00LnENTyDpD9jSuP00V04yf87DcaS96Wa5gzblHE7SnF+46AZmedPmbwgcmbk+DT6k HwI9adMy/uQ6k0mIeDvj2prgQw4sR/I0PHJONFYuK8ibf9mMp6I2cc25cdL2r9PmxP d9LlkDucxhJJ52sI/k+UGM3CX14JBzRYS/bxItxyhj4iMbyBKPCtpxQoLOf+Wo0dwD xRdWZLT0vcj7f50xyXgjZ5p9LJwVBO3aZWzMIhHUOGb1x+DRWObPItAhlGsLNH5jzN tPYOzMaoZgP6g== Date: Fri, 13 Oct 2023 19:35:06 +0100 From: Lancelot SIX To: Simon Marchi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 13/24] gdb: make solib-rocm not use so_list internally Message-ID: <20231013183506.kqmk26rs5pokeata@octopus> References: <20231010204213.111285-1-simon.marchi@efficios.com> <20231010204213.111285-14-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231010204213.111285-14-simon.marchi@efficios.com> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (lndn.lancelotsix.com [0.0.0.0]); Fri, 13 Oct 2023 18:35:10 +0000 (UTC) X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP 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: Hi Simon, When applying this patch, I have: Applying: gdb: make solib-rocm not use so_list internally .git/rebase-apply/patch:171: indent with spaces. = string_printf ("code_object_%ld", code_object_list[i].handle); warning: 1 line adds whitespace errors. On Tue, Oct 10, 2023 at 04:40:08PM -0400, Simon Marchi wrote: > Same rationale as the previous patch, but for solib-rocm. > > - Introduce rocm_so, which is a name a unique_name (see comment in > rocm_update_solib_list for that) and a unique_ptr to the > lm_info_svr4. > - Change the internal lists from so_list lists to vectors of rocm_so. > - Remove rocm_free_solib_list, as everything is automatic now. > - Replace rocm_solib_copy_list with so_list_from_rocm_sos. > > Change-Id: I71e06e3ea22d6420c9e4e500501c06e9a13398a8 > --- > gdb/solib-rocm.c | 92 ++++++++++++++++++++++-------------------------- > 1 file changed, 42 insertions(+), 50 deletions(-) > > diff --git a/gdb/solib-rocm.c b/gdb/solib-rocm.c > index 403173ecc998..5016c383a807 100644 > --- a/gdb/solib-rocm.c > +++ b/gdb/solib-rocm.c > @@ -243,21 +240,21 @@ rocm_solib_current_sos () > so_list *head = svr4_so_ops.current_sos (); > > /* Then, the device-side shared library list. */ > - so_list *list = get_solib_info (current_inferior ())->solib_list; > + std::vector &dev_sos = get_solib_info (current_inferior ())->solib_list; There should be a line break (it gets over the line limit), and I think this dev_sos can be marked const. Best, Lancelot. > > - if (list == nullptr) > + if (dev_sos.empty ()) > return head; > > - list = rocm_solib_copy_list (list); > + so_list *dev_so_list = so_list_from_rocm_sos (dev_sos); > > if (head == nullptr) > - return list; > + return dev_so_list; > > /* Append our libraries to the end of the list. */ > so_list *tail; > for (tail = head; tail->next; tail = tail->next) > /* Nothing. */; > - tail->next = list; > + tail->next = dev_so_list; > > return head; > }