Skip to content

Commit

Permalink
Merge branch 'master' into arm64/feature/semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
ssunny7 committed Dec 1, 2016
2 parents c2c3348 + d8807bc commit 8eff56c
Show file tree
Hide file tree
Showing 30 changed files with 653 additions and 549 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
2 changes: 1 addition & 1 deletion cmake/warnings.cmake
Expand Up @@ -4,7 +4,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Wpointer-arith -Wcast-qual -Wo
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)
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
12 changes: 8 additions & 4 deletions common/src/linuxKludges.C
Expand Up @@ -286,9 +286,11 @@ bool PtraceBulkRead(Address inTraced, unsigned size, void *inSelf, int pid)
if (ret == -1) {
if (errno == ENOSYS) {
have_process_vm_readv = false;
} else if (errno == EFAULT) {
} else if (errno == EFAULT || errno == EPERM) {
/* Could be a no-read page -- ptrace may be allowed to
* peek anyway, so fallthrough and let ptrace try. */
* peek anyway, so fallthrough and let ptrace try.
* It may also be denied by kernel.yama.ptrace_scope=1 if we're
* no longer a direct ancestor thanks to pid re-parenting. */
} else {
return false;
}
Expand Down Expand Up @@ -377,9 +379,11 @@ bool PtraceBulkWrite(Dyninst::Address inTraced, unsigned nbytes,
if (ret == -1) {
if (errno == ENOSYS) {
have_process_vm_writev = false;
} else if (errno == EFAULT) {
} else if (errno == EFAULT || errno == EPERM) {
/* Could be a read-only page -- ptrace may be allowed to
* poke anyway, so fallthrough and let ptrace try. */
* poke anyway, so fallthrough and let ptrace try.
* It may also be denied by kernel.yama.ptrace_scope=1 if we're
* no longer a direct ancestor thanks to pid re-parenting. */
} else {
return false;
}
Expand Down
8 changes: 4 additions & 4 deletions dataflowAPI/src/stackanalysis.C
Expand Up @@ -61,13 +61,13 @@ const StackAnalysis::Height StackAnalysis::Height::top(
StackAnalysis::Height::uninitialized, StackAnalysis::Height::TOP);

AnnotationClass<StackAnalysis::Intervals>
Stack_Anno_Intervals(std::string("Stack_Anno_Intervals"), nullptr);
Stack_Anno_Intervals(std::string("Stack_Anno_Intervals"), NULL);
AnnotationClass<StackAnalysis::BlockEffects>
Stack_Anno_Block_Effects(std::string("Stack_Anno_Block_Effects"), nullptr);
Stack_Anno_Block_Effects(std::string("Stack_Anno_Block_Effects"), NULL);
AnnotationClass<StackAnalysis::InstructionEffects>
Stack_Anno_Insn_Effects(std::string("Stack_Anno_Insn_Effects"), nullptr);
Stack_Anno_Insn_Effects(std::string("Stack_Anno_Insn_Effects"), NULL);
AnnotationClass<StackAnalysis::CallEffects>
Stack_Anno_Call_Effects(std::string("Stack_Anno_Call_Effects"), nullptr);
Stack_Anno_Call_Effects(std::string("Stack_Anno_Call_Effects"), NULL);

template class std::list<Dyninst::StackAnalysis::TransferFunc*>;
template class std::map<Dyninst::Absloc, Dyninst::StackAnalysis::Height>;
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 8eff56c

Please sign in to comment.