Skip to content

Commit

Permalink
Merge branch 'master' of http://github.com/dyninst/dyninst
Browse files Browse the repository at this point in the history
  • Loading branch information
John Detter committed Nov 22, 2016
2 parents ff68cf0 + 8849ea3 commit cd3ab6a
Show file tree
Hide file tree
Showing 35 changed files with 821 additions and 625 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -31,6 +31,7 @@ V_*
*~
*.he
*_none
.nfs*
BuildLog.htm
*resumelog*
._*resumelog
Expand Down
8 changes: 1 addition & 7 deletions CMakeLists.txt
Expand Up @@ -53,13 +53,6 @@ if(NOT ${PLATFORM} MATCHES nt)
add_subdirectory (dwarf)
add_subdirectory (symlite)
add_subdirectory (parseThat)
# DynC is not compatible with Windows when
# we use bison on linux to generate source
# TODO: generate with bison configured for
# MSVC?
if(${SYMREADER} MATCHES symtabAPI)
add_subdirectory (dynC_API)
endif()
endif()
add_subdirectory (instructionAPI)
add_subdirectory (symtabAPI)
Expand All @@ -69,6 +62,7 @@ add_subdirectory (stackwalk)
add_subdirectory (patchAPI)
if(${SYMREADER} MATCHES symtabAPI)
add_subdirectory (dyninstAPI)
add_subdirectory (dynC_API)
endif()

if(BUILD_RTLIB)
Expand Down
2 changes: 1 addition & 1 deletion cmake/shared.cmake
Expand Up @@ -3,7 +3,7 @@ set (DYNINST_MINOR_VERSION 2)
set (DYNINST_PATCH_VERSION 0)

# Debugging
set(Boost_DEBUG 1)
# set(Boost_DEBUG 1)

add_definitions(-DBOOST_ALL_NO_LIB=1)
set (SOVERSION "${DYNINST_MAJOR_VERSION}.${DYNINST_MINOR_VERSION}")
Expand Down
13 changes: 7 additions & 6 deletions cmake/warnings.cmake
@@ -1,9 +1,10 @@
if (CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_C_COMPILER_ID} MATCHES INTEL)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W -Wall -Wpointer-arith -Wcast-qual -Wcast-align")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Wpointer-arith -Wcast-qual -Woverloaded-virtual -Wcast-align -Wno-non-template-friend -Wno-unused-local-typedefs -Wno-deprecated-declarations")
elseif (${CMAKE_C_COMPILER_ID} MATCHES Clang)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W -Wall -Wpointer-arith -Wcast-qual")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Wpointer-arith -Wcast-qual -Woverloaded-virtual")
if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W -Wall -Wpointer-arith -Wcast-qual")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Wpointer-arith -Wcast-qual -Woverloaded-virtual")
if (CMAKE_C_COMPILER_ID MATCHES GNU)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wcast-align")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-align -Wno-non-template-friend -Wno-unused-local-typedefs -Wno-deprecated-declarations")
endif (CMAKE_C_COMPILER_ID MATCHES GNU)
elseif (MSVC)
message(STATUS "TODO: Set up custom warning flags for MSVC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4251 /wd4091 /wd4503")
Expand Down
1 change: 1 addition & 0 deletions common/h/SymReader.h
Expand Up @@ -91,6 +91,7 @@ class COMMON_EXPORT SymReader
virtual unsigned getAddressWidth() = 0;
virtual bool getABIVersion(int &major, int &minor) const = 0;
virtual bool isBigEndianDataEncoding() const = 0;
virtual Architecture getArchitecture() const = 0;

virtual unsigned numSegments() = 0;
virtual bool getSegment(unsigned num, SymSegment &reg) = 0;
Expand Down
3 changes: 3 additions & 0 deletions dynC_API/CMakeLists.txt
Expand Up @@ -9,6 +9,9 @@ include_directories(h

set_source_files_properties(${SRC_LIST} PROPERTIES LANGUAGE CXX)
add_definitions(-DDYNC_EXPORTS)
if(WIN32)
add_definitions(-DYY_NO_UNISTD_H)
endif()

dyninst_library(dynC_API dyninstAPI)
if (USE_COTIRE)
Expand Down
12 changes: 6 additions & 6 deletions dynC_API/src/C.l
Expand Up @@ -63,7 +63,7 @@ const bool lexVerbose = false; // set to true for debug mode
"*"+[^*/\n]* /* eat up '*'s not followed by '/'s */
\n ++line_num;
"*"+"/" BEGIN(INITIAL);
<<EOF>> {yylval.context = "Syntax Error: Unterminated block comment"; return(ERROR);}
<<EOF>> {yylval.context = "Syntax Error: Unterminated block comment"; return(D_ERROR);}
}

"//".* { if(lexVerbose)printf("Inline Comment\n") /* inline comment */;}
Expand All @@ -77,7 +77,7 @@ char|int|long|float|double|short|void|bool { yylval.sval = strdup(yytext); retur
"enum" {return ENUM; }

"case" { return(CASE); }
"const" { return(CONST); }
"const" { return(D_CONST); }
"default" { return(DEFAULT); }
"else" { return(ELSE); }
"if" { return(IF); }
Expand Down Expand Up @@ -130,7 +130,7 @@ L?'(\\.|[^\\'])+' { return(CONSTANT); }
yylval.context = "Unterminated string constant";
yycolumn = 1;
//yylval.line_number = line_num; line_num++;
return ERROR;
return D_ERROR;
}

\\[0-7]{1,3} { /* octal escape sequence */
Expand All @@ -140,7 +140,7 @@ L?'(\\.|[^\\'])+' { return(CONSTANT); }
/* error, constant is out-of-bounds */
yylval.context = "constant out of bounds";
// yylval.line_number = line_num;
return ERROR;
return D_ERROR;
}
c_string_buf += result;

Expand All @@ -149,7 +149,7 @@ L?'(\\.|[^\\'])+' { return(CONSTANT); }
\\[0-9]+ { /* generate error - bad escape sequence */
yylval.context = "bad escape sequence";
// yylval.line_number = line_num;
return ERROR;
return D_ERROR;
}
\\n c_string_buf += '\n';
\\t c_string_buf += '\t';
Expand Down Expand Up @@ -216,7 +216,7 @@ L?'(\\.|[^\\'])+' { return(CONSTANT); }
"`" { if(lexVerbose)printf("Backtick\n"); return(BACKTICK); }
[ \t\v\f] { }

^([^\n;{}])+\n {if(strstr(yytext, "//") != NULL){++line_num;}else{if(strncmp(yytext,"/*", 2) == 0){BEGIN(comment);++line_num;}else{if(lexVerbose)printf("No Semi!\n"); fatalError = true; dynClloc.first_column = yycolumn; yylval.context = "syntax error: missing ';'!"; yyless(yyleng - 1); return(ERROR);}}}
^([^\n;{}])+\n {if(strstr(yytext, "//") != NULL){++line_num;}else{if(strncmp(yytext,"/*", 2) == 0){BEGIN(comment);++line_num;}else{if(lexVerbose)printf("No Semi!\n"); fatalError = true; dynClloc.first_column = yycolumn; yylval.context = "syntax error: missing ';'!"; yyless(yyleng - 1); return(D_ERROR);}}}

\n {if(lexVerbose)printf("New Line!\n"); line_num++; yycolumn = 0; lineStr = "";}

Expand Down

0 comments on commit cd3ab6a

Please sign in to comment.