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 Specifying the frame address "trace...



details:   https://anonhg.NetBSD.org/src/rev/1799cc339ca0
branches:  trunk
changeset: 370654:1799cc339ca0
user:      ryo <ryo%NetBSD.org@localhost>
date:      Thu Sep 22 21:00:46 2022 +0000

description:
Specifying the frame address "trace <frame-address>" was not working.

diffstat:

 sys/arch/aarch64/aarch64/db_trace.c |  22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diffs (50 lines):

diff -r 845de4955b01 -r 1799cc339ca0 sys/arch/aarch64/aarch64/db_trace.c
--- a/sys/arch/aarch64/aarch64/db_trace.c       Thu Sep 22 19:33:00 2022 +0000
+++ b/sys/arch/aarch64/aarch64/db_trace.c       Thu Sep 22 21:00:46 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_trace.c,v 1.21 2022/09/22 19:33:00 ryo Exp $ */
+/* $NetBSD: db_trace.c,v 1.22 2022/09/22 21:00:46 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.21 2022/09/22 19:33:00 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.22 2022/09/22 21:00:46 ryo Exp $");
 
 #include <sys/param.h>
 #include <sys/bitops.h>
@@ -497,15 +497,6 @@
        db_addr_t pc, sp, lr0;
        bool allow_leaf_function = false;
 
-       if (tf == NULL) {
-               /*
-                * In the case of "trace/s <frame-address>",
-                * the specified frame pointer address is considered
-                * a trapframe (or a switchframe) address.
-                */
-               tf = (struct trapframe *)fp;
-       }
-
        pr_frame(tf, pr);
 
        db_read_bytes((db_addr_t)tf, sizeof(tf_buf), (char *)&tf_buf);
@@ -810,6 +801,15 @@
        if (count > MAXBACKTRACE)
                count = MAXBACKTRACE;
 
+       if (tf == NULL) {
+               /*
+                * In the case of "trace <frame-address>",
+                * the specified frame pointer address is considered
+                * a trapframe (or a switchframe) address.
+                */
+               tf = (struct trapframe *)fp;
+       }
+
        if (trace_sp) {
                /* trace $lr pushed to sp */
                db_sp_trace(tf, fp, count, flags, pr);



Home | Main Index | Thread Index | Old Index