2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
32 * Mach Operating System
33 * Copyright (c) 1991,1990 Carnegie Mellon University
34 * All Rights Reserved.
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
46 * Carnegie Mellon requests users of this software to return to
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
60 * Interface to new debugger.
62 #include <platforms.h>
63 #include <time_stamp.h>
64 #include <mach_mp_debug.h>
65 #include <mach_ldebug.h>
67 #include <kern/cpu_number.h>
68 #include <kern/kern_types.h>
69 #include <kern/misc_protos.h>
72 #include <i386/thread.h>
73 #include <i386/db_machdep.h>
75 #include <i386/trap.h>
76 #include <i386/setjmp.h>
77 #include <i386/pmap.h>
78 #include <i386/misc_protos.h>
80 #include <i386/machine_cpu.h>
82 #include <mach/vm_param.h>
83 #include <vm/vm_map.h>
84 #include <kern/thread.h>
85 #include <kern/task.h>
87 #include <ddb/db_command.h>
88 #include <ddb/db_task_thread.h>
89 #include <ddb/db_run.h>
90 #include <ddb/db_trap.h>
91 #include <ddb/db_output.h>
92 #include <ddb/db_access.h>
93 #include <ddb/db_sym.h>
94 #include <ddb/db_break.h>
95 #include <ddb/db_watch.h>
97 #include <i386/cpu_data.h>
100 x86_saved_state32_t
*i386_last_saved_statep
;
101 x86_saved_state32_t i386_nested_saved_state
;
102 unsigned i386_last_kdb_sp
;
104 extern thread_t db_default_act
;
105 extern pt_entry_t
*DMAP1
;
106 extern caddr_t DADDR1
;
109 extern int masked_state_cnt
[];
110 #endif /* MACH_MP_DEBUG */
113 * Enter KDB through a keyboard trap.
114 * We show the registers as of the keyboard interrupt
115 * instead of those at its call to KDB.
124 x86_saved_state32_t
*is
;
127 extern char * trap_type
[];
128 extern int TRAP_TYPES
;
132 extern void kdbprinttrap(
137 extern void kdb_kentry(
138 struct int_regs
*int_regs
);
139 extern int db_user_to_kernel_address(
144 extern void db_write_bytes_user_space(
149 extern int db_search_null(
155 extern int kdb_enter(int);
156 extern void kdb_leave(void);
157 extern void lock_kdb(void);
158 extern void unlock_kdb(void);
161 * kdb_trap - field a TRACE or BPT trap
165 extern jmp_buf_t
*db_recover
;
168 * Translate the state saved in a task state segment into an
169 * exception frame. Since we "know" we always want the state
170 * in a ktss, we hard-wire that in, rather than indexing the gdt
171 * with tss_sel to derive a pointer to the desired tss.
175 * Code used to synchronize kdb among all cpus, one active at a time, switch
176 * from one to another using cpu #cpu
179 decl_simple_lock_data(, kdb_lock
) /* kdb lock */
181 #define db_simple_lock_init(l, e) hw_lock_init(&((l)->interlock))
182 #define db_simple_lock_try(l) hw_lock_try(&((l)->interlock))
183 #define db_simple_unlock(l) hw_lock_unlock(&((l)->interlock))
185 int kdb_cpu
= -1; /* current cpu running kdb */
187 volatile unsigned int cpus_holding_bkpts
; /* counter for number of cpus
188 * holding breakpoints
190 extern boolean_t db_breakpoints_inserted
;
195 x86_saved_state32_t
*regs
)
197 extern struct i386_tss ktss
;
198 int mycpu
= cpu_number();
199 struct i386_tss
*tss
;
201 tss
= cpu_datap(mycpu
)->cpu_desc_index
.cdi_ktss
; /* XXX */
204 * ddb will overwrite whatever's in esp, so put esp0 elsewhere, too.
206 regs
->cr2
= tss
->esp0
;
207 regs
->efl
= tss
->eflags
;
208 regs
->eip
= tss
->eip
;
209 regs
->trapno
= tss
->ss0
; /* XXX */
210 regs
->err
= tss
->esp0
; /* XXX */
211 regs
->eax
= tss
->eax
;
212 regs
->ecx
= tss
->ecx
;
213 regs
->edx
= tss
->edx
;
214 regs
->ebx
= tss
->ebx
;
215 regs
->uesp
= tss
->esp
;
216 regs
->ebp
= tss
->ebp
;
217 regs
->esi
= tss
->esi
;
218 regs
->edi
= tss
->edi
;
228 * Compose a call to the debugger from the saved state in regs. (No
229 * reason not to do this in C.)
233 x86_saved_state32_t
*regs
)
240 return (kdb_trap(type
, code
, regs
));
247 x86_saved_state32_t
*regs
)
250 boolean_t trap_from_user
;
252 int previous_console_device
;
256 previous_console_device
= switch_to_serial_console();
258 db_printf("kdb_trap(): type %d, code %d, regs->eip 0x%x\n", type
, code
, regs
->eip
);
260 case T_DEBUG
: /* single_step */
262 extern int dr_addr
[];
266 if (status
& 0xf) { /* hmm hdw break */
267 addr
= status
& 0x8 ? dr_addr
[3] :
268 status
& 0x4 ? dr_addr
[2] :
269 status
& 0x2 ? dr_addr
[1] :
272 db_single_step_cmd(addr
, 0, 1, "p");
275 case T_INT3
: /* breakpoint */
276 case T_WATCHPOINT
: /* watchpoint */
277 case -1: /* keyboard interrupt */
282 i386_nested_saved_state
= *regs
;
283 db_printf("Caught ");
284 if (type
< 0 || type
> TRAP_TYPES
)
285 db_printf("type %d", type
);
287 db_printf("%s", trap_type
[type
]);
288 db_printf(" trap, code = %x, pc = %x\n",
294 kdbprinttrap(type
, code
, (int *)®s
->eip
, regs
->uesp
);
297 disable_preemption();
299 current_cpu_datap()->cpu_kdb_saved_ipl
= s
;
300 current_cpu_datap()->cpu_kdb_saved_state
= regs
;
302 i386_last_saved_statep
= regs
;
303 i386_last_kdb_sp
= (unsigned) &type
;
305 if (!kdb_enter(regs
->eip
))
308 /* Should switch to kdb's own stack here. */
310 if (!IS_USER_TRAP(regs
, &etext
)) {
311 bzero((char *)&ddb_regs
, sizeof (ddb_regs
));
312 *(struct x86_saved_state32_from_kernel
*)&ddb_regs
=
313 *(struct x86_saved_state32_from_kernel
*)regs
;
314 trap_from_user
= FALSE
;
318 trap_from_user
= TRUE
;
320 if (!trap_from_user
) {
322 * Kernel mode - esp and ss not saved
324 ddb_regs
.uesp
= (int)®s
->uesp
; /* kernel stack pointer */
325 ddb_regs
.ss
= KERNEL_DS
;
329 db_task_trap(type
, code
, trap_from_user
);
332 regs
->eip
= ddb_regs
.eip
;
333 regs
->efl
= ddb_regs
.efl
;
334 regs
->eax
= ddb_regs
.eax
;
335 regs
->ecx
= ddb_regs
.ecx
;
336 regs
->edx
= ddb_regs
.edx
;
337 regs
->ebx
= ddb_regs
.ebx
;
339 if (trap_from_user
) {
341 * user mode - saved esp and ss valid
343 regs
->uesp
= ddb_regs
.uesp
; /* user stack pointer */
344 regs
->ss
= ddb_regs
.ss
& 0xffff; /* user stack segment */
347 regs
->ebp
= ddb_regs
.ebp
;
348 regs
->esi
= ddb_regs
.esi
;
349 regs
->edi
= ddb_regs
.edi
;
350 regs
->es
= ddb_regs
.es
& 0xffff;
351 regs
->cs
= ddb_regs
.cs
& 0xffff;
352 regs
->ds
= ddb_regs
.ds
& 0xffff;
353 regs
->fs
= ddb_regs
.fs
& 0xffff;
354 regs
->gs
= ddb_regs
.gs
& 0xffff;
356 if ((type
== T_INT3
) &&
357 (db_get_task_value(regs
->eip
,
360 db_target_space(current_thread(),
363 regs
->eip
+= BKPT_SIZE
;
365 switch_to_old_console(previous_console_device
);
369 current_cpu_datap()->cpu_kdb_saved_state
= 0;
375 /* Allow continue to upper layers of exception handling if
376 * trap was not a debugging trap.
379 if (trap_from_user
&& type
!= T_DEBUG
&& type
!= T_INT3
380 && type
!= T_WATCHPOINT
)
387 * Enter KDB through a keyboard trap.
388 * We show the registers as of the keyboard interrupt
389 * instead of those at its call to KDB.
396 struct int_regs
*int_regs
)
399 boolean_t trap_from_user
;
400 x86_saved_state32_t
*is
= int_regs
->is
;
401 x86_saved_state32_t regs
;
407 if (IS_USER_TRAP(is
, &etext
))
409 regs
.uesp
= ((int *)(is
+1))[0];
410 regs
.ss
= ((int *)(is
+1))[1];
414 regs
.uesp
= (int)(is
+1);
422 regs
.ebx
= int_regs
->ebx
;
423 regs
.ebp
= int_regs
->ebp
;
424 regs
.esi
= int_regs
->esi
;
425 regs
.edi
= int_regs
->edi
;
428 regs
.fs
= int_regs
->fs
;
429 regs
.gs
= int_regs
->gs
;
431 disable_preemption();
433 current_cpu_datap()->cpu_kdb_saved_state
= ®s
;
435 if (!kdb_enter(regs
.eip
))
438 bcopy((char *)®s
, (char *)&ddb_regs
, sizeof (ddb_regs
));
439 trap_from_user
= IS_USER_TRAP(&ddb_regs
, &etext
);
442 db_task_trap(-1, 0, trap_from_user
);
445 if (trap_from_user
) {
446 ((int *)(is
+1))[0] = ddb_regs
.uesp
;
447 ((int *)(is
+1))[1] = ddb_regs
.ss
& 0xffff;
449 is
->efl
= ddb_regs
.efl
;
450 is
->cs
= ddb_regs
.cs
& 0xffff;
451 is
->eip
= ddb_regs
.eip
;
452 is
->eax
= ddb_regs
.eax
;
453 is
->ecx
= ddb_regs
.ecx
;
454 is
->edx
= ddb_regs
.edx
;
455 int_regs
->ebx
= ddb_regs
.ebx
;
456 int_regs
->ebp
= ddb_regs
.ebp
;
457 int_regs
->esi
= ddb_regs
.esi
;
458 int_regs
->edi
= ddb_regs
.edi
;
459 is
->ds
= ddb_regs
.ds
& 0xffff;
460 is
->es
= ddb_regs
.es
& 0xffff;
461 int_regs
->fs
= ddb_regs
.fs
& 0xffff;
462 int_regs
->gs
= ddb_regs
.gs
& 0xffff;
466 current_cpu_datap()->cpu_kdb_saved_state
= 0;
485 if (type
< 0 || type
> TRAP_TYPES
)
486 db_printf("type %d", type
);
488 db_printf("%s", trap_type
[type
]);
489 db_printf(" trap, code=%x eip@%x = %x esp=%x\n",
490 code
, pc
, *(int *)pc
, sp
);
491 db_run_mode
= STEP_CONTINUE
;
495 db_user_to_kernel_address(
501 register pt_entry_t
*ptp
;
505 * must not pre-empted while using the pte pointer passed
506 * back since it's been mapped through a per-cpu window
508 mp_disable_preemption();
510 ptp
= pmap_pte(task
->map
->pmap
, (vm_map_offset_t
)addr
);
511 if (ptp
== PT_ENTRY_NULL
|| (*ptp
& INTEL_PTE_VALID
) == 0) {
513 db_printf("\nno memory is assigned to address %08x\n", addr
);
517 mp_enable_preemption();
520 src
= (vm_offset_t
)pte_to_pa(*ptp
);
522 mp_enable_preemption();
524 *(int *) DMAP1
= INTEL_PTE_VALID
| INTEL_PTE_RW
| (src
& PG_FRAME
) |
525 INTEL_PTE_REF
| INTEL_PTE_MOD
;
526 #if defined(I386_CPU)
527 if (cpu_class
== CPUCLASS_386
) {
532 invlpg((u_int
)DADDR1
);
535 *kaddr
= (unsigned)DADDR1
+ (addr
& PAGE_MASK
);
541 * Read bytes from kernel address space for debugger.
556 if (task
== kernel_task
|| task
== TASK_NULL
) {
557 while (--size
>= 0) {
558 if (addr
++ > VM_MAX_KERNEL_ADDRESS
) {
559 db_printf("\nbad address %x\n", addr
);
568 if (db_user_to_kernel_address(task
, addr
, &kern_addr
, 1) < 0)
570 src
= (char *)kern_addr
;
571 n
= intel_trunc_page(addr
+INTEL_PGBYTES
) - addr
;
582 * Write bytes to kernel address space for debugger.
594 register pt_entry_t
*ptep0
= 0;
595 pt_entry_t oldmap0
= 0;
597 register pt_entry_t
*ptep1
= 0;
598 pt_entry_t oldmap1
= 0;
601 if (task
&& task
!= kernel_task
) {
602 db_write_bytes_user_space(addr
, size
, data
, task
);
607 if (addr
>= VM_MIN_KERNEL_LOADED_ADDRESS
) {
608 db_write_bytes_user_space(addr
, size
, data
, kernel_task
);
612 if (addr
>= VM_MIN_KERNEL_ADDRESS
&&
613 addr
<= (vm_offset_t
)&etext
)
615 ptep0
= pmap_pte(kernel_pmap
, (vm_map_offset_t
)addr
);
617 *ptep0
|= INTEL_PTE_WRITE
;
619 addr1
= i386_trunc_page(addr
+ size
- 1);
620 if (i386_trunc_page(addr
) != addr1
) {
621 /* data crosses a page boundary */
623 ptep1
= pmap_pte(kernel_pmap
, (vm_map_offset_t
)addr1
);
625 *ptep1
|= INTEL_PTE_WRITE
;
632 while (--size
>= 0) {
633 if (addr
++ > VM_MAX_KERNEL_ADDRESS
) {
634 db_printf("\nbad address %x\n", addr
);
651 db_write_bytes_user_space(
662 if (db_user_to_kernel_address(task
, addr
, &kern_addr
, 1) < 0)
664 dst
= (char *)kern_addr
;
665 n
= intel_trunc_page(addr
+INTEL_PGBYTES
) - addr
;
684 if (task
== kernel_task
|| task
== TASK_NULL
) {
685 if (kernel_task
== TASK_NULL
)
688 } else if (task
== TASK_NULL
) {
689 if (current_thread() == THREAD_NULL
)
691 task
= current_thread()->task
;
694 if (db_user_to_kernel_address(task
, addr
, &kern_addr
, 0) < 0)
696 n
= intel_trunc_page(addr
+INTEL_PGBYTES
) - addr
;
712 unsigned kern_addr1
, kern_addr2
;
714 if ((addr1
& (INTEL_PGBYTES
-1)) != (addr2
& (INTEL_PGBYTES
-1)))
716 if (task1
== TASK_NULL
) {
717 if (current_thread() == THREAD_NULL
)
719 task1
= current_thread()->task
;
721 if (db_user_to_kernel_address(task1
, addr1
, &kern_addr1
, 0) < 0 ||
722 db_user_to_kernel_address(task2
, addr2
, &kern_addr2
, 0) < 0)
724 return(kern_addr1
== kern_addr2
);
727 #define DB_USER_STACK_ADDR (VM_MIN_KERNEL_ADDRESS)
728 #define DB_NAME_SEARCH_LIMIT (DB_USER_STACK_ADDR-(INTEL_PGBYTES*3))
738 register unsigned vaddr
;
739 register unsigned *kaddr
;
741 kaddr
= (unsigned *)*skaddr
;
742 for (vaddr
= *svaddr
; vaddr
> evaddr
; vaddr
-= sizeof(unsigned)) {
743 if (vaddr
% INTEL_PGBYTES
== 0) {
744 vaddr
-= sizeof(unsigned);
745 if (db_user_to_kernel_address(task
, vaddr
, skaddr
, 0) < 0)
747 kaddr
= (unsigned *)*skaddr
;
749 vaddr
-= sizeof(unsigned);
752 if ((*kaddr
== 0) ^ (flag
== 0)) {
754 *skaddr
= (unsigned)kaddr
;
767 unsigned vaddr
, kaddr
;
769 vaddr
= DB_USER_STACK_ADDR
;
773 * skip nulls at the end
775 if (db_search_null(task
, &vaddr
, DB_NAME_SEARCH_LIMIT
, &kaddr
, 0) < 0) {
776 db_printf(DB_NULL_TASK_NAME
);
780 * search start of args
782 if (db_search_null(task
, &vaddr
, DB_NAME_SEARCH_LIMIT
, &kaddr
, 1) < 0) {
783 db_printf(DB_NULL_TASK_NAME
);
787 n
= DB_TASK_NAME_LEN
-1;
788 p
= (char *)kaddr
+ sizeof(unsigned);
789 for (vaddr
+= sizeof(int); vaddr
< DB_USER_STACK_ADDR
&& n
> 0;
791 if (vaddr
% INTEL_PGBYTES
== 0) {
792 (void)db_user_to_kernel_address(task
, vaddr
, &kaddr
, 0);
795 db_printf("%c", (*p
< ' ' || *p
> '~')? ' ': *p
);
797 while (n
-- >= 0) /* compare with >= 0 for one more space */
802 db_machdep_init(void)
806 db_simple_lock_init(&kdb_lock
, 0);
807 for (c
= 0; c
< real_ncpus
; ++c
) {
808 if (c
== master_cpu
) {
809 master_dbtss
.esp0
= (int)(db_task_stack_store
+
810 (INTSTACK_SIZE
* (c
+ 1)) - sizeof (natural_t
));
811 master_dbtss
.esp
= master_dbtss
.esp0
;
812 master_dbtss
.eip
= (int)&db_task_start
;
814 * The TSS for the debugging task on each slave CPU
815 * is set up in cpu_desc_init().
822 * Called when entering kdb:
823 * Takes kdb lock. If if we were called remotely (slave state) we just
824 * wait for kdb_cpu to be equal to cpu_number(). Otherwise enter kdb if
825 * not active on another cpu.
826 * If db_pass_thru[cpu_number()] > 0, then kdb can't stop now.
835 disable_preemption();
837 my_cpu
= cpu_number();
839 if (current_cpu_datap()->cpu_db_pass_thru
) {
844 current_cpu_datap()->cpu_kdb_active
++;
848 db_printf("kdb_enter(): cpu_number %d, kdb_cpu %d\n", my_cpu
, kdb_cpu
);
850 if (db_breakpoints_inserted
)
851 cpus_holding_bkpts
++;
853 if (kdb_cpu
== -1 && !current_cpu_datap()->cpu_kdb_is_slave
) {
855 db_printf("Signaling other processors..\n");
856 remote_kdb(); /* stop other cpus */
858 } else if (kdb_cpu
== my_cpu
)
873 boolean_t wait
= FALSE
;
875 disable_preemption();
877 my_cpu
= cpu_number();
879 if (db_run_mode
== STEP_CONTINUE
) {
883 if (db_breakpoints_inserted
)
884 cpus_holding_bkpts
--;
885 if (current_cpu_datap()->cpu_kdb_is_slave
)
886 current_cpu_datap()->cpu_kdb_is_slave
--;
888 db_printf("kdb_leave: cpu %d, kdb_cpu %d, run_mode %d pc %x (%x) holds %d\n",
889 my_cpu
, kdb_cpu
, db_run_mode
,
890 ddb_regs
.eip
, *(int *)ddb_regs
.eip
,
894 current_cpu_datap()->cpu_kdb_active
--;
901 while(cpus_holding_bkpts
);
911 disable_preemption();
913 my_cpu
= cpu_number();
916 if (kdb_cpu
!= -1 && kdb_cpu
!= my_cpu
) {
919 if (db_simple_lock_try(&kdb_lock
)) {
920 if (kdb_cpu
== -1 || kdb_cpu
== my_cpu
)
922 db_simple_unlock(&kdb_lock
);
930 extern unsigned old_time_stamp
;
931 #endif /* TIME_STAMP */
936 db_simple_unlock(&kdb_lock
);
939 #endif /* TIME_STAMP */
944 #define KDB_SAVE(type, name) extern type name; type name##_save = name
945 #define KDB_RESTORE(name) name = name##_save
947 #define KDB_SAVE(type, name) extern type name; type name/**/_save = name
948 #define KDB_RESTORE(name) name = name/**/_save
949 #endif /* __STDC__ */
951 #define KDB_SAVE_CTXT() \
952 KDB_SAVE(int, db_run_mode); \
953 KDB_SAVE(boolean_t, db_sstep_print); \
954 KDB_SAVE(int, db_loop_count); \
955 KDB_SAVE(int, db_call_depth); \
956 KDB_SAVE(int, db_inst_count); \
957 KDB_SAVE(int, db_last_inst_count); \
958 KDB_SAVE(int, db_load_count); \
959 KDB_SAVE(int, db_store_count); \
960 KDB_SAVE(boolean_t, db_cmd_loop_done); \
961 KDB_SAVE(jmp_buf_t *, db_recover); \
962 KDB_SAVE(db_addr_t, db_dot); \
963 KDB_SAVE(db_addr_t, db_last_addr); \
964 KDB_SAVE(db_addr_t, db_prev); \
965 KDB_SAVE(db_addr_t, db_next); \
966 KDB_SAVE(db_regs_t, ddb_regs);
968 #define KDB_RESTORE_CTXT() \
969 KDB_RESTORE(db_run_mode); \
970 KDB_RESTORE(db_sstep_print); \
971 KDB_RESTORE(db_loop_count); \
972 KDB_RESTORE(db_call_depth); \
973 KDB_RESTORE(db_inst_count); \
974 KDB_RESTORE(db_last_inst_count); \
975 KDB_RESTORE(db_load_count); \
976 KDB_RESTORE(db_store_count); \
977 KDB_RESTORE(db_cmd_loop_done); \
978 KDB_RESTORE(db_recover); \
979 KDB_RESTORE(db_dot); \
980 KDB_RESTORE(db_last_addr); \
981 KDB_RESTORE(db_prev); \
982 KDB_RESTORE(db_next); \
983 KDB_RESTORE(ddb_regs);
986 * switch to another cpu
994 if (cpu
< 0 || cpu
>= real_ncpus
|| !cpu_datap(cpu
)->cpu_kdb_active
)
996 db_set_breakpoints();
997 db_set_watchpoints();
1001 db_clear_breakpoints();
1002 db_clear_watchpoints();
1004 if (kdb_cpu
== -1) {/* someone continued */
1005 kdb_cpu
= cpu_number();
1006 db_continue_cmd(0, 0, 0, "");
1014 extern void kdp_reboot(void);
1018 boolean_t have_addr
,