Re: [PATCH] create_internal_breakpoint: Apply gdbarch_skip_entrypoint.

Doug Evans
2014-11-08T01:57:07Z

Doug Evans writes:
> Hi.
>
> In glibc, _dl_debug_state is usually defined like this:
>
> void
> _dl_debug_state (void)
> {
> }
>
> and thus on powerpc64le-linux this function does not require a TOC register.
>
> [...]
> ...
> -3 shlib events keep y 0x00003fffb7fd8e40 <__GI__dl_debug_state> inf 1
> ...
> [...]
> ...
> -3 shlib events keep y 0x0000100000020e48 <__GI__dl_debug_state+8> inf 1

For completeness sake,
You can also see the difference in the "shlib events" breakpoint,
but with _ovly_debug_state you can run it for yourself without
having to hack glibc.

There was a cut-n-paste error in the patch.
Fixed below.

2014-11-07 Doug Evans <dje@google.com>

* breakpoint.c (create_internal_breakpoint): Apply
gdbarch_skip_entrypoint if it's defined.

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index bd51f5d..1b5cf5f 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -3306,6 +3306,9 @@ create_internal_breakpoint (struct gdbarch *gdbarch,

init_sal (&sal); /* Initialize to zeroes. */

+ if (gdbarch_skip_entrypoint_p (gdbarch))
+ address = gdbarch_skip_entrypoint (gdbarch, address);
+
sal.pc = address;
sal.section = find_pc_overlay (sal.pc);
sal.pspace = current_program_space;