summaryrefslogtreecommitdiffstats
path: root/debugger.c
diff options
context:
space:
mode:
Diffstat (limited to 'debugger.c')
-rw-r--r--debugger.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/debugger.c b/debugger.c
index 7378298..c3c9fa1 100644
--- a/debugger.c
+++ b/debugger.c
@@ -113,6 +113,15 @@ static void uninstall_breakpoints(struct thread *th) {
}
}
+static void clean_fork_breakpoints(struct thread *th, const struct process *parent) {
+ const struct list *breaks = &parent->breakpoints;
+ for (struct breakpoint *b = breaks->tail; b != breaks->end; b = b->prev) {
+ if (b->installed) {
+ ptrace(PTRACE_POKETEXT, th->id, b->address, b->text);
+ }
+ }
+}
+
static int detect_breakpoint(struct thread *th, int *restart) {
int is_bp = 0; /* at least 1 effective breakpoint at this PC */
int is_user = 0; /* at least 1 user-defined bp at this PC */
@@ -393,6 +402,8 @@ static int wait_thread(struct thread *th) {
//while (!wait_thread(eventth)) {}
dbg_sync(eventproc);
+ clean_fork_breakpoints(eventth, th->proc);
+
th->stopped = 1;
th->signal = 0;
th->doing = 0;