This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] create_internal_breakpoint: Apply gdbarch_skip_entrypoint.
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: dje at google dot com (Doug Evans)
- Cc: palves at redhat dot com, gdb-patches at sourceware dot org
- Date: Mon, 10 Nov 2014 13:58:42 +0100 (CET)
- Subject: Re: [PATCH] create_internal_breakpoint: Apply gdbarch_skip_entrypoint.
- Authentication-results: sourceware.org; auth=none
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