Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Oct 2016 12:29:57 +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: r307960 - head/sys/arm64/arm64
Message-ID:  <201610261229.u9QCTvBd017161@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Wed Oct 26 12:29:56 2016
New Revision: 307960
URL: https://svnweb.freebsd.org/changeset/base/307960

Log:
  Use nitems to get the correct number of registers to read when dumping
  them. Previously this would walk past the end of the array and print
  whatever happened to be after the trapframe struct.
  
  MFC after:	1 week
  Sponsored by:	DARPA, AFRL

Modified:
  head/sys/arm64/arm64/trap.c

Modified: head/sys/arm64/arm64/trap.c
==============================================================================
--- head/sys/arm64/arm64/trap.c	Wed Oct 26 08:47:35 2016	(r307959)
+++ head/sys/arm64/arm64/trap.c	Wed Oct 26 12:29:56 2016	(r307960)
@@ -250,7 +250,7 @@ print_registers(struct trapframe *frame)
 {
 	u_int reg;
 
-	for (reg = 0; reg < 31; reg++) {
+	for (reg = 0; reg < nitems(frame->tf_x); reg++) {
 		printf(" %sx%d: %16lx\n", (reg < 10) ? " " : "", reg,
 		    frame->tf_x[reg]);
 	}



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