| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame^] | 1 | #include "ltrace.h" |
| 2 | #include "options.h" |
| 3 | #include "output.h" |
| 4 | |
| 5 | void enable_all_breakpoints(struct process * proc) |
| 6 | { |
| 7 | if (proc->breakpoints_enabled <= 0) { |
| 8 | struct library_symbol * tmp = proc->list_of_symbols; |
| 9 | |
| 10 | if (opt_d>0) { |
| 11 | output_line(0, "Enabling breakpoints for pid %u...", proc->pid); |
| 12 | } |
| 13 | while(tmp) { |
| 14 | insert_breakpoint(proc->pid, &tmp->brk); |
| 15 | tmp = tmp->next; |
| 16 | } |
| 17 | } |
| 18 | proc->breakpoints_enabled = 1; |
| 19 | } |
| 20 | |
| 21 | void disable_all_breakpoints(struct process * proc) |
| 22 | { |
| 23 | if (proc->breakpoints_enabled) { |
| 24 | struct library_symbol * tmp = proc->list_of_symbols; |
| 25 | |
| 26 | if (opt_d>0) { |
| 27 | output_line(0, "Disabling breakpoints for pid %u...", proc->pid); |
| 28 | } |
| 29 | while(tmp) { |
| 30 | delete_breakpoint(proc->pid, &tmp->brk); |
| 31 | tmp = tmp->next; |
| 32 | } |
| 33 | } |
| 34 | proc->breakpoints_enabled = 0; |
| 35 | } |