unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi via Libc-alpha <libc-alpha@sourceware.org>
To: "H.J. Lu" <hjl.tools@gmail.com>,
	GNU C Library <libc-alpha@sourceware.org>,
	GDB <gdb-patches@sourceware.org>
Subject: Re: [PATCH v2] gdbserver: Check r_version < 1 for Linux debugger interface
Date: Tue, 17 Aug 2021 09:13:35 -0400	[thread overview]
Message-ID: <86f32961-627e-95b9-799c-040d24d75729@polymtl.ca> (raw)
In-Reply-To: <YRrK+nOJmShP932/@gmail.com>

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

      parent reply	other threads:[~2021-08-17 13:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16 20:30 [PATCH v2] gdbserver: Check r_version < 1 for Linux debugger interface H.J. Lu via Libc-alpha
2021-08-16 22:02 ` H.J. Lu via Libc-alpha
2021-08-16 22:08   ` H.J. Lu via Libc-alpha
2021-08-17 13:17   ` Simon Marchi via Libc-alpha
2021-08-17 13:48   ` Florian Weimer via Libc-alpha
2021-08-17 14:04     ` H.J. Lu via Libc-alpha
2021-08-17 13:13 ` Simon Marchi via Libc-alpha [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86f32961-627e-95b9-799c-040d24d75729@polymtl.ca \
    --to=libc-alpha@sourceware.org \
    --cc=gdb-patches@sourceware.org \
    --cc=hjl.tools@gmail.com \
    --cc=simon.marchi@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).