Deleted Added
full compact
db_command.c (221121) db_command.c (222801)
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

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

27 * Author: David B. Golub, Carnegie Mellon University
28 * Date: 7/90
29 */
30/*
31 * Command dispatcher.
32 */
33
34#include <sys/cdefs.h>
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

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

27 * Author: David B. Golub, Carnegie Mellon University
28 * Date: 7/90
29 */
30/*
31 * Command dispatcher.
32 */
33
34#include <sys/cdefs.h>
35__FBSDID("$FreeBSD: head/sys/ddb/db_command.c 221121 2011-04-27 16:43:03Z attilio $");
35__FBSDID("$FreeBSD: head/sys/ddb/db_command.c 222801 2011-06-07 01:28:12Z marcel $");
36
37#include <sys/param.h>
38#include <sys/linker_set.h>
39#include <sys/lock.h>
40#include <sys/kdb.h>
41#include <sys/mutex.h>
42#include <sys/proc.h>
43#include <sys/reboot.h>
44#include <sys/signalvar.h>
45#include <sys/systm.h>
46#include <sys/cons.h>
36
37#include <sys/param.h>
38#include <sys/linker_set.h>
39#include <sys/lock.h>
40#include <sys/kdb.h>
41#include <sys/mutex.h>
42#include <sys/proc.h>
43#include <sys/reboot.h>
44#include <sys/signalvar.h>
45#include <sys/systm.h>
46#include <sys/cons.h>
47#include <sys/conf.h>
47#include <sys/watchdog.h>
48#include <sys/kernel.h>
49
50#include <ddb/ddb.h>
51#include <ddb/db_command.h>
52#include <ddb/db_lex.h>
53#include <ddb/db_output.h>
54

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

59 * Exported global variables
60 */
61boolean_t db_cmd_loop_done;
62db_addr_t db_dot;
63db_addr_t db_last_addr;
64db_addr_t db_prev;
65db_addr_t db_next;
66
48#include <sys/watchdog.h>
49#include <sys/kernel.h>
50
51#include <ddb/ddb.h>
52#include <ddb/db_command.h>
53#include <ddb/db_lex.h>
54#include <ddb/db_output.h>
55

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

60 * Exported global variables
61 */
62boolean_t db_cmd_loop_done;
63db_addr_t db_dot;
64db_addr_t db_last_addr;
65db_addr_t db_prev;
66db_addr_t db_next;
67
68static db_cmdfcn_t db_dump;
67static db_cmdfcn_t db_fncall;
68static db_cmdfcn_t db_gdb;
69static db_cmdfcn_t db_halt;
70static db_cmdfcn_t db_kill;
71static db_cmdfcn_t db_reset;
72static db_cmdfcn_t db_stack_trace;
73static db_cmdfcn_t db_stack_trace_all;
74static db_cmdfcn_t db_watchdog;

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

97 { "examine", db_examine_cmd, CS_SET_DOT, 0 },
98 { "x", db_examine_cmd, CS_SET_DOT, 0 },
99 { "search", db_search_cmd, CS_OWN|CS_SET_DOT, 0 },
100 { "set", db_set_cmd, CS_OWN, 0 },
101 { "write", db_write_cmd, CS_MORE|CS_SET_DOT, 0 },
102 { "w", db_write_cmd, CS_MORE|CS_SET_DOT, 0 },
103 { "delete", db_delete_cmd, 0, 0 },
104 { "d", db_delete_cmd, 0, 0 },
69static db_cmdfcn_t db_fncall;
70static db_cmdfcn_t db_gdb;
71static db_cmdfcn_t db_halt;
72static db_cmdfcn_t db_kill;
73static db_cmdfcn_t db_reset;
74static db_cmdfcn_t db_stack_trace;
75static db_cmdfcn_t db_stack_trace_all;
76static db_cmdfcn_t db_watchdog;

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

99 { "examine", db_examine_cmd, CS_SET_DOT, 0 },
100 { "x", db_examine_cmd, CS_SET_DOT, 0 },
101 { "search", db_search_cmd, CS_OWN|CS_SET_DOT, 0 },
102 { "set", db_set_cmd, CS_OWN, 0 },
103 { "write", db_write_cmd, CS_MORE|CS_SET_DOT, 0 },
104 { "w", db_write_cmd, CS_MORE|CS_SET_DOT, 0 },
105 { "delete", db_delete_cmd, 0, 0 },
106 { "d", db_delete_cmd, 0, 0 },
107 { "dump", db_dump, 0, 0 },
105 { "break", db_breakpoint_cmd, 0, 0 },
106 { "b", db_breakpoint_cmd, 0, 0 },
107 { "dwatch", db_deletewatch_cmd, 0, 0 },
108 { "watch", db_watchpoint_cmd, CS_MORE,0 },
109 { "dhwatch", db_deletehwatch_cmd, 0, 0 },
110 { "hwatch", db_hwatchpoint_cmd, 0, 0 },
111 { "step", db_single_step_cmd, 0, 0 },
112 { "s", db_single_step_cmd, 0, 0 },

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

521 const char *s;
522{
523 if (s)
524 db_printf("%s", s);
525 db_flush_lex();
526 kdb_reenter();
527}
528
108 { "break", db_breakpoint_cmd, 0, 0 },
109 { "b", db_breakpoint_cmd, 0, 0 },
110 { "dwatch", db_deletewatch_cmd, 0, 0 },
111 { "watch", db_watchpoint_cmd, CS_MORE,0 },
112 { "dhwatch", db_deletehwatch_cmd, 0, 0 },
113 { "hwatch", db_hwatchpoint_cmd, 0, 0 },
114 { "step", db_single_step_cmd, 0, 0 },
115 { "s", db_single_step_cmd, 0, 0 },

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

524 const char *s;
525{
526 if (s)
527 db_printf("%s", s);
528 db_flush_lex();
529 kdb_reenter();
530}
531
532static void
533db_dump(db_expr_t dummy, boolean_t dummy2, db_expr_t dummy3, char *dummy4)
534{
535 int error;
529
536
537 error = doadump(FALSE);
538 if (error) {
539 db_printf("Cannot dump: ");
540 switch (error) {
541 case EBUSY:
542 db_printf("debugger got invoked while dumping.\n");
543 break;
544 case ENXIO:
545 db_printf("no dump device specified.\n");
546 break;
547 default:
548 db_printf("unknown error (error=%d).\n", error);
549 break;
550 }
551 }
552}
553
530/*
531 * Call random function:
532 * !expr(arg,arg,arg)
533 */
534
535/* The generic implementation supports a maximum of 10 arguments. */
536typedef db_expr_t __db_f(db_expr_t, db_expr_t, db_expr_t, db_expr_t,
537 db_expr_t, db_expr_t, db_expr_t, db_expr_t, db_expr_t, db_expr_t);

--- 305 unchanged lines hidden ---
554/*
555 * Call random function:
556 * !expr(arg,arg,arg)
557 */
558
559/* The generic implementation supports a maximum of 10 arguments. */
560typedef db_expr_t __db_f(db_expr_t, db_expr_t, db_expr_t, db_expr_t,
561 db_expr_t, db_expr_t, db_expr_t, db_expr_t, db_expr_t, db_expr_t);

--- 305 unchanged lines hidden ---