2 * Copyright (c) 2000 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 <mach/vm_param.h>
81 #include <vm/vm_map.h>
82 #include <kern/thread.h>
83 #include <kern/task.h>
85 #include <ddb/db_command.h>
86 #include <ddb/db_task_thread.h>
87 #include <ddb/db_run.h>
88 #include <ddb/db_trap.h>
89 #include <ddb/db_output.h>
90 #include <ddb/db_access.h>
91 #include <ddb/db_sym.h>
92 #include <ddb/db_break.h>
93 #include <ddb/db_watch.h>
96 struct i386_saved_state
*i386_last_saved_statep
;
97 struct i386_saved_state i386_nested_saved_state
;
98 unsigned i386_last_kdb_sp
;
100 extern thread_t db_default_act
;
101 extern pt_entry_t
*DMAP1
;
102 extern caddr_t DADDR1
;
105 extern int masked_state_cnt
[];
106 #endif /* MACH_MP_DEBUG */
109 * Enter KDB through a keyboard trap.
110 * We show the registers as of the keyboard interrupt
111 * instead of those at its call to KDB.
120 struct i386_interrupt_state
*is
;
123 extern char * trap_type
[];
124 extern int TRAP_TYPES
;
128 extern void kdbprinttrap(
133 extern void kdb_kentry(
134 struct int_regs
*int_regs
);
135 extern int db_user_to_kernel_address(
140 extern void db_write_bytes_user_space(
145 extern int db_search_null(
151 extern int kdb_enter(int);
152 extern void kdb_leave(void);
153 extern void lock_kdb(void);
154 extern void unlock_kdb(void);
157 * kdb_trap - field a TRACE or BPT trap
161 extern jmp_buf_t
*db_recover
;
164 * Translate the state saved in a task state segment into an
165 * exception frame. Since we "know" we always want the state
166 * in a ktss, we hard-wire that in, rather than indexing the gdt
167 * with tss_sel to derive a pointer to the desired tss.
172 struct i386_saved_state
*regs
)
174 extern struct i386_tss ktss
;
175 int mycpu
= cpu_number();
176 struct i386_tss
*tss
;
178 tss
= cpu_datap(mycpu
)->cpu_desc_index
.cdi_ktss
; /* XXX */
181 * ddb will overwrite whatever's in esp, so put esp0 elsewhere, too.
183 regs
->esp
= tss
->esp0
;
184 regs
->efl
= tss
->eflags
;
185 regs
->eip
= tss
->eip
;
186 regs
->trapno
= tss
->ss0
; /* XXX */
187 regs
->err
= tss
->esp0
; /* XXX */
188 regs
->eax
= tss
->eax
;
189 regs
->ecx
= tss
->ecx
;
190 regs
->edx
= tss
->edx
;
191 regs
->ebx
= tss
->ebx
;
192 regs
->uesp
= tss
->esp
;
193 regs
->ebp
= tss
->ebp
;
194 regs
->esi
= tss
->esi
;
195 regs
->edi
= tss
->edi
;
205 * Compose a call to the debugger from the saved state in regs. (No
206 * reason not to do this in C.)
210 struct i386_saved_state
*regs
)
217 return (kdb_trap(type
, code
, regs
));
224 struct i386_saved_state
*regs
)
227 boolean_t trap_from_user
;
231 case T_DEBUG
: /* single_step */
233 extern int dr_addr
[];
237 if (status
& 0xf) { /* hmm hdw break */
238 addr
= status
& 0x8 ? dr_addr
[3] :
239 status
& 0x4 ? dr_addr
[2] :
240 status
& 0x2 ? dr_addr
[1] :
243 db_single_step_cmd(addr
, 0, 1, "p");
246 case T_INT3
: /* breakpoint */
247 case T_WATCHPOINT
: /* watchpoint */
248 case -1: /* keyboard interrupt */
253 i386_nested_saved_state
= *regs
;
254 db_printf("Caught ");
255 if (type
< 0 || type
> TRAP_TYPES
)
256 db_printf("type %d", type
);
258 db_printf("%s", trap_type
[type
]);
259 db_printf(" trap, code = %x, pc = %x\n",
265 kdbprinttrap(type
, code
, (int *)®s
->eip
, regs
->uesp
);
268 disable_preemption();
270 current_cpu_datap()->cpu_kdb_saved_ipl
= s
;
271 current_cpu_datap()->cpu_kdb_saved_state
= regs
;
273 i386_last_saved_statep
= regs
;
274 i386_last_kdb_sp
= (unsigned) &type
;
276 if (!kdb_enter(regs
->eip
))
279 /* Should switch to kdb's own stack here. */
281 if (!IS_USER_TRAP(regs
, &etext
)) {
282 bzero((char *)&ddb_regs
, sizeof (ddb_regs
));
283 *(struct i386_saved_state_from_kernel
*)&ddb_regs
=
284 *(struct i386_saved_state_from_kernel
*)regs
;
285 trap_from_user
= FALSE
;
289 trap_from_user
= TRUE
;
291 if (!trap_from_user
) {
293 * Kernel mode - esp and ss not saved
295 ddb_regs
.uesp
= (int)®s
->uesp
; /* kernel stack pointer */
296 ddb_regs
.ss
= KERNEL_DS
;
300 db_task_trap(type
, code
, trap_from_user
);
303 regs
->eip
= ddb_regs
.eip
;
304 regs
->efl
= ddb_regs
.efl
;
305 regs
->eax
= ddb_regs
.eax
;
306 regs
->ecx
= ddb_regs
.ecx
;
307 regs
->edx
= ddb_regs
.edx
;
308 regs
->ebx
= ddb_regs
.ebx
;
309 if (trap_from_user
) {
311 * user mode - saved esp and ss valid
313 regs
->uesp
= ddb_regs
.uesp
; /* user stack pointer */
314 regs
->ss
= ddb_regs
.ss
& 0xffff; /* user stack segment */
316 regs
->ebp
= ddb_regs
.ebp
;
317 regs
->esi
= ddb_regs
.esi
;
318 regs
->edi
= ddb_regs
.edi
;
319 regs
->es
= ddb_regs
.es
& 0xffff;
320 regs
->cs
= ddb_regs
.cs
& 0xffff;
321 regs
->ds
= ddb_regs
.ds
& 0xffff;
322 regs
->fs
= ddb_regs
.fs
& 0xffff;
323 regs
->gs
= ddb_regs
.gs
& 0xffff;
325 if ((type
== T_INT3
) &&
326 (db_get_task_value(regs
->eip
,
329 db_target_space(current_thread(),
332 regs
->eip
+= BKPT_SIZE
;
337 current_cpu_datap()->cpu_kdb_saved_state
= 0;
340 current_cpu_datap()->cpu_masked_state_cnt
= 0;
341 #endif /* MACH_MP_DEBUG */
347 /* Allow continue to upper layers of exception handling if
348 * trap was not a debugging trap.
351 if (trap_from_user
&& type
!= T_DEBUG
&& type
!= T_INT3
352 && type
!= T_WATCHPOINT
)
359 * Enter KDB through a keyboard trap.
360 * We show the registers as of the keyboard interrupt
361 * instead of those at its call to KDB.
368 struct int_regs
*int_regs
)
371 boolean_t trap_from_user
;
372 struct i386_interrupt_state
*is
= int_regs
->is
;
373 struct i386_saved_state regs
;
379 if (IS_USER_TRAP(is
, &etext
))
381 regs
.uesp
= ((int *)(is
+1))[0];
382 regs
.ss
= ((int *)(is
+1))[1];
386 regs
.uesp
= (int)(is
+1);
394 regs
.ebx
= int_regs
->ebx
;
395 regs
.ebp
= int_regs
->ebp
;
396 regs
.esi
= int_regs
->esi
;
397 regs
.edi
= int_regs
->edi
;
400 regs
.fs
= int_regs
->fs
;
401 regs
.gs
= int_regs
->gs
;
403 disable_preemption();
405 current_cpu_datap()->cpu_kdb_saved_state
= ®s
;
407 if (!kdb_enter(regs
.eip
))
410 bcopy((char *)®s
, (char *)&ddb_regs
, sizeof (ddb_regs
));
411 trap_from_user
= IS_USER_TRAP(&ddb_regs
, &etext
);
414 db_task_trap(-1, 0, trap_from_user
);
417 if (trap_from_user
) {
418 ((int *)(is
+1))[0] = ddb_regs
.uesp
;
419 ((int *)(is
+1))[1] = ddb_regs
.ss
& 0xffff;
421 is
->efl
= ddb_regs
.efl
;
422 is
->cs
= ddb_regs
.cs
& 0xffff;
423 is
->eip
= ddb_regs
.eip
;
424 is
->eax
= ddb_regs
.eax
;
425 is
->ecx
= ddb_regs
.ecx
;
426 is
->edx
= ddb_regs
.edx
;
427 int_regs
->ebx
= ddb_regs
.ebx
;
428 int_regs
->ebp
= ddb_regs
.ebp
;
429 int_regs
->esi
= ddb_regs
.esi
;
430 int_regs
->edi
= ddb_regs
.edi
;
431 is
->ds
= ddb_regs
.ds
& 0xffff;
432 is
->es
= ddb_regs
.es
& 0xffff;
433 int_regs
->fs
= ddb_regs
.fs
& 0xffff;
434 int_regs
->gs
= ddb_regs
.gs
& 0xffff;
438 current_cpu_datap()->cpu_kdb_saved_state
= 0;
457 if (type
< 0 || type
> TRAP_TYPES
)
458 db_printf("type %d", type
);
460 db_printf("%s", trap_type
[type
]);
461 db_printf(" trap, code=%x eip@%x = %x esp=%x\n",
462 code
, pc
, *(int *)pc
, sp
);
463 db_run_mode
= STEP_CONTINUE
;
467 db_user_to_kernel_address(
473 register pt_entry_t
*ptp
;
475 ptp
= pmap_pte(task
->map
->pmap
, addr
);
476 if (ptp
== PT_ENTRY_NULL
|| (*ptp
& INTEL_PTE_VALID
) == 0) {
478 db_printf("\nno memory is assigned to address %08x\n", addr
);
485 src
= (vm_offset_t
)pte_to_pa(*ptp
);
486 *(int *) DMAP1
= INTEL_PTE_VALID
| INTEL_PTE_RW
| (src
& PG_FRAME
) |
487 INTEL_PTE_REF
| INTEL_PTE_MOD
;
488 #if defined(I386_CPU)
489 if (cpu_class
== CPUCLASS_386
) {
494 invlpg((u_int
)DADDR1
);
497 *kaddr
= (unsigned)DADDR1
+ (addr
& PAGE_MASK
);
503 * Read bytes from kernel address space for debugger.
518 if (task
== kernel_task
|| task
== TASK_NULL
) {
519 while (--size
>= 0) {
520 if (addr
++ > VM_MAX_KERNEL_ADDRESS
) {
521 db_printf("\nbad address %x\n", addr
);
530 if (db_user_to_kernel_address(task
, addr
, &kern_addr
, 1) < 0)
532 src
= (char *)kern_addr
;
533 n
= intel_trunc_page(addr
+INTEL_PGBYTES
) - addr
;
544 * Write bytes to kernel address space for debugger.
556 register pt_entry_t
*ptep0
= 0;
557 pt_entry_t oldmap0
= 0;
559 register pt_entry_t
*ptep1
= 0;
560 pt_entry_t oldmap1
= 0;
563 if (task
&& task
!= kernel_task
) {
564 db_write_bytes_user_space(addr
, size
, data
, task
);
569 if (addr
>= VM_MIN_KERNEL_LOADED_ADDRESS
) {
570 db_write_bytes_user_space(addr
, size
, data
, kernel_task
);
574 if (addr
>= VM_MIN_KERNEL_ADDRESS
&&
575 addr
<= (vm_offset_t
)&etext
)
577 ptep0
= pmap_pte(kernel_pmap
, addr
);
579 *ptep0
|= INTEL_PTE_WRITE
;
581 addr1
= i386_trunc_page(addr
+ size
- 1);
582 if (i386_trunc_page(addr
) != addr1
) {
583 /* data crosses a page boundary */
585 ptep1
= pmap_pte(kernel_pmap
, addr1
);
587 *ptep1
|= INTEL_PTE_WRITE
;
594 while (--size
>= 0) {
595 if (addr
++ > VM_MAX_KERNEL_ADDRESS
) {
596 db_printf("\nbad address %x\n", addr
);
613 db_write_bytes_user_space(
624 if (db_user_to_kernel_address(task
, addr
, &kern_addr
, 1) < 0)
626 dst
= (char *)kern_addr
;
627 n
= intel_trunc_page(addr
+INTEL_PGBYTES
) - addr
;
646 if (task
== kernel_task
|| task
== TASK_NULL
) {
647 if (kernel_task
== TASK_NULL
)
650 } else if (task
== TASK_NULL
) {
651 if (current_thread() == THREAD_NULL
)
653 task
= current_thread()->task
;
656 if (db_user_to_kernel_address(task
, addr
, &kern_addr
, 0) < 0)
658 n
= intel_trunc_page(addr
+INTEL_PGBYTES
) - addr
;
674 unsigned kern_addr1
, kern_addr2
;
676 if ((addr1
& (INTEL_PGBYTES
-1)) != (addr2
& (INTEL_PGBYTES
-1)))
678 if (task1
== TASK_NULL
) {
679 if (current_thread() == THREAD_NULL
)
681 task1
= current_thread()->task
;
683 if (db_user_to_kernel_address(task1
, addr1
, &kern_addr1
, 0) < 0 ||
684 db_user_to_kernel_address(task2
, addr2
, &kern_addr2
, 0) < 0)
686 return(kern_addr1
== kern_addr2
);
689 #define DB_USER_STACK_ADDR (VM_MIN_KERNEL_ADDRESS)
690 #define DB_NAME_SEARCH_LIMIT (DB_USER_STACK_ADDR-(INTEL_PGBYTES*3))
700 register unsigned vaddr
;
701 register unsigned *kaddr
;
703 kaddr
= (unsigned *)*skaddr
;
704 for (vaddr
= *svaddr
; vaddr
> evaddr
; vaddr
-= sizeof(unsigned)) {
705 if (vaddr
% INTEL_PGBYTES
== 0) {
706 vaddr
-= sizeof(unsigned);
707 if (db_user_to_kernel_address(task
, vaddr
, skaddr
, 0) < 0)
709 kaddr
= (unsigned *)*skaddr
;
711 vaddr
-= sizeof(unsigned);
714 if ((*kaddr
== 0) ^ (flag
== 0)) {
716 *skaddr
= (unsigned)kaddr
;
729 unsigned vaddr
, kaddr
;
731 vaddr
= DB_USER_STACK_ADDR
;
735 * skip nulls at the end
737 if (db_search_null(task
, &vaddr
, DB_NAME_SEARCH_LIMIT
, &kaddr
, 0) < 0) {
738 db_printf(DB_NULL_TASK_NAME
);
742 * search start of args
744 if (db_search_null(task
, &vaddr
, DB_NAME_SEARCH_LIMIT
, &kaddr
, 1) < 0) {
745 db_printf(DB_NULL_TASK_NAME
);
749 n
= DB_TASK_NAME_LEN
-1;
750 p
= (char *)kaddr
+ sizeof(unsigned);
751 for (vaddr
+= sizeof(int); vaddr
< DB_USER_STACK_ADDR
&& n
> 0;
753 if (vaddr
% INTEL_PGBYTES
== 0) {
754 (void)db_user_to_kernel_address(task
, vaddr
, &kaddr
, 0);
757 db_printf("%c", (*p
< ' ' || *p
> '~')? ' ': *p
);
759 while (n
-- >= 0) /* compare with >= 0 for one more space */
764 * Code used to synchronize kdb among all cpus, one active at a time, switch
765 * from on to another using kdb_on! #cpu or cpu #cpu
768 decl_simple_lock_data(, kdb_lock
) /* kdb lock */
770 #define db_simple_lock_init(l, e) hw_lock_init(&((l)->interlock))
771 #define db_simple_lock_try(l) hw_lock_try(&((l)->interlock))
772 #define db_simple_unlock(l) hw_lock_unlock(&((l)->interlock))
774 int kdb_cpu
= -1; /* current cpu running kdb */
776 volatile unsigned int cpus_holding_bkpts
; /* counter for number of cpus holding
777 breakpoints (ie: cpus that did not
778 insert back breakpoints) */
779 extern boolean_t db_breakpoints_inserted
;
782 db_machdep_init(void)
786 db_simple_lock_init(&kdb_lock
, 0);
787 for (c
= 0; c
< real_ncpus
; ++c
) {
788 db_stacks
[c
] = (vm_offset_t
) (db_stack_store
+
789 (INTSTACK_SIZE
* (c
+ 1)) - sizeof (natural_t
));
790 if (c
== master_cpu
) {
791 dbtss
.esp0
= (int)(db_task_stack_store
+
792 (INTSTACK_SIZE
* (c
+ 1)) - sizeof (natural_t
));
793 dbtss
.esp
= dbtss
.esp0
;
794 dbtss
.eip
= (int)&db_task_start
;
796 * The TSS for the debugging task on each slave CPU
797 * is set up in mp_desc_init().
804 * Called when entering kdb:
805 * Takes kdb lock. If if we were called remotely (slave state) we just
806 * wait for kdb_cpu to be equal to cpu_number(). Otherwise enter kdb if
807 * not active on another cpu.
808 * If db_pass_thru[cpu_number()] > 0, then kdb can't stop now.
817 disable_preemption();
819 mycpu
= cpu_number();
821 if (current_cpu_datap()->cpu_db_pass_thru
) {
826 current_cpu_datap()->cpu_kdb_active
++;
830 db_printf("kdb_enter: cpu %d, is_slave %d, kdb_cpu %d, run mode %d pc %x (%x) holds %d\n",
831 my_cpu
, current_cpu_datap()->cpu_kdb_is_slave
, kdb_cpu
,
832 db_run_mode
, pc
, *(int *)pc
, cpus_holding_bkpts
);
833 if (db_breakpoints_inserted
)
834 cpus_holding_bkpts
++;
835 if (kdb_cpu
== -1 && !current_cpu_datap()->cpu_kdb_is_slave
) {
837 remote_kdb(); /* stop other cpus */
839 } else if (kdb_cpu
== my_cpu
)
854 boolean_t wait
= FALSE
;
856 disable_preemption();
858 my_cpu
= cpu_number();
860 if (db_run_mode
== STEP_CONTINUE
) {
864 if (db_breakpoints_inserted
)
865 cpus_holding_bkpts
--;
866 if (current_cpu_datap()->cpu_kdb_is_slave
)
867 current_cpu_datap()->cpu_kdb_is_slave
--;
869 db_printf("kdb_leave: cpu %d, kdb_cpu %d, run_mode %d pc %x (%x) holds %d\n",
870 my_cpu
, kdb_cpu
, db_run_mode
,
871 ddb_regs
.eip
, *(int *)ddb_regs
.eip
,
875 current_cpu_datap()->cpu_kdb_active
--;
880 while(cpus_holding_bkpts
);
889 extern void kdb_console(void);
891 disable_preemption();
893 my_cpu
= cpu_number();
897 if (kdb_cpu
!= -1 && kdb_cpu
!= my_cpu
) {
900 if (db_simple_lock_try(&kdb_lock
)) {
901 if (kdb_cpu
== -1 || kdb_cpu
== my_cpu
)
903 db_simple_unlock(&kdb_lock
);
911 extern unsigned old_time_stamp
;
912 #endif /* TIME_STAMP */
917 db_simple_unlock(&kdb_lock
);
920 #endif /* TIME_STAMP */
925 #define KDB_SAVE(type, name) extern type name; type name##_save = name
926 #define KDB_RESTORE(name) name = name##_save
928 #define KDB_SAVE(type, name) extern type name; type name/**/_save = name
929 #define KDB_RESTORE(name) name = name/**/_save
930 #endif /* __STDC__ */
932 #define KDB_SAVE_CTXT() \
933 KDB_SAVE(int, db_run_mode); \
934 KDB_SAVE(boolean_t, db_sstep_print); \
935 KDB_SAVE(int, db_loop_count); \
936 KDB_SAVE(int, db_call_depth); \
937 KDB_SAVE(int, db_inst_count); \
938 KDB_SAVE(int, db_last_inst_count); \
939 KDB_SAVE(int, db_load_count); \
940 KDB_SAVE(int, db_store_count); \
941 KDB_SAVE(boolean_t, db_cmd_loop_done); \
942 KDB_SAVE(jmp_buf_t *, db_recover); \
943 KDB_SAVE(db_addr_t, db_dot); \
944 KDB_SAVE(db_addr_t, db_last_addr); \
945 KDB_SAVE(db_addr_t, db_prev); \
946 KDB_SAVE(db_addr_t, db_next); \
947 KDB_SAVE(db_regs_t, ddb_regs);
949 #define KDB_RESTORE_CTXT() \
950 KDB_RESTORE(db_run_mode); \
951 KDB_RESTORE(db_sstep_print); \
952 KDB_RESTORE(db_loop_count); \
953 KDB_RESTORE(db_call_depth); \
954 KDB_RESTORE(db_inst_count); \
955 KDB_RESTORE(db_last_inst_count); \
956 KDB_RESTORE(db_load_count); \
957 KDB_RESTORE(db_store_count); \
958 KDB_RESTORE(db_cmd_loop_done); \
959 KDB_RESTORE(db_recover); \
960 KDB_RESTORE(db_dot); \
961 KDB_RESTORE(db_last_addr); \
962 KDB_RESTORE(db_prev); \
963 KDB_RESTORE(db_next); \
964 KDB_RESTORE(ddb_regs);
967 * switch to another cpu
975 if (cpu
< 0 || cpu
>= real_ncpus
|| !cpu_datap(cpu
)->cpu_kdb_active
)
977 db_set_breakpoints();
978 db_set_watchpoints();
982 db_clear_breakpoints();
983 db_clear_watchpoints();
985 if (kdb_cpu
== -1) {/* someone continued */
986 kdb_cpu
= cpu_number();
987 db_continue_cmd(0, 0, 0, "");
997 boolean_t reboot
= TRUE
;
1001 while ((c
= *cp
++) != 0) {
1002 if (c
== 'r') /* reboot */
1004 if (c
== 'h') /* halt */
1007 halt_all_cpus(reboot
);