summaryrefslogtreecommitdiff
path: root/breakpoints.c
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2014-01-10 20:05:15 +0100
committerChanho Park <chanho61.park@samsung.com>2014-08-22 20:38:24 +0900
commite63b77105301a29d8a4929205849007b5ffb789d (patch)
tree35613c0c42df75b8d8b8f464b6f5f46b2dbfd14a /breakpoints.c
parent0e9ae1679f41d6b2be49933907725a1dc4a7dfee (diff)
downloadltrace-e63b77105301a29d8a4929205849007b5ffb789d.tar.gz
ltrace-e63b77105301a29d8a4929205849007b5ffb789d.tar.bz2
ltrace-e63b77105301a29d8a4929205849007b5ffb789d.zip
Add a new per-breakpoint callback on_install
Diffstat (limited to 'breakpoints.c')
-rw-r--r--breakpoints.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/breakpoints.c b/breakpoints.c
index 947cb71..c3fa275 100644
--- a/breakpoints.c
+++ b/breakpoints.c
@@ -1,6 +1,6 @@
/*
* 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
@@ -85,6 +85,14 @@ breakpoint_on_retract(struct breakpoint *bp, struct process *proc)
(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)
@@ -229,6 +237,7 @@ breakpoint_turn_on(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;
}