10 open_program(char *filename, pid_t pid) {
12 proc = calloc(sizeof(Process), 1);
17 proc->filename = strdup(filename);
18 proc->breakpoints_enabled = -1;
22 breakpoints_init(proc);
24 proc->next = list_of_processes;
25 list_of_processes = proc;
34 if (trace_pid(pid) < 0) {
35 fprintf(stderr, "Cannot attach to pid %u: %s\n", pid,
40 filename = pid2name(pid);
43 fprintf(stderr, "Cannot trace pid %u: %s\n", pid,
48 proc = open_program(filename, pid);
49 continue_process(pid);
50 proc->breakpoints_enabled = 1;
57 tmp = list_of_processes;
59 if (pid == tmp->pid) {