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