Deleted Added
full compact
db_watch.c (76166) db_watch.c (79573)
1/*
2 * Mach Operating System
3 * Copyright (c) 1991,1990 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the

--- 9 unchanged lines hidden (view full) ---

18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie the
24 * rights to redistribute these changes.
25 *
1/*
2 * Mach Operating System
3 * Copyright (c) 1991,1990 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the

--- 9 unchanged lines hidden (view full) ---

18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie the
24 * rights to redistribute these changes.
25 *
26 * $FreeBSD: head/sys/ddb/db_watch.c 76166 2001-05-01 08:13:21Z markm $
26 * $FreeBSD: head/sys/ddb/db_watch.c 79573 2001-07-11 03:15:25Z bsd $
27 */
28
29/*
30 * Author: Richard P. Draves, Carnegie Mellon University
31 * Date: 10/90
32 */
33
34#include <sys/param.h>

--- 27 unchanged lines hidden (view full) ---

62#ifdef notused
63static boolean_t db_find_watchpoint __P((vm_map_t map, db_addr_t addr,
64 db_regs_t *regs));
65#endif
66static void db_list_watchpoints __P((void));
67static void db_set_watchpoint __P((vm_map_t map, db_addr_t addr,
68 vm_size_t size));
69
27 */
28
29/*
30 * Author: Richard P. Draves, Carnegie Mellon University
31 * Date: 10/90
32 */
33
34#include <sys/param.h>

--- 27 unchanged lines hidden (view full) ---

62#ifdef notused
63static boolean_t db_find_watchpoint __P((vm_map_t map, db_addr_t addr,
64 db_regs_t *regs));
65#endif
66static void db_list_watchpoints __P((void));
67static void db_set_watchpoint __P((vm_map_t map, db_addr_t addr,
68 vm_size_t size));
69
70int db_md_set_watchpoint __P((db_expr_t addr, db_expr_t size));
71int db_md_clr_watchpoint __P((db_expr_t addr, db_expr_t size));
72void db_md_list_watchpoints __P((void));
70
73
74
71db_watchpoint_t
72db_watchpoint_alloc()
73{
74 register db_watchpoint_t watch;
75
76 if ((watch = db_free_watchpoints) != 0) {
77 db_free_watchpoints = watch->link;
78 return (watch);

--- 136 unchanged lines hidden (view full) ---

215
216/*
217 * At least one non-optional show-command must be implemented using
218 * DB_SHOW_COMMAND() so that db_show_cmd_set gets created. Here is one.
219 */
220DB_SHOW_COMMAND(watches, db_listwatch_cmd)
221{
222 db_list_watchpoints();
75db_watchpoint_t
76db_watchpoint_alloc()
77{
78 register db_watchpoint_t watch;
79
80 if ((watch = db_free_watchpoints) != 0) {
81 db_free_watchpoints = watch->link;
82 return (watch);

--- 136 unchanged lines hidden (view full) ---

219
220/*
221 * At least one non-optional show-command must be implemented using
222 * DB_SHOW_COMMAND() so that db_show_cmd_set gets created. Here is one.
223 */
224DB_SHOW_COMMAND(watches, db_listwatch_cmd)
225{
226 db_list_watchpoints();
227 db_md_list_watchpoints();
223}
224
225void
226db_set_watchpoints()
227{
228 register db_watchpoint_t watch;
229
230 if (!db_watchpoints_inserted) {

--- 46 unchanged lines hidden (view full) ---

277 if (found) {
278 db_watchpoints_inserted = FALSE;
279 db_single_step(regs);
280 }
281
282 return (FALSE);
283}
284#endif
228}
229
230void
231db_set_watchpoints()
232{
233 register db_watchpoint_t watch;
234
235 if (!db_watchpoints_inserted) {

--- 46 unchanged lines hidden (view full) ---

282 if (found) {
283 db_watchpoints_inserted = FALSE;
284 db_single_step(regs);
285 }
286
287 return (FALSE);
288}
289#endif
290
291
292
293/* Delete hardware watchpoint */
294/*ARGSUSED*/
295void
296db_deletehwatch_cmd(addr, have_addr, count, modif)
297 db_expr_t addr;
298 boolean_t have_addr;
299 db_expr_t count;
300 char * modif;
301{
302 int rc;
303
304 if (count < 0)
305 count = 4;
306
307 rc = db_md_clr_watchpoint(addr, count);
308 if (rc < 0)
309 db_printf("hardware watchpoint could not be deleted\n");
310}
311
312/* Set hardware watchpoint */
313/*ARGSUSED*/
314void
315db_hwatchpoint_cmd(addr, have_addr, count, modif)
316 db_expr_t addr;
317 boolean_t have_addr;
318 db_expr_t count;
319 char * modif;
320{
321 int rc;
322
323 if (count < 0)
324 count = 4;
325
326 rc = db_md_set_watchpoint(addr, count);
327 if (rc < 0)
328 db_printf("hardware watchpoint could not be set\n");
329}