Drop breakpoint->proc
This assumed that the process where this breakpoint is added can also be
used to turn the breakpoint on and off. That's not true, leader is not
always stopped when we need it. But when we need to turn a breakpoint on
or off, we are doing so in response to an event, and thus do have a stopped
process in hands. Just use that.
diff --git a/breakpoint.h b/breakpoint.h
index 36f239f..30a9d7c 100644
--- a/breakpoint.h
+++ b/breakpoint.h
@@ -71,7 +71,6 @@
struct breakpoint {
struct bp_callbacks *cbs;
struct library_symbol *libsym;
- struct Process *proc;
void *addr;
unsigned char orig_value[BREAKPOINT_LENGTH];
int enabled;
@@ -100,12 +99,12 @@
/* Call enable_breakpoint the first time it's called. Returns 0 on
* success and a negative value on failure. */
-int breakpoint_turn_on(struct breakpoint *bp);
+int breakpoint_turn_on(struct breakpoint *bp, struct Process *proc);
/* Call disable_breakpoint when turned off the same number of times
* that it was turned on. Returns 0 on success and a negative value
* on failure. */
-int breakpoint_turn_off(struct breakpoint *bp);
+int breakpoint_turn_off(struct breakpoint *bp, struct Process *proc);
/* This is actually several functions rolled in one:
* - malloc