diff options
author | Markus Metzger <markus.t.metzger@intel.com> | 2022-03-28 11:20:10 +0200 |
---|---|---|
committer | Markus Metzger <markus.t.metzger@intel.com> | 2022-10-18 14:16:11 +0200 |
commit | aebb370bae3f511df8afb68a01a79c54e2066650 (patch) | |
tree | 8e9e25276a2768eb2352ea514377f08c662c7c4f /gdb/testsuite/gdb.server | |
parent | 1dc9084f5e95fd9a1f2f0e9baf9c6e52c5a5ee29 (diff) | |
download | gdb-aebb370bae3f511df8afb68a01a79c54e2066650.zip gdb-aebb370bae3f511df8afb68a01a79c54e2066650.tar.gz gdb-aebb370bae3f511df8afb68a01a79c54e2066650.tar.bz2 |
gdb, solib-svr4: support namespaces in DSO iteration
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.
Diffstat (limited to 'gdb/testsuite/gdb.server')
-rw-r--r-- | gdb/testsuite/gdb.server/bkpt-other-inferior.exp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.server/bkpt-other-inferior.exp b/gdb/testsuite/gdb.server/bkpt-other-inferior.exp index d01b911..452c7c9 100644 --- a/gdb/testsuite/gdb.server/bkpt-other-inferior.exp +++ b/gdb/testsuite/gdb.server/bkpt-other-inferior.exp @@ -78,13 +78,18 @@ foreach inf_sel {1 2} { gdb_test_no_output "set debug remote 1" - set test "set breakpoint" - gdb_test_multiple "break -q main" $test { + gdb_test_multiple "break -q main" "set breakpoint" { + -re "Sending packet: \\\$qXfer:auxv:read.*$gdb_prompt $" { + # Symbol lookup may access the target to read AUXV in + # order to determine the debug base for SVR4 linker + # namespaces. + xfail "$gdb_test_name" + } -re "Sending packet.*$gdb_prompt $" { - fail $test + fail "$gdb_test_name" } -re "^break -q main\r\nBreakpoint .* at .*$gdb_prompt $" { - pass $test + pass "$gdb_test_name" } } |