Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/aarch64/aarch64 Display the trap type of trapframe ...



details:   https://anonhg.NetBSD.org/src/rev/e18e3309f29e
branches:  trunk
changeset: 366537:e18e3309f29e
user:      ryo <ryo%NetBSD.org@localhost>
date:      Sun May 29 23:43:49 2022 +0000

description:
Display the trap type of trapframe when backtracing.

diffstat:

 sys/arch/aarch64/aarch64/db_trace.c |  23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)

diffs (53 lines):

diff -r faafcc981dde -r e18e3309f29e sys/arch/aarch64/aarch64/db_trace.c
--- a/sys/arch/aarch64/aarch64/db_trace.c       Sun May 29 23:39:59 2022 +0000
+++ b/sys/arch/aarch64/aarch64/db_trace.c       Sun May 29 23:43:49 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_trace.c,v 1.15 2022/05/29 16:13:41 ryo Exp $ */
+/* $NetBSD: db_trace.c,v 1.16 2022/05/29 23:43:49 ryo Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.15 2022/05/29 16:13:41 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.16 2022/05/29 23:43:49 ryo Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -254,14 +254,17 @@
 
        if (tf != NULL) {
 #if defined(_KERNEL)
-               bool is_switchframe = (tf->tf_sp == 0);
-               (*pr)("---- %s %p (%zu bytes) ----\n",
-                   is_switchframe ? "switchframe" : "trapframe",
-                   tf, sizeof(*tf));
-               if (is_switchframe)
+               if (tf->tf_sp == 0) {
+                       (*pr)("---- switchframe %p (%zu bytes) ----\n",
+                           tf, sizeof(*tf));
                        dump_switchframe(tf, pr);
-               else
+               } else {
+                       (*pr)("---- %s: trapframe %p (%zu bytes) ----\n",
+                           (tf->tf_esr == -1) ? "Interrupt" :
+                           eclass_trapname(__SHIFTOUT(tf->tf_esr, ESR_EC)),
+                           tf, sizeof(*tf));
                        dump_trapframe(tf, pr);
+               }
                (*pr)("------------------------"
                      "------------------------\n");
 
@@ -324,7 +327,9 @@
                        if (lr == 0)
                                break;
 
-                       (*pr)("---- trapframe %p (%zu bytes) ----\n",
+                       (*pr)("---- %s: trapframe %p (%zu bytes) ----\n",
+                           (tf->tf_esr == -1) ? "Interrupt" :
+                           eclass_trapname(__SHIFTOUT(tf->tf_esr, ESR_EC)),
                            tf, sizeof(*tf));
                        dump_trapframe(tf, pr);
                        (*pr)("------------------------"



Home | Main Index | Thread Index | Old Index