Windows/rocm-solib: Don't hardcode namespaces support
rocm_solib_ops currently unconditionally returns true to
solib_ops::supports_namespaces. That works OK on Linux where the
underlying solib ops is svr4. But on Windows, the underlying solib
ops is solib-target, which does not support namespaces. The result
is:
(gdb) info shared
/home/pedro/rocm/gdb/build/gdb/solib.h:270: internal-error: num_active_namespaces: namespaces not supported
A problem internal to GDB has been detected,
further debugging may prove unreliable.
...
Thread 1 hit Breakpoint 1, internal_verror (file=0x7ff71a27fc80 <SCRIPTING_SEARCH_FLAG+52> "/home/pedro/rocm/gdb/build/gdb/solib.h", line=270,
fmt=0x7ff71a27fc5e <SCRIPTING_SEARCH_FLAG+18> "%s: namespaces not supported", ap=0xfff1a8 "\270\374'", <incomplete sequence \367\177>)
at /home/pedro/rocm/gdb/build/gdb/utils.c:514
514 internal_vproblem (&internal_error_problem, file, line, fmt, ap);
(gdb) bt
#0 internal_verror (file=0x7ff71a27fc80 <SCRIPTING_SEARCH_FLAG+52> "/home/pedro/rocm/gdb/build/gdb/solib.h", line=270,
fmt=0x7ff71a27fc5e <SCRIPTING_SEARCH_FLAG+18> "%s: namespaces not supported", ap=0xfff1a8 "\270\374'", <incomplete sequence \367\177>)
at /home/pedro/rocm/gdb/build/gdb/utils.c:514
#1 0x00007ff719c75cf4 in internal_error_loc (file=0x7ff71a27fc80 <SCRIPTING_SEARCH_FLAG+52> "/home/pedro/rocm/gdb/build/gdb/solib.h", line=270,
fmt=0x7ff71a27fc5e <SCRIPTING_SEARCH_FLAG+18> "%s: namespaces not supported") at /home/pedro/rocm/gdb/build/gdbsupport/errors.cc:57
#2 0x00007ff719f0aafe in solib_ops::num_active_namespaces (this=0xbb3a0b0) at /home/pedro/rocm/gdb/build/gdb/solib.h:270
#3 0x00007ff719eca99e in rocm_solib_ops::num_active_namespaces (this=0xc9388a0) at /home/pedro/rocm/gdb/build/gdb/solib-rocm.c:211
#4 0x00007ff719a14d33 in print_solib_list_table (solib_list=..., print_namespace=true) at /home/pedro/rocm/gdb/build/gdb/solib.c:1011
#5 0x00007ff719a15833 in info_sharedlibrary_command (pattern=0x0, from_tty=1) at /home/pedro/rocm/gdb/build/gdb/solib.c:1115
rocm_solib_ops will stop sitting on top of another solib
implementation once the multi solib provider work lands, but
meanwhile, it'd be helpful to not crash.
Fix this by making rocm_solib_ops::supports_namespaces() delegate to
the underlying host solib ops like other methods do.
Approved-by: Lancelot Six <lancelot.six@amd.com> (amdgpu)
Change-Id: I1627c6e2f1b1c171c013c8457e9bfca92d5f4dc5
1 file changed