Skip to content

Commit 880e5a1

Browse files
committed
check for local_var.h
1 parent 3334de9 commit 880e5a1

File tree

4 files changed

+11
-33
lines changed

4 files changed

+11
-33
lines changed

ChangeLog

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
2022-09-16 Gregory L. Lee <[email protected]>
2-
* : Add support for dyninst 12+ (remove local variable gathering). This
3-
means python frames cannot be gathered.
2+
* : Add check for local_var.h (removed in dyninst 12)
3+
can copy local_var.h from older dyninst if needed (python debugging)
44

55
2022-08-22 Gregory L. Lee <[email protected]>
66
* : updated version string to 4.2.0

config/x_ac_debuglibs.m4

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ AC_DEFUN([X_AC_DEBUGLIBS], [
88
RPATH_FLAGS="$RPATH_FLAGS -Wl,-rpath=/usr/lib64/dyninst"],
99
[CXXFLAGS="$CXXFLAGS"
1010
STACKWALKERPREFIX="${withval}"]
11-
)
11+
)
1212
1313
AC_ARG_WITH(elfutils,
1414
[AS_HELP_STRING([--with-elfutils=prefix],
@@ -114,34 +114,12 @@ AC_DEFUN([X_AC_DEBUGLIBS], [
114114
fi
115115
AC_MSG_RESULT([$dyninst_vers_10])
116116
117-
AC_MSG_CHECKING([Checking Dyninst Version 12.0 or greater])
118-
dyninst_vers_12=no
119-
AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include "dyninstversion.h"
120-
int main()
121-
{
122-
return 0;
123-
}])],
124-
[dyninst_vers_12=yes],
125-
[]
117+
AC_CHECK_HEADER(local_var.h,
118+
[AC_DEFINE([LOCAL_VAR_H], [], [local_var.h])],
119+
[],
120+
AC_INCLUDES_DEFAULT
126121
)
127122
128-
if test "$dyninst_vers_12" = yes; then
129-
AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include "dyninstversion.h"
130-
#if DYNINST_MAJOR_VERSION < 12
131-
#error
132-
#endif
133-
int main()
134-
{
135-
return 0;
136-
}])],
137-
[CXXFLAGS="$CXXFLAGS -std=c++11"],
138-
[dyninst_vers_12=no]
139-
)
140-
fi
141-
AC_MSG_RESULT([$dyninst_vers_12])
142-
143-
144-
145123
AC_CHECK_HEADER(Symtab.h,
146124
[],
147125
[AC_MSG_ERROR([Symtab.h is required. Specify prefix with --with-stackwalker])],

src/STAT_BackEnd.C

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1889,7 +1889,7 @@ StatError_t STAT_BackEnd::getVariable(const Frame &frame, char *variableName, ch
18891889
vector<localVar *> vars;
18901890
vector<localVar *>::iterator varsIter;
18911891

1892-
#if DYNINST_MAJOR_VERSION<12
1892+
#ifdef LOCAL_VAR_H
18931893
frame.getName(frameName);
18941894
printMsg(STAT_LOG_MESSAGE, __FILE__, __LINE__, "Searching for variable %s in frame %s\n", variableName, frameName.c_str());
18951895

@@ -1939,8 +1939,8 @@ StatError_t STAT_BackEnd::getVariable(const Frame &frame, char *variableName, ch
19391939
}
19401940
}
19411941
printMsg(STAT_LOG_MESSAGE, __FILE__, __LINE__, "Found variable %s in frame %s\n", variableName, frameName.c_str());
1942-
#else //#if DYNINST_MAJOR_VERSION<12
1943-
printMsg(STAT_LOG_MESSAGE, __FILE__, __LINE__, "local variable support not availabile with dyninst 12 and greater\n");
1942+
#else //#ifdef LOCAL_VAR_H
1943+
printMsg(STAT_LOG_MESSAGE, __FILE__, __LINE__, "local variable header not found\n");
19441944
#endif
19451945
return STAT_OK;
19461946
}

src/STAT_BackEnd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
5757
#include "swk_errors.h"
5858
#include "Type.h"
5959

60-
#if DYNINST_MAJOR_VERSION<12
60+
#ifdef LOCAL_VAR_H
6161
#include "local_var.h"
6262
#endif
6363
#include "Variable.h"

0 commit comments

Comments
 (0)