Home | History | Annotate | Line # | Download | only in arm32
db_machdep.c revision 1.12
      1  1.12    dsl /*	$NetBSD: db_machdep.c,v 1.12 2009/03/14 15:36:01 dsl Exp $	*/
      2   1.1   matt 
      3   1.1   matt /*
      4   1.1   matt  * Copyright (c) 1996 Mark Brinicombe
      5   1.1   matt  *
      6   1.1   matt  * Mach Operating System
      7   1.1   matt  * Copyright (c) 1991,1990 Carnegie Mellon University
      8   1.1   matt  * All Rights Reserved.
      9   1.1   matt  *
     10   1.1   matt  * Permission to use, copy, modify and distribute this software and its
     11   1.1   matt  * documentation is hereby granted, provided that both the copyright
     12   1.1   matt  * notice and this permission notice appear in all copies of the
     13   1.1   matt  * software, derivative works or modified versions, and any portions
     14   1.1   matt  * thereof, and that both notices appear in supporting documentation.
     15   1.1   matt  *
     16   1.1   matt  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
     17   1.1   matt  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
     18   1.1   matt  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     19   1.1   matt  *
     20   1.1   matt  * Carnegie Mellon requests users of this software to return to
     21   1.1   matt  *
     22   1.1   matt  *  Software Distribution Coordinator  or  Software.Distribution (at) CS.CMU.EDU
     23   1.1   matt  *  School of Computer Science
     24   1.1   matt  *  Carnegie Mellon University
     25   1.1   matt  *  Pittsburgh PA 15213-3890
     26   1.1   matt  *
     27   1.1   matt  * any improvements or extensions that they make and grant Carnegie the
     28   1.1   matt  * rights to redistribute these changes.
     29   1.1   matt  */
     30   1.8  lukem 
     31   1.8  lukem #include <sys/cdefs.h>
     32  1.12    dsl __KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.12 2009/03/14 15:36:01 dsl Exp $");
     33   1.1   matt 
     34   1.1   matt #include <sys/param.h>
     35   1.1   matt #include <sys/proc.h>
     36   1.1   matt #include <sys/vnode.h>
     37   1.1   matt #include <sys/systm.h>
     38   1.1   matt 
     39   1.7  chris #include <arm/arm32/db_machdep.h>
     40   1.1   matt 
     41   1.1   matt #include <ddb/db_access.h>
     42   1.1   matt #include <ddb/db_sym.h>
     43   1.1   matt #include <ddb/db_output.h>
     44   1.1   matt 
     45   1.1   matt 
     46   1.1   matt void
     47  1.12    dsl db_show_panic_cmd(db_expr_t addr, bool have_addr, db_expr_t count, const char *modif)
     48   1.1   matt {
     49   1.1   matt 	int s;
     50   1.1   matt 
     51   1.1   matt 	s = splhigh();
     52   1.1   matt 
     53   1.1   matt 	db_printf("Panic string: %s\n", panicstr);
     54   1.1   matt 
     55   1.1   matt 	(void)splx(s);
     56   1.1   matt }
     57   1.1   matt 
     58   1.1   matt 
     59   1.1   matt void
     60  1.12    dsl db_show_frame_cmd(db_expr_t addr, bool have_addr, db_expr_t count, const char *modif)
     61   1.1   matt {
     62   1.1   matt 	struct trapframe *frame;
     63   1.1   matt 
     64   1.1   matt 	if (!have_addr) {
     65   1.1   matt 		db_printf("frame address must be specified\n");
     66   1.1   matt 		return;
     67   1.1   matt 	}
     68   1.1   matt 
     69   1.1   matt 	frame = (struct trapframe *)addr;
     70   1.1   matt 
     71   1.1   matt 	db_printf("frame address = %08x  ", (u_int)frame);
     72   1.1   matt 	db_printf("spsr=%08x\n", frame->tf_spsr);
     73   1.1   matt 	db_printf("r0 =%08x r1 =%08x r2 =%08x r3 =%08x\n",
     74   1.1   matt 	    frame->tf_r0, frame->tf_r1, frame->tf_r2, frame->tf_r3);
     75   1.1   matt 	db_printf("r4 =%08x r5 =%08x r6 =%08x r7 =%08x\n",
     76   1.1   matt 	    frame->tf_r4, frame->tf_r5, frame->tf_r6, frame->tf_r7);
     77   1.1   matt 	db_printf("r8 =%08x r9 =%08x r10=%08x r11=%08x\n",
     78   1.1   matt 	    frame->tf_r8, frame->tf_r9, frame->tf_r10, frame->tf_r11);
     79   1.1   matt 	db_printf("r12=%08x r13=%08x r14=%08x r15=%08x\n",
     80   1.1   matt 	    frame->tf_r12, frame->tf_usr_sp, frame->tf_usr_lr, frame->tf_pc);
     81   1.1   matt 	db_printf("slr=%08x\n", frame->tf_svc_lr);
     82   1.1   matt }
     83