Skip to content

Commit

Permalink
pt: Update PIN to v3.11-97998
Browse files Browse the repository at this point in the history
  • Loading branch information
aewag committed Mar 3, 2023
1 parent 3f078d2 commit 006f277
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 24 deletions.
2 changes: 1 addition & 1 deletion data-gui
1 change: 0 additions & 1 deletion pin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 1 addition & 19 deletions pintool/addrtrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

/***********************************************************************/

#include "pin-macros.H"
#include "pin.H"
#include <fcntl.h>
#include <fstream>
Expand All @@ -42,25 +43,6 @@
#include <unistd.h>
#include <vector>

/**
* 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;

/***********************************************************************/
Expand Down
7 changes: 4 additions & 3 deletions pintool/call-stack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <iomanip>
#include <iostream>
#include <sstream>
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down
14 changes: 14 additions & 0 deletions pintool/pin-macros.H
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 006f277

Please sign in to comment.