added some optional debug printing
[platform/upstream/ltrace.git] / breakpoint.h
index 3c9de9e..c36f673 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * This file is part of ltrace.
- * Copyright (C) 2012, 2013 Petr Machata, Red Hat Inc.
+ * Copyright (C) 2012,2013,2014 Petr Machata, Red Hat Inc.
  * Copyright (C) 2009 Juan Cespedes
  *
  * This program is free software; you can redistribute it and/or
@@ -46,6 +46,7 @@
 struct bp_callbacks {
        void (*on_hit)(struct breakpoint *bp, struct process *proc);
        void (*on_continue)(struct breakpoint *bp, struct process *proc);
+       void (*on_install)(struct breakpoint *bp, struct process *proc);
        void (*on_retract)(struct breakpoint *bp, struct process *proc);
 
        /* Create a new breakpoint that should handle return from the
@@ -84,6 +85,12 @@ void breakpoint_on_continue(struct breakpoint *bp, struct process *proc);
  * the instruction underneath it).  */
 void breakpoint_on_retract(struct breakpoint *bp, struct process *proc);
 
+/* Call ON_INSTALL handler of BP, if any is set.  This should be
+ * called after the breakpoint is enabled for the first time, not
+ * every time it's enabled (such as after stepping over a site of a
+ * temporarily disabled breakpoint).  */
+void breakpoint_on_install(struct breakpoint *bp, struct process *proc);
+
 /* Call GET_RETURN_BP handler of BP, if any is set.  If none is set,
  * call CREATE_DEFAULT_RETURN_BP to obtain one.  */
 int breakpoint_get_return_bp(struct breakpoint **ret,
@@ -150,7 +157,6 @@ int delete_breakpoint(struct process *proc, struct breakpoint *bp);
 
 /* XXX some of the following belongs to proc.h/proc.c.  */
 struct breakpoint *address2bpstruct(struct process *proc, void *addr);
-void enable_all_breakpoints(struct process *proc);
 void disable_all_breakpoints(struct process *proc);
 int breakpoints_init(struct process *proc);