Navigation Menu

Skip to content

Commit

Permalink
Supported the API change on PIN_CallApplicationFunction.
Browse files Browse the repository at this point in the history
  • Loading branch information
jieyu committed Mar 9, 2015
1 parent be11a0d commit 14b2769
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pin.mk
Expand Up @@ -10,6 +10,10 @@ CONFIG_ROOT := $(PIN_ROOT)/source/tools/Config
include $(CONFIG_ROOT)/makefile.config
#include $(TOOLS_ROOT)/Config/makefile.default.rules

PIN_REVISION := $(shell $(PIN_ROOT)/pin -version | grep Rev | cut -d ' ' -f 3)
CFLAGS += -DCONFIG_PIN_REVISION=$(PIN_REVISION)
CXXFLAGS += -DCONFIG_PIN_REVISION=$(PIN_REVISION)

# Check if this is a PinPlay kit.
ifneq ($(wildcard $(PIN_HOME)/extras/pinplay),)
$(info *** Building with PinPlay kit ***)
Expand Down
9 changes: 9 additions & 0 deletions src/core/wrapper.hpp
Expand Up @@ -146,6 +146,13 @@ class WrapperBase {
#define ACCESSORS_NORET(NUM_ARGS) \
ARG_ACCESSORS(NUM_ARGS)

// NOTE: The API PIN_CallApplicationFunction changed from Rev 71293.
#if CONFIG_PIN_REVISION >= 71293
#define CALL_ORIGINAL_PARAM NULL,
#else
#define CALL_ORIGINAL_PARAM
#endif

#define CALL_ORIGINAL(R, NUM_ARGS) \
void CallOriginal() { \
assert(ori_funptr_); \
Expand All @@ -154,6 +161,7 @@ class WrapperBase {
tid_, \
CALLINGSTD_DEFAULT, \
ori_funptr_, \
CALL_ORIGINAL_PARAM \
PIN_PARG(R), &ret_val_, \
PARGS(NUM_ARGS) \
PIN_PARG_END()); \
Expand All @@ -167,6 +175,7 @@ class WrapperBase {
tid_, \
CALLINGSTD_DEFAULT, \
ori_funptr_, \
CALL_ORIGINAL_PARAM \
PIN_PARG(void), \
PARGS(NUM_ARGS) \
PIN_PARG_END()); \
Expand Down

0 comments on commit 14b2769

Please sign in to comment.