From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 9F2F83853C10; Tue, 17 Aug 2021 13:13:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9F2F83853C10 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 17HDDadv031666 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Aug 2021 09:13:41 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 17HDDadv031666 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 57B2F1EA7E; Tue, 17 Aug 2021 09:13:36 -0400 (EDT) Subject: Re: [PATCH v2] gdbserver: Check r_version < 1 for Linux debugger interface To: "H.J. Lu" , GNU C Library , GDB References: From: Simon Marchi Message-ID: <86f32961-627e-95b9-799c-040d24d75729@polymtl.ca> Date: Tue, 17 Aug 2021 09:13:35 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Tue, 17 Aug 2021 13:13:36 +0000 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, 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-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, 17 Aug 2021 13:13:53 -0000 On 2021-08-16 4:30 p.m., H.J. Lu wrote: > Update gdbserver to check r_version < 1 instead of r_version != 1 so > that r_version can be bumped for a new field in the glibc debugger > interface to support multiple namespaces. Since so far, the gdbserver > only reads fields defined for r_version == 1, it is compatible with > r_version >= 1. > > All future glibc debugger interface changes will be backward compatible. > If there is ever the need for backward incompatible change to the glibc > debugger interface, a new DT_XXX element will be provided to access the > new incompatible interface. > > PR gdb/11839 > * linux-low.cc (linux_process_target::qxfer_libraries_svr4): > Check r_version < 1 instead of r_version != 1. Note that GDB doesn't use ChangeLogs. You can use Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=11839 To link to the Bugzilla entry. > --- > gdbserver/linux-low.cc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc > index 5c6191d941c..fc7a995351d 100644 > --- a/gdbserver/linux-low.cc > +++ b/gdbserver/linux-low.cc > @@ -6845,7 +6845,7 @@ linux_process_target::qxfer_libraries_svr4 (const char *annex, > if (linux_read_memory (priv->r_debug + lmo->r_version_offset, > (unsigned char *) &r_version, > sizeof (r_version)) != 0 > - || r_version != 1) > + || r_version < 1) This patch LGTM. As you noted, things break when bumping r_version to 2 because of r_ldsomap, but since there isn't a glibc out there using r_version == 2, I think that this patch can safely go in right now. Simon