From a6d32cd556708ec634812abeec48cba861cb0e9a Mon Sep 17 00:00:00 2001 From: Alexander Wagner Date: Thu, 2 Mar 2023 13:43:02 +0100 Subject: [PATCH] pt: Update PIN to v3.11-97998 --- data-gui | 2 +- pin/Makefile | 1 - pintool/addrtrace.cpp | 20 +------------------- pintool/call-stack.cpp | 7 ++++--- pintool/pin-macros.H | 14 ++++++++++++++ 5 files changed, 20 insertions(+), 24 deletions(-) create mode 100644 pintool/pin-macros.H diff --git a/data-gui b/data-gui index 06c903b4..566865c1 160000 --- a/data-gui +++ b/data-gui @@ -1 +1 @@ -Subproject commit 06c903b42b977df5e9e45288ffaa165095105816 +Subproject commit 566865c14f16e1b0724801c3fb09851ba6655d3f diff --git a/pin/Makefile b/pin/Makefile index 9a0c6ee7..88219704 100644 --- a/pin/Makefile +++ b/pin/Makefile @@ -28,7 +28,6 @@ PROJ := DATA - Pin # Pin Version and Source -#VER_STRING=pin-3.7-97619-g0d0c92f4f-gcc-linux VER_STRING=pin-3.11-97998-g7ecce2dac-gcc-linux TAR=$(VER_STRING).tar.gz diff --git a/pintool/addrtrace.cpp b/pintool/addrtrace.cpp index 8ce6922f..44394931 100644 --- a/pintool/addrtrace.cpp +++ b/pintool/addrtrace.cpp @@ -25,6 +25,7 @@ /***********************************************************************/ +#include "pin-macros.H" #include "pin.H" #include #include @@ -42,25 +43,6 @@ #include #include -/** - * Pin 3.11 Documentation: - * https://software.intel.com/sites/landingpage/pintool/docs/97998/Pin/html - */ - -// Pin above 3.7.97720 deprecates some functions -#if (PIN_PRODUCT_VERSION_MAJOR > 3) || \ - (PIN_PRODUCT_VERSION_MAJOR == 3 && PIN_PRODUCT_VERSION_MINOR > 7) || \ - (PIN_PRODUCT_VERSION_MAJOR == 3 && PIN_PRODUCT_VERSION_MINOR == 7 && \ - PIN_BUILD_NUMBER > 97720) -#define INS_IS_INDIRECT INS_IsIndirectControlFlow -#define INS_HAS_TAKEN_BRANCH INS_IsValidForIpointTakenBranch -#define INS_HAS_IPOINT_AFTER INS_IsValidForIpointAfter -#else -#define INS_IS_INDIRECT INS_IsIndirectBranchOrCall -#define INS_HAS_TAKEN_BRANCH INS_IsBranchOrCall -#define INS_HAS_IPOINT_AFTER INS_HasFallThrough -#endif - using namespace std; /***********************************************************************/ diff --git a/pintool/call-stack.cpp b/pintool/call-stack.cpp index 06810c1b..e1772d69 100644 --- a/pintool/call-stack.cpp +++ b/pintool/call-stack.cpp @@ -30,6 +30,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. END_LEGAL */ #include "call-stack.H" +#include "pin-macros.H" #include #include #include @@ -113,9 +114,9 @@ static void i_trace(TRACE trace, void *v) { continue; } #endif - if (INS_IsDirectBranchOrCall(tail)) { + if (INS_IS_DIRECT(tail)) { // check if direct or indirect call and take the target accordingly - ADDRINT target = INS_DirectBranchOrCallTargetAddress(tail); + ADDRINT target = INS_DIRECT(tail); INS_InsertCall(tail, IPOINT_BEFORE, (AFUNPTR)a_process_call, IARG_ADDRINT, target, IARG_REG_VALUE, REG_STACK_PTR, IARG_REG_VALUE, vreg, IARG_END); @@ -127,7 +128,7 @@ static void i_trace(TRACE trace, void *v) { IARG_END); } } - if (INS_IsIndirectBranchOrCall(tail) && !INS_IsRet(tail)) { + if (INS_IS_INDIRECT(tail) && !INS_IsRet(tail)) { INS_InsertCall(tail, IPOINT_TAKEN_BRANCH, (AFUNPTR)a_process_call, IARG_BRANCH_TARGET_ADDR, IARG_REG_VALUE, REG_STACK_PTR, IARG_REG_VALUE, vreg, IARG_END); diff --git a/pintool/pin-macros.H b/pintool/pin-macros.H new file mode 100644 index 00000000..5adeb936 --- /dev/null +++ b/pintool/pin-macros.H @@ -0,0 +1,14 @@ +#if !defined(PIN_MACROS_H_) +#define PIN_MACROS_H_ + +/** + * We support Pin 3.11-97998 Documentation: + * https://software.intel.com/sites/landingpage/pintool/docs/97998/Pin/html + */ +#define INS_DIRECT INS_DirectControlFlowTargetAddress +#define INS_IS_DIRECT INS_IsDirectControlFlow +#define INS_IS_INDIRECT INS_IsIndirectControlFlow +#define INS_HAS_TAKEN_BRANCH INS_IsValidForIpointTakenBranch +#define INS_HAS_IPOINT_AFTER INS_IsValidForIpointAfter + +#endif