| 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 | } |
| Juan Cespedes | 5e0acdb | 1998-04-04 08:34:07 +0200 | [diff] [blame] | 17 | if (proc->current_symbol) { |
| 18 | insert_breakpoint(proc->pid, &proc->return_value); |
| 19 | } |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 20 | } |
| 21 | proc->breakpoints_enabled = 1; |
| 22 | } |
| 23 | |
| 24 | void disable_all_breakpoints(struct process * proc) |
| 25 | { |
| 26 | if (proc->breakpoints_enabled) { |
| 27 | struct library_symbol * tmp = proc->list_of_symbols; |
| 28 | |
| 29 | if (opt_d>0) { |
| 30 | output_line(0, "Disabling breakpoints for pid %u...", proc->pid); |
| 31 | } |
| 32 | while(tmp) { |
| 33 | delete_breakpoint(proc->pid, &tmp->brk); |
| 34 | tmp = tmp->next; |
| 35 | } |
| Juan Cespedes | 5e0acdb | 1998-04-04 08:34:07 +0200 | [diff] [blame] | 36 | if (proc->current_symbol) { |
| 37 | delete_breakpoint(proc->pid, &proc->return_value); |
| 38 | } |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 39 | } |
| 40 | proc->breakpoints_enabled = 0; |
| 41 | } |