Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jun 2013 22:26:56 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r252320 - head/sys/arm/arm
Message-ID:  <201306272226.r5RMQu4d002527@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Thu Jun 27 22:26:56 2013
New Revision: 252320
URL: http://svnweb.freebsd.org/changeset/base/252320

Log:
  Support reading registers r0-r3 when unwinding. There is a seperate
  instruction to load these. We only hit it when unwinding past an trap frame
  as in C r0-r3 would never have been saved onto the stack.

Modified:
  head/sys/arm/arm/db_trace.c

Modified: head/sys/arm/arm/db_trace.c
==============================================================================
--- head/sys/arm/arm/db_trace.c	Thu Jun 27 21:34:29 2013	(r252319)
+++ head/sys/arm/arm/db_trace.c	Thu Jun 27 22:26:56 2013	(r252320)
@@ -108,6 +108,7 @@ extern int extab_start, extab_end, exidx
 #define	INSN_VSP_REG		0x90
 #define	INSN_POP_COUNT		0xa0
 #define	INSN_FINISH		0xb0
+#define	INSN_POP_REGS		0xb1
 #define	INSN_VSP_LARGE_INC	0xb2
 
 /* An item in the exception index table */
@@ -268,6 +269,24 @@ db_unwind_exec_insn(struct unwind_state 
 		/* Stop processing */
 		state->entries = 0;
 
+	} else if ((insn == INSN_POP_REGS)) {
+		unsigned int mask, reg;
+
+		mask = db_unwind_exec_read_byte(state);
+		if (mask == 0 || (mask & 0xf0) != 0)
+			return 1;
+
+		/* Update SP */
+		update_vsp = 1;
+
+		/* Load the registers */
+		for (reg = 0; mask && reg < 4; mask >>= 1, reg++) {
+			if (mask & 1) {
+				state->registers[reg] = *vsp++;
+				state->update_mask |= 1 << reg;
+			}
+		}
+
 	} else if ((insn & INSN_VSP_LARGE_INC_MASK) == INSN_VSP_LARGE_INC) {
 		unsigned int uleb128;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306272226.r5RMQu4d002527>