blob: e4c7cfe1b15f37dd21dbb5badccc2557dc75aaba [file] [log] [blame]
Juan Cespedes5e01f651998-03-08 22:31:44 +01001#include "ltrace.h"
2#include "options.h"
3#include "output.h"
4
5void 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 Cespedes5e0acdb1998-04-04 08:34:07 +020017 if (proc->current_symbol) {
18 insert_breakpoint(proc->pid, &proc->return_value);
19 }
Juan Cespedes5e01f651998-03-08 22:31:44 +010020 }
21 proc->breakpoints_enabled = 1;
22}
23
24void 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 Cespedes5e0acdb1998-04-04 08:34:07 +020036 if (proc->current_symbol) {
37 delete_breakpoint(proc->pid, &proc->return_value);
38 }
Juan Cespedes5e01f651998-03-08 22:31:44 +010039 }
40 proc->breakpoints_enabled = 0;
41}