Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/arm At each function level print a useful offse...
details: https://anonhg.NetBSD.org/src/rev/1f48a715c08c
branches: trunk
changeset: 783597:1f48a715c08c
user: skrll <skrll%NetBSD.org@localhost>
date: Mon Dec 31 08:57:27 2012 +0000
description:
At each function level print a useful offset (as also shown in rlv)
OK from gimpy
diffstat:
sys/arch/arm/arm/db_trace.c | 45 ++++++++++++++++++++++++++++-----------------
1 files changed, 28 insertions(+), 17 deletions(-)
diffs (98 lines):
diff -r a243311703e7 -r 1f48a715c08c sys/arch/arm/arm/db_trace.c
--- a/sys/arch/arm/arm/db_trace.c Mon Dec 31 07:58:44 2012 +0000
+++ b/sys/arch/arm/arm/db_trace.c Mon Dec 31 08:57:27 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_trace.c,v 1.26 2012/11/12 18:00:34 skrll Exp $ */
+/* $NetBSD: db_trace.c,v 1.27 2012/12/31 08:57:27 skrll Exp $ */
/*
* Copyright (c) 2000, 2001 Ben Harris
@@ -31,7 +31,7 @@
#include <sys/param.h>
-__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.26 2012/11/12 18:00:34 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.27 2012/12/31 08:57:27 skrll Exp $");
#include <sys/proc.h>
#include <arm/armreg.h>
@@ -92,6 +92,7 @@
bool kernel_only = true;
bool trace_thread = false;
bool lwpaddr = false;
+ db_addr_t scp, pc;
int scp_offset;
while ((c = *cp++) != 0) {
@@ -151,13 +152,28 @@
lastframe = NULL;
scp_offset = -(get_pc_str_offset() >> 2);
+ /*
+ * In theory, the SCP isn't guaranteed to be in the function
+ * that generated the stack frame. We hope for the best.
+ */
+#ifdef __PROG26
+ scp = frame[FR_SCP] & R15_PC;
+#else
+ scp = frame[FR_SCP];
+#endif
+ pc = scp;
+
while (count-- && frame != NULL) {
- db_addr_t scp;
uint32_t savecode;
int r;
uint32_t *rp;
const char *sep;
+#ifdef __PROG26
+ scp = frame[FR_SCP] & R15_PC;
+#else
+ scp = frame[FR_SCP];
+#endif
lastframe = frame;
#ifndef _KERNEL
uint32_t frameb[4];
@@ -166,24 +182,14 @@
frame = frameb + 3;
#endif
- /*
- * In theory, the SCP isn't guaranteed to be in the function
- * that generated the stack frame. We hope for the best.
- */
-#ifdef __PROG26
- scp = frame[FR_SCP] & R15_PC;
-#else
- scp = frame[FR_SCP];
-#endif
-
- db_printsym(scp, DB_STGY_PROC, pr);
+ db_printsym(pc, DB_STGY_PROC, pr);
(*pr)("\n\t");
#ifdef __PROG26
- (*pr)("scp=0x%08x rlv=0x%08x (", scp, frame[FR_RLV] & R15_PC);
+ (*pr)("pc =0x%08x rlv=0x%08x (", pc, frame[FR_RLV] & R15_PC);
db_printsym(frame[FR_RLV] & R15_PC, DB_STGY_PROC, pr);
(*pr)(")\n");
#else
- (*pr)("scp=0x%08x rlv=0x%08x (", scp, frame[FR_RLV]);
+ (*pr)("pc =0x%08x rlv=0x%08x (", pc, frame[FR_RLV]);
db_printsym(frame[FR_RLV], DB_STGY_PROC, pr);
(*pr)(")\n");
#endif
@@ -220,7 +226,12 @@
*/
if (frame[FR_RFP] == 0)
break; /* Top of stack */
-
+#ifdef __PROG26
+ pc = frame[FR_RLV] & R15_PC;
+#else
+ pc = frame[FR_RLV];
+#endif
+
frame = (uint32_t *)(frame[FR_RFP]);
if (INKERNEL((int)frame)) {
Home |
Main Index |
Thread Index |
Old Index