/*
* This file is part of ltrace.
- * Copyright (C) 2006,2007,2011,2012,2013 Petr Machata, Red Hat Inc.
+ * Copyright (C) 2006,2007,2011,2012,2013,2014 Petr Machata, Red Hat Inc.
* Copyright (C) 2009 Juan Cespedes
* Copyright (C) 1998,2001,2002,2003,2007,2008,2009 Juan Cespedes
* Copyright (C) 2006 Ian Wienand
(bp->cbs->on_retract)(bp, proc);
}
+void
+breakpoint_on_install(struct breakpoint *bp, struct process *proc)
+{
+ assert(bp != NULL);
+ if (bp->cbs != NULL && bp->cbs->on_install != NULL)
+ (bp->cbs->on_install)(bp, proc);
+}
+
int
breakpoint_get_return_bp(struct breakpoint **ret,
struct breakpoint *bp, struct process *proc)
if (bp->enabled == 1) {
assert(proc->pid != 0);
enable_breakpoint(proc, bp);
+ breakpoint_on_install(bp, proc);
}
return 0;
}
}
static enum callback_status
-enable_bp_cb(arch_addr_t *addr, struct breakpoint **bpp, void *data)
-{
- struct process *proc = data;
- debug(DEBUG_FUNCTION, "enable_bp_cb(pid=%d)", proc->pid);
- if ((*bpp)->enabled)
- enable_breakpoint(proc, *bpp);
- return CBS_CONT;
-}
-
-void
-enable_all_breakpoints(struct process *proc)
-{
- debug(DEBUG_FUNCTION, "enable_all_breakpoints(pid=%d)", proc->pid);
-
- debug(1, "Enabling breakpoints for pid %u...", proc->pid);
- if (proc->breakpoints != NULL)
- DICT_EACH(proc->breakpoints, arch_addr_t, struct breakpoint *,
- NULL, enable_bp_cb, proc);
-}
-
-static enum callback_status
disable_bp_cb(arch_addr_t *addr, struct breakpoint **bpp, void *data)
{
struct process *proc = data;