MCPcopy Create free account
hub / github.com/F-Stack/f-stack / db_set_watchpoint

Function db_set_watchpoint

freebsd/ddb/db_watch.c:97–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97static void
98db_set_watchpoint(vm_map_t map, db_addr_t addr, vm_size_t size)
99{
100 db_watchpoint_t watch;
101
102 if (map == NULL) {
103 db_printf("No map.\n");
104 return;
105 }
106
107 /*
108 * Should we do anything fancy with overlapping regions?
109 */
110
111 for (watch = db_watchpoint_list;
112 watch != 0;
113 watch = watch->link)
114 if (db_map_equal(watch->map, map) &&
115 (watch->loaddr == addr) &&
116 (watch->hiaddr == addr+size)) {
117 db_printf("Already set.\n");
118 return;
119 }
120
121 watch = db_watchpoint_alloc();
122 if (watch == 0) {
123 db_printf("Too many watchpoints.\n");
124 return;
125 }
126
127 watch->map = map;
128 watch->loaddr = addr;
129 watch->hiaddr = addr+size;
130
131 watch->link = db_watchpoint_list;
132 db_watchpoint_list = watch;
133
134 db_watchpoints_inserted = false;
135}
136
137static void
138db_delete_watchpoint(vm_map_t map, db_addr_t addr)

Callers 1

db_watch.cFile · 0.85

Calls 3

db_printfFunction · 0.85
db_map_equalFunction · 0.85
db_watchpoint_allocFunction · 0.85

Tested by

no test coverage detected