Re: [PATCH] create_internal_breakpoint: Apply gdbarch_skip_entrypoint.

Ulrich Weigand
2014-11-10T12:58:51Z

Doug Evans worte:

> This is important because the toolchain will optimize intra-module calls
> to skip the first two instructions that set up the TOC register.
> And since gdb currently doesn't to "entry point skipping" for internal
> breakpoints things work (in particular shlib event breakpoints).

Huh. Yes, that's clearly a bug.

> This patch fixes things by applying entry point skipping to
> internal breakpoints. Is this the best place to apply entry point
> skipping for internal breakpoints?

I think this is fine. (The alternative would be push it up into the
callers, which would have the advantage that you could do it only
for those callers that get the address from a symbol, and not those
that e.g. get it from a probe. However, since gdbarch_skip_entrypoint
is safe even if the address is not equal to a symbol address, it's
probably preferable to just do the skipping in one place.)

Bye,
Ulrich

--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com