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