blob: 883d7edab4c08e565a8e193de0b68387d88bfced [file] [log] [blame]
Juan Cespedesd44c6b81998-09-25 14:48:42 +02001#if HAVE_CONFIG_H
2#include "config.h"
3#endif
4
Juan Cespedes5e01f651998-03-08 22:31:44 +01005#include "ltrace.h"
6#include "options.h"
7#include "output.h"
8
9void 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 Cespedes5e0acdb1998-04-04 08:34:07 +020021 if (proc->current_symbol) {
22 insert_breakpoint(proc->pid, &proc->return_value);
23 }
Juan Cespedes5e01f651998-03-08 22:31:44 +010024 }
25 proc->breakpoints_enabled = 1;
26}
27
28void 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 Cespedes5e0acdb1998-04-04 08:34:07 +020040 if (proc->current_symbol) {
41 delete_breakpoint(proc->pid, &proc->return_value);
42 }
Juan Cespedes5e01f651998-03-08 22:31:44 +010043 }
44 proc->breakpoints_enabled = 0;
45}