public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: "H.J. Lu via Gdb-patches" <gdb-patches@sourceware.org>
Cc: GNU C Library <libc-alpha@sourceware.org>,
	"H.J. Lu" <hjl.tools@gmail.com>
Subject: Re: [PATCH v2] gdbserver: Check r_version < 1 for Linux debugger interface
Date: Tue, 17 Aug 2021 15:48:53 +0200	[thread overview]
Message-ID: <87sfz85ghm.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <CAMe9rOrWbRA+SGBZeue3PKk2V59o0BxTHAh7zpGiqBGsTFpBTQ@mail.gmail.com> (H. J. Lu via Gdb-patches's message of "Mon, 16 Aug 2021 15:02:37 -0700")

* H. J. Lu via Gdb-patches:

> Set r_version == 2 breaks GDB due to
>
> static CORE_ADDR
> solib_svr4_r_ldsomap (struct svr4_info *info)
> {
>   struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
>   struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
>   enum bfd_endian byte_order = type_byte_order (ptr_type);
>   ULONGEST version = 0;
>
>   try
>     {
>       /* Check version, and return zero if `struct r_debug' doesn't have
>          the r_ldsomap member.  */
>       version
>         = read_memory_unsigned_integer (info->debug_base +
> lmo->r_version_offset,
>                                         lmo->r_version_size, byte_order);
>     }
>   catch (const gdb_exception_error &ex)
>     {
>       exception_print (gdb_stderr, ex);
>     }
>
>   if (version < 2 || lmo->r_ldsomap_offset == -1)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> glibc doesn't have r_ldsomap.  But r_ldsomap_offset is set
> unconditionally.   Shouldn't it be set only if the target debugger
> interface has it?

glibc should add r_ldsomap_offset and switch its own version number to
3, I think.

Thanks,
Florian


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

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16 20:30 H.J. Lu
2021-08-16 22:02 ` H.J. Lu
2021-08-16 22:08   ` H.J. Lu
2021-08-17 13:17   ` Simon Marchi
2021-08-17 13:48   ` Florian Weimer [this message]
2021-08-17 14:04     ` H.J. Lu
2021-08-17 13:13 ` Simon Marchi

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

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

  git send-email \
    --in-reply-to=87sfz85ghm.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=hjl.tools@gmail.com \
    --cc=libc-alpha@sourceware.org \
    /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).