diff options
author | Petr Machata <pmachata@redhat.com> | 2012-04-07 01:14:24 +0200 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2012-04-19 01:38:02 +0200 |
commit | 0092820afcd45fe045ccc294b061bce8da00a1f2 (patch) | |
tree | 6d70d1d6becda0ea075af31e774c9e81e8b0b569 /breakpoints.c | |
parent | 074f68fb8f57f93de3d94552a855b296b7a25906 (diff) | |
download | ltrace-0092820afcd45fe045ccc294b061bce8da00a1f2.tar.gz |
Drop process.fixed_libs, enable breakpoints right away
The theory behing fixed_libs was broken from the beginning, we can't tell
dlopened libraries from fixed ones when attaching. We also don't need to
wait for _start to enable breakpoints. We may need this on LS_TOPLT_POINT
architectures, but that was added for PPC, and PPC doesn't need it anymore.
Diffstat (limited to 'breakpoints.c')
-rw-r--r-- | breakpoints.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/breakpoints.c b/breakpoints.c index 1d23d6e..a69f43d 100644 --- a/breakpoints.c +++ b/breakpoints.c @@ -292,24 +292,13 @@ struct entry_breakpoint { }; static void -turn_on_breakpoint(void *addr, void *sbp, void *proc) -{ - struct breakpoint *bp = sbp; - if (breakpoint_turn_on(bp) < 0) { - error(0, errno, "couldn't turn on breakpoint @%p", bp->addr); - /* XXX handle me. */ - } -} - -static void entry_breakpoint_on_hit(struct breakpoint *a, struct Process *proc) { + fprintf(stderr, "entry_breakpoint_on_hit\n"); struct entry_breakpoint *bp = (void *)a; if (proc == NULL || proc->leader == NULL) return; delete_breakpoint(proc, bp->super.addr); - dict_apply_to_all(proc->breakpoints, turn_on_breakpoint, proc); - proc->fixed_libs = proc->libraries; linkmap_init(proc, bp->dyn_addr); } @@ -376,15 +365,14 @@ breakpoints_init(Process *proc, int enable) || (result = entry_breakpoint_init(proc, entry_bp, lib->entry, lib)) < 0) goto fail; - ++bp_state; + if ((result = proc_add_breakpoint(proc, &entry_bp->super)) < 0) goto fail; - ++bp_state; + if ((result = breakpoint_turn_on(&entry_bp->super)) < 0) goto fail; - proc_add_library(proc, lib); proc->callstack_depth = 0; |