This source file includes following definitions.
- db_trap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 #include <sys/param.h>
37 #include <sys/proc.h>
38 #include <sys/systm.h>
39
40 #include <uvm/uvm_extern.h>
41
42 #include <machine/db_machdep.h>
43
44 #include <ddb/db_run.h>
45 #include <ddb/db_command.h>
46 #include <ddb/db_break.h>
47 #include <ddb/db_output.h>
48 #include <ddb/db_sym.h>
49 #include <ddb/db_extern.h>
50 #include <ddb/db_interface.h>
51
52 void
53 db_trap(int type, int code)
54 {
55 boolean_t bkpt;
56 boolean_t watchpt;
57
58 bkpt = IS_BREAKPOINT_TRAP(type, code);
59 watchpt = IS_WATCHPOINT_TRAP(type, code);
60
61 if (db_stop_at_pc(DDB_REGS, &bkpt)) {
62 if (db_inst_count) {
63 db_printf("After %d instructions ", db_inst_count);
64 db_printf("(%d loads, %d stores),\n", db_load_count,
65 db_store_count);
66 }
67 if (bkpt)
68 db_printf("Breakpoint at\t");
69 else if (watchpt)
70 db_printf("Watchpoint at\t");
71 else
72 db_printf("Stopped at\t");
73 db_dot = PC_REGS(DDB_REGS);
74 db_print_loc_and_inst(db_dot);
75
76
77
78
79
80 if (cold) {
81 db_stack_trace_print(db_dot, 0, 10 , "",
82 db_printf);
83 }
84
85 if (panicstr != NULL) {
86 if (db_print_position() != 0)
87 db_printf("\n");
88 db_printf("RUN AT LEAST 'trace' AND 'ps' AND INCLUDE "
89 "OUTPUT WHEN REPORTING THIS PANIC!\n");
90 db_printf("DO NOT EVEN BOTHER REPORTING THIS WITHOUT "
91 "INCLUDING THAT INFORMATION!\n");
92 }
93
94 db_command_loop();
95 }
96
97 db_restart_at_pc(DDB_REGS, watchpt);
98 }