commit | e74c80de19a628cab68f10a1e7c92bef2988aafb | [log] [tgz] |
---|---|---|
author | Juan Cespedes <cespedes@coco.thehackers.org> | Wed Feb 11 11:32:31 2009 +0100 |
committer | Juan Cespedes <cespedes@coco.thehackers.org> | Wed Feb 11 11:32:31 2009 +0100 |
tree | 306781c2391e6fad8adcbfa9c6ece0f264090c27 | |
parent | 53b474031edff156a855a1689abd4bd90f8f1510 [diff] [blame] |
Fixed segfault in traced process when receiving a signal Specifically, when a signal was received while enabling a breakpoint
diff --git a/proc.c b/proc.c index 511eb5e..88edd0a 100644 --- a/proc.c +++ b/proc.c
@@ -59,3 +59,17 @@ continue_process(pid); proc->breakpoints_enabled = 1; } + +struct process * +pid2proc(pid_t pid) { + struct process *tmp; + + tmp = list_of_processes; + while (tmp) { + if (pid == tmp->pid) { + return tmp; + } + tmp = tmp->next; + } + return NULL; +}