Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Sep 2016 18:30:53 +0000 (UTC)
From:      Bruce Evans <bde@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r305849 - head/sys/amd64/include
Message-ID:  <201609151830.u8FIUrCW005297@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bde
Date: Thu Sep 15 18:30:53 2016
New Revision: 305849
URL: https://svnweb.freebsd.org/changeset/base/305849

Log:
  Decode some REX prefixes in inst_call().  This makes the 'next' and
  'until' commands work in more cases.

Modified:
  head/sys/amd64/include/db_machdep.h

Modified: head/sys/amd64/include/db_machdep.h
==============================================================================
--- head/sys/amd64/include/db_machdep.h	Thu Sep 15 17:37:30 2016	(r305848)
+++ head/sys/amd64/include/db_machdep.h	Thu Sep 15 18:30:53 2016	(r305849)
@@ -69,14 +69,15 @@ do {						\
 
 #define	I_CALL		0xe8
 #define	I_CALLI		0xff
+#define	i_calli(ins)	(((ins)&0xff) == I_CALLI && ((ins)&0x3800) == 0x1000)
 #define	I_RET		0xc3
 #define	I_IRET		0xcf
+#define	i_rex(ins)	(((ins) & 0xff) == 0x41 || ((ins) & 0xff) == 0x43)
 
 #define	inst_trap_return(ins)	(((ins)&0xff) == I_IRET)
 #define	inst_return(ins)	(((ins)&0xff) == I_RET)
-#define	inst_call(ins)		(((ins)&0xff) == I_CALL || \
-				 (((ins)&0xff) == I_CALLI && \
-				  ((ins)&0x3800) == 0x1000))
+#define	inst_call(ins)		(((ins)&0xff) == I_CALL || i_calli(ins) || \
+				 (i_calli((ins) >> 8) && i_rex(ins)))
 #define inst_load(ins)		0
 #define inst_store(ins)		0
 



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