129 return (errno == 0)? true: false; |
129 return (errno == 0)? true: false; |
130 } |
130 } |
131 |
131 |
132 static bool ptrace_continue(pid_t pid, int signal) { |
132 static bool ptrace_continue(pid_t pid, int signal) { |
133 // pass the signal to the process so we don't swallow it |
133 // pass the signal to the process so we don't swallow it |
134 if (ptrace(PTRACE_CONT, pid, NULL, signal) < 0) { |
134 if (ptrace(PT_CONTINUE, pid, NULL, signal) < 0) { |
135 print_debug("ptrace(PTRACE_CONT, ..) failed for %d\n", pid); |
135 print_debug("ptrace(PTRACE_CONT, ..) failed for %d\n", pid); |
136 return false; |
136 return false; |
137 } |
137 } |
138 return true; |
138 return true; |
139 } |
139 } |
432 }; |
432 }; |
433 |
433 |
434 // attach to the process. One and only one exposed stuff |
434 // attach to the process. One and only one exposed stuff |
435 struct ps_prochandle* Pgrab(pid_t pid) { |
435 struct ps_prochandle* Pgrab(pid_t pid) { |
436 struct ps_prochandle* ph = NULL; |
436 struct ps_prochandle* ph = NULL; |
437 thread_info* thr = NULL; |
|
438 |
437 |
439 if ( (ph = (struct ps_prochandle*) calloc(1, sizeof(struct ps_prochandle))) == NULL) { |
438 if ( (ph = (struct ps_prochandle*) calloc(1, sizeof(struct ps_prochandle))) == NULL) { |
440 print_debug("can't allocate memory for ps_prochandle\n"); |
439 print_debug("can't allocate memory for ps_prochandle\n"); |
441 return NULL; |
440 return NULL; |
442 } |
441 } |