[PATCH v3 3/3] arc: Add GNU/Linux support for ARC
Simon Marchi
simark@simark.ca
Wed Jul 15 03:03:24 GMT 2020
LGTM, with two nits below.
> +/* Implement the "skip_solib_resolver" gdbarch method.
> +
> + See glibc_skip_solib_resolver for details. */
> +
> +static CORE_ADDR
> +arc_linux_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
> +{
> + /* For uClibc 0.9.26+.
> +
> + An unresolved PLT entry points to "__dl_linux_resolve", which calls
> + "_dl_linux_resolver" to do the resolving and then eventually jumps to
> + the function.
> +
> + So we look for the symbol `_dl_linux_resolver', and if we are there,
> + gdb sets a breakpoint at the return address, and continues. */
> + struct bound_minimal_symbol resolver =
> + lookup_minimal_symbol ("_dl_linux_resolver", NULL, NULL);
> +
> + if (arc_debug)
> + {
> + if (resolver.minsym)
!= nullptr
> + {
> + CORE_ADDR res_addr = BMSYMBOL_VALUE_ADDRESS (resolver);
> + debug_printf ("arc-linux: skip_solib_resolver (): "
> + "pc = %s, resolver at %s\n",
> + print_core_address (gdbarch, pc),
> + print_core_address (gdbarch, res_addr));
> + }
> + else
> + {
> + debug_printf ("arc-linux: skip_solib_resolver (): "
> + "pc = %s, no resolver found\n",
> + print_core_address (gdbarch, pc));
> + }
> + }
> +
> + if (resolver.minsym && BMSYMBOL_VALUE_ADDRESS (resolver) == pc)
!= nullptr
Simon
More information about the Gdb-patches
mailing list