diff options
-rw-r--r-- | debugger.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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; |