From: Kevin Buettner <kevinb@redhat.com>
To: Markus Metzger via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH v5 15/15] gdb, solib-svr4: support namespaces in DSO iteration
Date: Fri, 24 Jun 2022 17:42:38 -0700 [thread overview]
Message-ID: <20220624174238.6e057f6b@f35-zws-1> (raw)
In-Reply-To: <20220602132514.957983-16-markus.t.metzger@intel.com>
On Thu, 2 Jun 2022 15:25:14 +0200
Markus Metzger via Gdb-patches <gdb-patches@sourceware.org> wrote:
> When looking up names, GDB needs to stay within one linker namespace to
> find the correct instance in case the same name is provided in more than
> one namespace.
>
> Modify svr4_iterate_over_objfiles_in_search_order() to stay within the
> namespace of the current_objfile argument. If no current_objfile is
> provided (i.e. it is nullptr), iterate over objfiles in the initial
> namespace.
>
> For objfiles that do not have a corresponding so_list to provide the
> namespace, assume that the objfile was loaded into the initial namespace.
> This would cover the main executable objfile (which is indeed loaded into
> the initial namespace) as well as manually added symbol files.
>
> Expected fails:
>
> - gdb.base/non-lazy-array-index.exp: the expression parser may lookup
> global symbols, which may result in xfers to read auxv for determining
> the debug base as part of svr4_iterate_over_objfiles_in_search_order().
>
> - gdb.server/non-lazy-array-index.exp: symbol lookup may access the
> target to read AUXV in order to determine the debug base for SVR4
> linker namespaces.
>
> Known issues:
>
> - get_symbol_address() and get_msymbol_address() search objfiles for a
> 'better' match. This was introduced by
>
> 4b610737f02 Handle copy relocations
>
> to handle copy relocations but it now causes a wrong address to be
> read after symbol lookup actually cound the correct symbol. This can
> be seen, for example, with gdb.base/dlmopen.exp when compiled with
> clang.
>
> - gnu ifuncs are only looked up in the initial namespace.
>
> - lookup_minimal_symbol() and lookup_minimal_symbol_text() directly
> iterate over objfiles and are not aware of linker namespaces.
> ---
> gdb/solib-svr4.c | 78 ++++++++++++++++++-
> gdb/testsuite/gdb.base/dlmopen-lib-dep.c | 21 +++++
> gdb/testsuite/gdb.base/dlmopen-lib.c | 5 +-
> gdb/testsuite/gdb.base/dlmopen.exp | 40 ++++++++--
> .../gdb.base/non-lazy-array-index.exp | 18 ++++-
> .../gdb.server/bkpt-other-inferior.exp | 13 +++-
> 6 files changed, 159 insertions(+), 16 deletions(-)
> create mode 100644 gdb/testsuite/gdb.base/dlmopen-lib-dep.c
Okay.
Kevin
next prev parent reply other threads:[~2022-06-25 0:42 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-02 13:24 [PATCH v5 00/15] basic linker namespace support Markus Metzger
2022-06-02 13:25 ` [PATCH v5 01/15] gdb, testsuite: extend gdb_test_multiple checks Markus Metzger
2022-06-13 1:28 ` Kevin Buettner
2022-06-02 13:25 ` [PATCH v5 02/15] gdb, solib-svr4: remove locate_base() Markus Metzger
2022-06-02 23:04 ` Kevin Buettner
2022-06-02 13:25 ` [PATCH v5 03/15] gdb, gdbserver: support dlmopen() Markus Metzger
2022-06-19 4:02 ` Kevin Buettner
2022-06-27 12:55 ` Metzger, Markus T
2022-06-30 22:35 ` Kevin Buettner
2022-06-02 13:25 ` [PATCH v5 04/15] gdbserver: move main_lm handling into caller Markus Metzger
2022-06-19 4:22 ` Kevin Buettner
2022-06-02 13:25 ` [PATCH v5 05/15] gdb, gdbserver: extend RSP to support namespaces Markus Metzger
2022-06-02 16:09 ` Eli Zaretskii
2022-06-19 4:32 ` Kevin Buettner
2022-06-02 13:25 ` [PATCH v5 06/15] gdb, compile: unlink objfile stored in module Markus Metzger
2022-06-23 17:20 ` Kevin Buettner
2022-06-02 13:25 ` [PATCH v5 07/15] gdb, python: use gdbarch_iterate_over_objfiles_in_search_order Markus Metzger
2022-06-24 17:18 ` Kevin Buettner
2022-06-02 13:25 ` [PATCH v5 08/15] gdb, ada: collect standard exceptions in all objfiles Markus Metzger
2022-06-24 17:26 ` Kevin Buettner
2022-07-18 16:49 ` Tom Tromey
2022-07-18 5:35 ` Metzger, Markus T
2022-09-14 8:19 ` Metzger, Markus T
2022-09-14 8:37 ` Joel Brobecker
2022-09-14 8:45 ` Metzger, Markus T
2022-06-02 13:25 ` [PATCH v5 09/15] gdb, ada: update ada_lookup_simple_minsym Markus Metzger
2022-06-24 23:42 ` Kevin Buettner
2022-07-18 17:02 ` Tom Tromey
2022-07-19 7:14 ` Metzger, Markus T
2022-09-14 8:19 ` Metzger, Markus T
2022-09-21 16:11 ` Tom Tromey
2022-06-02 13:25 ` [PATCH v5 10/15] gdb, ada: update ada_add_all_symbols Markus Metzger
2022-06-24 23:53 ` Kevin Buettner
2022-07-18 5:36 ` Metzger, Markus T
2022-07-18 16:56 ` Tom Tromey
2022-07-19 7:13 ` Metzger, Markus T
2022-07-19 12:23 ` Tom Tromey
2022-07-19 13:49 ` Metzger, Markus T
2022-06-02 13:25 ` [PATCH v5 11/15] gdb, cp: update add_symbol_overload_list_qualified Markus Metzger
2022-06-24 23:59 ` Kevin Buettner
2022-06-02 13:25 ` [PATCH v5 12/15] gdb, hppa: remove unused hppa_lookup_stub_minimal_symbol Markus Metzger
2022-06-25 0:01 ` Kevin Buettner
2022-06-02 13:25 ` [PATCH v5 13/15] gdb, symtab: inline find_quick_global_symbol_language Markus Metzger
2022-06-25 0:16 ` Kevin Buettner
2022-06-02 13:25 ` [PATCH v5 14/15] gdb: update gnu ifunc resolve Markus Metzger
2022-06-25 0:34 ` Kevin Buettner
2022-06-02 13:25 ` [PATCH v5 15/15] gdb, solib-svr4: support namespaces in DSO iteration Markus Metzger
2022-06-25 0:42 ` Kevin Buettner [this message]
2022-07-15 10:30 ` [PATCH v5 00/15] basic linker namespace support Metzger, Markus T
2022-07-16 0:04 ` Kevin Buettner
2022-07-18 5:33 ` Metzger, Markus T
2022-10-05 11:16 ` Metzger, Markus T
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=20220624174238.6e057f6b@f35-zws-1 \
--to=kevinb@redhat.com \
--cc=gdb-patches@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).