diff --git a/.gitignore b/.gitignore index 285bc28f71..2d05a2e2e6 100644 --- a/.gitignore +++ b/.gitignore @@ -129,6 +129,7 @@ CMakeCache.txt !cmake/*.cmake *.pc Makefile +!targets/*/Makefile !test/*/Makefile # Unit test output @@ -140,3 +141,10 @@ unittests/PhasarLLVM/ifdside/Problems/IFDSTaintAnalysisTest unittests/PhasarLLVM/Pointer/LLVMTypeHierarchyTest unittests/Utils/LLVMShorthandsTest unittests/Utils/PAMMTest + +cmake-build*/* + +out +targets/parson/test +targets/parson/testcpp +targets/mini/test diff --git a/CMakeLists.txt b/CMakeLists.txt index 77b9ba8f19..4a81db5773 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.0) - +cmake_policy(SET CMP0060 NEW) # Check if we build within the llvm source tree if (DEFINED LLVM_MAIN_SRC_DIR) set(PHASAR_IN_TREE 1) @@ -14,6 +14,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS YES) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "ON") set_property(GLOBAL PROPERTY TARGET_MESSAGES OFF) @@ -22,9 +23,9 @@ if (NOT CMAKE_BUILD_TYPE) default is 'Debug')" FORCE) endif () if(CMAKE_BUILD_TYPE STREQUAL "Debug") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MP -fvisibility-inlines-hidden -fstack-protector-strong -ffunction-sections -fdata-sections -pipe -g") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MP -fvisibility-inlines-hidden -fstack-protector-strong -ffunction-sections -fdata-sections -fno-limit-debug-info -march=native -pipe -g") else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MP -fvisibility-inlines-hidden -fstack-protector-strong -ffunction-sections -fdata-sections -pipe -march=native") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MP -fvisibility-inlines-hidden -fstack-protector-strong -ffunction-sections -fdata-sections -fno-limit-debug-info -pipe -march=native") endif() # Enable testing @@ -135,6 +136,7 @@ if (NOT PHASAR_IN_TREE) find_package(LLVM 10 REQUIRED CONFIG) include_directories(${LLVM_INCLUDE_DIRS}) link_directories(${LLVM_LIB_PATH} ${LLVM_LIBRARY_DIRS}) + message("Lib: ${LLVM_LIB_PATH} | ${LLVM_INCLUDE_DIRS} | ${LLVM_LIBRARY_DIRS}") endif() add_definitions(${LLVM_DEFINITIONS}) @@ -178,7 +180,8 @@ if(PHASAR_IN_TREE OR NEED_LIBCLANG_COMPONENT_LIBS) clangASTMatchers clangLex clangBasic - LLVMFrontendOpenMP) + LLVMFrontendOpenMP + ) endif() if (NOT PHASAR_IN_TREE) # Only search for clang if we build out of tree @@ -229,6 +232,7 @@ llvm_map_components_to_libnames(llvm_libs ${LLVM_LINK_COMPONENTS} ) + # phasar-based binaries add_subdirectory(tools) diff --git a/bootstrap.sh b/bootstrap.sh index 55cdf468d6..cd7975c33e 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -6,7 +6,7 @@ readonly PHASAR_INSTALL_DIR="/usr/local/phasar" readonly LLVM_INSTALL_DIR="/usr/local/llvm-10" NUM_THREADS=$(nproc) -LLVM_RELEASE=llvmorg-10.0.0 +LLVM_RELEASE=llvmorg-10.0.1 DO_UNIT_TEST=false diff --git a/include/phasar/PhasarLLVM/ControlFlow/LLVMBasedCFG.h b/include/phasar/PhasarLLVM/ControlFlow/LLVMBasedCFG.h index 82b07e0e50..9259a8c276 100644 --- a/include/phasar/PhasarLLVM/ControlFlow/LLVMBasedCFG.h +++ b/include/phasar/PhasarLLVM/ControlFlow/LLVMBasedCFG.h @@ -17,7 +17,10 @@ #ifndef PHASAR_PHASARLLVM_CONTROLFLOW_LLVMBASEDCFG_H_ #define PHASAR_PHASARLLVM_CONTROLFLOW_LLVMBASEDCFG_H_ +#include + #include + #include #include #include @@ -27,6 +30,7 @@ namespace llvm { class Function; class Instruction; +class BasicBlock; } // namespace llvm namespace psr { @@ -71,6 +75,15 @@ class LLVMBasedCFG [[nodiscard]] bool isFieldStore(const llvm::Instruction *Stmt) const override; + static std::map> + getNonTerminationSensitiveControlDependence(const llvm::Function &fun); + + static std::map> + getNonTerminationInsensitiveControlDependence(const llvm::Function &fun); + + static std::map> + getDecisiveControlDependence(const llvm::Function &fun); + [[nodiscard]] bool isFallThroughSuccessor(const llvm::Instruction *Stmt, const llvm::Instruction *succ) const override; diff --git a/include/phasar/Utils/LLVMIRToSrc.h b/include/phasar/Utils/LLVMIRToSrc.h index f67a0fa514..9334d16927 100644 --- a/include/phasar/Utils/LLVMIRToSrc.h +++ b/include/phasar/Utils/LLVMIRToSrc.h @@ -46,7 +46,7 @@ unsigned int getColumnFromIR(const llvm::Value *V); std::string getSrcCodeFromIR(const llvm::Value *V); std::string getModuleIDFromIR(const llvm::Value *V); - +unsigned int getFunctionHeaderLines(const llvm::Value *V); } // namespace psr #endif diff --git a/lib/DB/CMakeLists.txt b/lib/DB/CMakeLists.txt index eb2a1d9eb8..03a0acad69 100644 --- a/lib/DB/CMakeLists.txt +++ b/lib/DB/CMakeLists.txt @@ -4,6 +4,7 @@ include_directories( ${SQLITE3_INCLUDE_DIR} ) + set(PHASAR_LINK_LIBS phasar_pointer phasar_typehierarchy diff --git a/lib/DB/DBConn.cpp b/lib/DB/DBConn.cpp index 8359c38207..79d8c5d44d 100644 --- a/lib/DB/DBConn.cpp +++ b/lib/DB/DBConn.cpp @@ -553,7 +553,11 @@ bool DBConn::insertModule(const string &ProjectName, string identifier(module->getModuleIdentifier()); string ir_mod_buffer; llvm::raw_string_ostream rso(ir_mod_buffer); + #if LLVM_VERSION_MAJOR < 7 llvm::WriteBitcodeToFile(module, rso); + #else + llvm::WriteBitcodeToFile(*module, rso); + #endif rso.flush(); istringstream ist(ir_mod_buffer); size_t hash_value = hash()(ir_mod_buffer); diff --git a/lib/DB/ProjectIRDB.cpp b/lib/DB/ProjectIRDB.cpp index 21877543a1..3fb6904a4c 100644 --- a/lib/DB/ProjectIRDB.cpp +++ b/lib/DB/ProjectIRDB.cpp @@ -10,6 +10,7 @@ #include #include #include + #include #include "llvm/Bitcode/BitcodeReader.h" @@ -39,6 +40,7 @@ #include "phasar/Utils/PAMMMacros.h" #include "phasar/Utils/Utilities.h" + using namespace psr; using namespace std; @@ -61,10 +63,7 @@ ProjectIRDB::ProjectIRDB(const std::vector &IRFiles, : ProjectIRDB(Options | IRDBOptions::OWNS) { for (const auto &File : IRFiles) { // if we have a file that is already compiled to llvm ir - if ((File.find(".ll") != std::basic_string, - std::allocator>::npos || - File.find(".bc") != std::basic_string, - std::allocator>::npos) && + if ((File.find(".ll") != File.npos || File.find(".bc") != File.npos) && boost::filesystem::exists(File)) { llvm::SMDiagnostic Diag; std::unique_ptr C(new llvm::LLVMContext); diff --git a/lib/PhasarLLVM/ControlFlow/LLVMBasedCFG.cpp b/lib/PhasarLLVM/ControlFlow/LLVMBasedCFG.cpp index 7f31af098f..08963d55ba 100644 --- a/lib/PhasarLLVM/ControlFlow/LLVMBasedCFG.cpp +++ b/lib/PhasarLLVM/ControlFlow/LLVMBasedCFG.cpp @@ -26,6 +26,7 @@ #include "llvm/IR/Instruction.h" #include "llvm/IR/Instructions.h" +#include #include "phasar/Config/Configuration.h" #include "phasar/PhasarLLVM/ControlFlow/LLVMBasedCFG.h" #include "phasar/Utils/LLVMShorthands.h" @@ -316,3 +317,332 @@ nlohmann::json LLVMBasedCFG::getAsJson(const llvm::Function *F) const { } } // namespace psr + + + +bool hasSingleExitNode(const llvm::Function &fun) { + bool foundOne = false; + for (const auto &bb : fun) { + // TODO: What is about throws + if (llvm::isa(bb.getTerminator())) { + if (foundOne) { + return false; + } else { + foundOne = true; + } + } + } + return foundOne; +} + +void getControlDependence() {} +using pathElem = pair; +void getStrongControlDependence() {} +void getWeakControlDependence() {} + +bool haveEmptyIntersection(const set &s1, const set &s2) { + vector diff(s1.size()); + std::set_difference(s1.begin(), s1.end(), s2.begin(), s2.end(), diff.begin()); + return !diff.empty() && + std::any_of(diff.begin(), diff.end(), [](pathElem &pathElem1) { + return pathElem1 != + make_pair( + nullptr, nullptr); + }); +} + +map> +LLVMBasedCFG::getNonTerminationSensitiveControlDependence( + const llvm::Function &fun) { + if (!fun.isDeclaration()) { + deque wl; + map>> + maximalPaths; + set condNodes; + for (const auto &n : fun) { + auto *term{n.getTerminator()}; + auto numSucc{term->getNumSuccessors()}; + if (numSucc > 1) { + condNodes.insert(&n); + for (unsigned int i = 0; i < numSucc; ++i) { + auto *succ{term->getSuccessor(i)}; + wl.push_back(succ); + auto &m = maximalPaths[succ]; + m[&n].emplace(&n, succ); + } + } + } + + while (!wl.empty()) { + auto n = wl.front(); + wl.pop_front(); + auto *term = n->getTerminator(); + auto numSucc = term->getNumSuccessors(); + if (numSucc == 1) { + auto *m = term->getSuccessor(0); + if (m != n) { + for (auto *p : condNodes) { + auto &s1{maximalPaths[n][p]}; + auto &s2{maximalPaths[m][p]}; + vector diff(s1.size()); + std::set_difference(s1.begin(), s1.end(), s2.begin(), s2.end(), + diff.begin()); + if (haveEmptyIntersection(s1, s2)) { + s2.insert(s1.begin(), s1.end()); + wl.push_back(m); + } + } + } + } else if (numSucc > 1) { + for (auto &m : fun) { + auto numSuccM = m.getTerminator()->getNumSuccessors(); + if (maximalPaths[&m][n].size() == numSuccM) { + for (auto *p : condNodes) { + if (p != n) { + auto &s1{maximalPaths[n][p]}; + auto &s2{maximalPaths[&m][p]}; + vector diff(s1.size()); + std::set_difference(s1.begin(), s1.end(), s2.begin(), s2.end(), + diff.begin()); + if (haveEmptyIntersection(s1, s2)) { + s2.insert(s1.begin(), s1.end()); + wl.push_back(&m); + } + } + } + } + } + } + } + + for (auto &maximalPath : maximalPaths) { + auto *p = maximalPath.first; + for (auto &bla : maximalPath.second) { + auto *n = bla.first; + for (auto &m : bla.second) { + llvm::dbgs() << "Path: " << n->getName() << " -> " << p->getName() + << " -> " << m.second->getName() << "\n"; + } + } + } + map> cds; + for (const auto &n : fun) { + for (const auto *m : condNodes) { + auto numPaths = maximalPaths[&n][m].size(); + auto numSucc = m->getTerminator()->getNumSuccessors(); + if (numPaths > 0 && numPaths < numSucc) { + cds[m].insert(&n); + } + } + } + + fun.viewCFG(); + + for (auto &bb : cds) { + bb.first->print(llvm::dbgs()); + llvm::dbgs() << " " << bb.first->getValueName()->first() + << "\n"; + for (auto &bb2 : bb.second) { + llvm::dbgs() << "\t"; + bb2->print(llvm::dbgs()); + llvm::dbgs() << " " << bb2->getValueName()->first() << "\n"; + } + } + + return cds; + } + return std::map>(); +} + +map> +LLVMBasedCFG::getNonTerminationInsensitiveControlDependence( + const llvm::Function &fun) { + + if (!fun.isDeclaration()) { + deque wl; + map>> + maximalPaths; + set condNodes; + for (const auto &n : fun) { + auto *term{n.getTerminator()}; + auto numSucc{term->getNumSuccessors()}; + if (numSucc > 1) { + condNodes.insert(&n); + for (unsigned int i = 0; i < numSucc; ++i) { + auto *succ{term->getSuccessor(i)}; + wl.push_back(succ); + auto &m = maximalPaths[succ]; + m[&n].emplace(&n, succ); + } + } + } + + while (!wl.empty()) { + auto n = wl.front(); + wl.pop_front(); + auto *term = n->getTerminator(); + auto numSucc = term->getNumSuccessors(); + if (numSucc == 1) { + auto *m = term->getSuccessor(0); + if (m != n) { + for (auto *p : condNodes) { + auto &s1{maximalPaths[n][p]}; + auto &s2{maximalPaths[m][p]}; + vector diff(s1.size()); + std::set_difference(s1.begin(), s1.end(), s2.begin(), s2.end(), + diff.begin()); + if (haveEmptyIntersection(s1, s2)) { + s2.insert(s1.begin(), s1.end()); + wl.push_back(m); + } + } + } + } else if (numSucc > 1) { + for (auto &m : fun) { + auto numSuccM = m.getTerminator()->getNumSuccessors(); + if (maximalPaths[&m][n].size() == numSuccM) { + for (auto *p : condNodes) { + if (p != n) { + auto &s1{maximalPaths[n][p]}; + auto &s2{maximalPaths[&m][p]}; + vector diff(s1.size()); + std::set_difference(s1.begin(), s1.end(), s2.begin(), s2.end(), + diff.begin()); + if (haveEmptyIntersection(s1, s2)) { + s2.insert(s1.begin(), s1.end()); + wl.push_back(&m); + } + } + } + } + } + } + if (!maximalPaths[n][n].empty()) { + for (unsigned i = 0; i < numSucc; ++i) { + auto *m = term->getSuccessor(i); + if (m != n) { + auto &s1{maximalPaths[n][n]}; + auto &s2{maximalPaths[m][n]}; + vector diff(s1.size()); + std::set_difference(s1.begin(), s1.end(), s2.begin(), s2.end(), + diff.begin()); + if (!diff.empty() && + std::any_of(diff.begin(), diff.end(), [](pathElem &pathElem1) { + return pathElem1 != + make_pair(nullptr, nullptr); + })) { + s2.insert(s1.begin(), s1.end()); + wl.push_back(m); + } + } + } + } + } + + for (auto &maximalPath : maximalPaths) { + auto *p = maximalPath.first; + for (auto &bla : maximalPath.second) { + auto *n = bla.first; + for (auto &m : bla.second) { + llvm::dbgs() << "Path: " << n->getName() << " -> " << p->getName() + << " -> " << m.second->getName() << "\n"; + } + } + } + map> cds; + for (const auto &n : fun) { + for (const auto *m : condNodes) { + auto numPaths = maximalPaths[&n][m].size(); + auto numSucc = m->getTerminator()->getNumSuccessors(); + if (numPaths > 0 && numPaths < numSucc) { + cds[m].insert(&n); + } + } + } + + // fun.viewCFG(); + + for (auto &bb : cds) { + bb.first->print(llvm::dbgs()); + llvm::dbgs() << " " << bb.first->getValueName()->first() + << "\n"; + for (auto &bb2 : bb.second) { + llvm::dbgs() << "\t"; + bb2->print(llvm::dbgs()); + llvm::dbgs() << " " << bb2->getValueName()->first() << "\n"; + } + } + return cds; + } + return std::map>(); +} + +map> +LLVMBasedCFG::getDecisiveControlDependence(const llvm::Function &fun) { + if (!fun.isDeclaration()) { + deque wl; + map>> + S; + set condNodes; + for (const auto &n : fun) { + auto *term{n.getTerminator()}; + auto numSucc{term->getNumSuccessors()}; + if (numSucc > 1) { + condNodes.insert(&n); + for (unsigned int i = 0; i < numSucc; ++i) { + auto *succ{term->getSuccessor(i)}; + wl.push_back(succ); + auto &m = S[succ]; + m[&n].emplace(&n, succ); + } + } + } + while (!wl.empty()) { + auto n = wl.front(); + wl.pop_front(); + auto *term = n->getTerminator(); + auto numSuccs = term->getNumSuccessors(); + for (unsigned int i = 0; i < numSuccs; ++i) { + auto *m = term->getSuccessor(i); + for (auto *p : condNodes) { + auto &s1{S[n][p]}; + auto &s2{S[m][p]}; + vector diff(s1.size()); + std::set_difference(s1.begin(), s1.end(), s2.begin(), s2.end(), + diff.begin()); + if (haveEmptyIntersection(s1, s2)) { + s2.insert(s1.begin(), s1.end()); + wl.push_back(m); + } + } + } + } + map> cds{ + getNonTerminationSensitiveControlDependence(fun)}; + + for (const auto &n : fun) { + auto &cd{cds[&n]}; + for (auto it = cd.begin(); it != cd.end(); it++) { + auto numSuccs = (*it)->getTerminator()->getNumSuccessors(); + if (S[&n][*it].size() == numSuccs) { + auto temp = it; + temp--; + cd.erase(it); + it = temp; + } + } + } + return cds; + } + return std::map>(); +} + +void getOrderDependence() {} + +void getStrongOrderDependence() {} + +void getWeakOrderDependence() {} + +void getDataSensitiveOrderDependence() {} + diff --git a/lib/PhasarLLVM/TypeHierarchy/LLVMTypeHierarchy.cpp b/lib/PhasarLLVM/TypeHierarchy/LLVMTypeHierarchy.cpp index 255a635331..97f41c6ecb 100644 --- a/lib/PhasarLLVM/TypeHierarchy/LLVMTypeHierarchy.cpp +++ b/lib/PhasarLLVM/TypeHierarchy/LLVMTypeHierarchy.cpp @@ -75,16 +75,16 @@ LLVMTypeHierarchy::LLVMTypeHierarchy(ProjectIRDB &IRDB) { for (auto *M : IRDB.getAllModules()) { buildLLVMTypeHierarchy(*M); } - REG_COUNTER("CH Vertices", getNumOfVertices(), PAMM_SEVERITY_LEVEL::Full); - REG_COUNTER("CH Edges", getNumOfEdges(), PAMM_SEVERITY_LEVEL::Full); +// REG_COUNTER("CH Vertices", getNumOfVertices(), PAMM_SEVERITY_LEVEL::Full); +// REG_COUNTER("CH Edges", getNumOfEdges(), PAMM_SEVERITY_LEVEL::Full); } LLVMTypeHierarchy::LLVMTypeHierarchy(const llvm::Module &M) { PAMM_GET_INSTANCE; LOG_IF_ENABLE(BOOST_LOG_SEV(lg::get(), INFO) << "Construct type hierarchy"); buildLLVMTypeHierarchy(M); - REG_COUNTER("CH Vertices", getNumOfVertices(), PAMM_SEVERITY_LEVEL::Full); - REG_COUNTER("CH Edges", getNumOfEdges(), PAMM_SEVERITY_LEVEL::Full); +// REG_COUNTER("CH Vertices", getNumOfVertices(), PAMM_SEVERITY_LEVEL::Full); +// REG_COUNTER("CH Edges", getNumOfEdges(), PAMM_SEVERITY_LEVEL::Full); } std::string diff --git a/lib/Utils/LLVMIRToSrc.cpp b/lib/Utils/LLVMIRToSrc.cpp index c7ab4f0958..56f4b4028b 100644 --- a/lib/Utils/LLVMIRToSrc.cpp +++ b/lib/Utils/LLVMIRToSrc.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include "boost/algorithm/string/trim.hpp" #include "boost/filesystem.hpp" @@ -88,12 +89,12 @@ llvm::DISubprogram *getDISubprogram(const llvm::Value *V) { llvm::DILocation *getDILocation(const llvm::Value *V) { // Arguments and Instruction such as AllocaInst - if (auto *DbgIntr = getDbgVarIntrinsic(V)) { - if (auto *MN = DbgIntr->getMetadata(llvm::LLVMContext::MD_dbg)) { + if (const auto *I = llvm::dyn_cast(V)) { + if (auto *MN = I->getMetadata(llvm::LLVMContext::MD_dbg)) { return llvm::dyn_cast(MN); } - } else if (const auto *I = llvm::dyn_cast(V)) { - if (auto *MN = I->getMetadata(llvm::LLVMContext::MD_dbg)) { + } else if (auto *DbgIntr = getDbgVarIntrinsic(V)) { + if (auto *MN = DbgIntr->getMetadata(llvm::LLVMContext::MD_dbg)) { return llvm::dyn_cast(MN); } } @@ -205,8 +206,47 @@ unsigned int getColumnFromIR(const llvm::Value *V) { return 0; } +unsigned int getFunctionHeaderLines(const llvm::Value *V) { + unsigned int LineNr = getLineFromIR(V); + if (LineNr > 0) { + boost::filesystem::path Path(getFilePathFromIR(V)); + if (boost::filesystem::exists(Path) && + !boost::filesystem::is_directory(Path)) { + std::ifstream Ifs(Path.string(), std::ios::binary); + if (Ifs.is_open()) { + Ifs.seekg(std::ios::beg); + std::string SrcLine; + for (unsigned int I = 0; I < LineNr - 1; ++I) { + Ifs.ignore(std::numeric_limits::max(), '\n'); + } + while (true) { + std::getline(Ifs, SrcLine); + std::string res; + // TODO + unsigned int i = 0; // columnNr -1; + while (true) { + auto current_char = SrcLine[i]; + res.push_back(current_char); + i++; + if (current_char == '{') { + return LineNr; + } + if (SrcLine.length() == i) { + break; + } + } + LineNr++; + // boost::algorithm::trim(SrcLine); + } + } + } + } +} + std::string getSrcCodeFromIR(const llvm::Value *V) { unsigned int LineNr = getLineFromIR(V); + unsigned int columnNr = getColumnFromIR(V); + // TODO if (LineNr > 0) { boost::filesystem::path Path(getFilePathFromIR(V)); if (boost::filesystem::exists(Path) && @@ -219,8 +259,20 @@ std::string getSrcCodeFromIR(const llvm::Value *V) { Ifs.ignore(std::numeric_limits::max(), '\n'); } std::getline(Ifs, SrcLine); - boost::algorithm::trim(SrcLine); - return SrcLine; + std::string res; + // TODO + unsigned int i = 0; // columnNr -1; + while (true) { + auto current_char = SrcLine[i]; + res.push_back(current_char); + i++; + if (current_char == ';' || current_char == '}' || + SrcLine.length() == i) { + break; + } + } + // boost::algorithm::trim(SrcLine); + return res; } } } diff --git a/targets/cd.c b/targets/cd.c new file mode 100644 index 0000000000..cbaf518f98 --- /dev/null +++ b/targets/cd.c @@ -0,0 +1,31 @@ +#include +#include + +void oneC(){ + bool condA = rand() < (RAND_MAX/2); + bool condC,condD,condF; + if (condA) { + labelB: + condC = rand() < (RAND_MAX/2); + if (condC) { + goto labelB; + } + labelD: + condD = rand() < (RAND_MAX/2); + if (condD) { + goto labelJ; + } + labelJ: + goto labelD; + } else { + condF = rand() < (RAND_MAX/2); + if (condF) { + + } + } +} + + +int main(void) { + oneC(); +} \ No newline at end of file diff --git a/targets/ex.c b/targets/ex.c new file mode 100755 index 0000000000..ef1bee780f --- /dev/null +++ b/targets/ex.c @@ -0,0 +1,71 @@ +int parse_unit(char*); +int unit; +void* axis_command; +void* parse_axis_command(char*); +void move_x(void*); +void move_y(void*); +void move_z(void*); +void home_axes(); +#define NULL 0 +#define UNSUPPORTED_COMMAND "" +#define FAIL(error) ""; +#define FOO "" + +void parse_command(char* input) { + axis_command = NULL; + int test2 =0; + if (input[0] == 'G') { + unit = parse_unit(input); // mm or inches + axis_command = parse_axis_command(input); + move_x(axis_command); + move_y(axis_command); +#ifdef Z_ENABLED + move_z(axis_command); +#endif + } else if (input[0] == 'H'){ + coolant(); + } else { FAIL(UNSUPPORTED_COMMAND) } + int test = 0; + test = getTest(); + if (axis_command) { + do_command(test,test2); + } +} + +int getTest(int a, int b){ + int i = 0; + int j = 2; + return b; +} + + +// The Slice should look like this: + + void parse_command(char* input) { + axis_command = NULL; + if (input[0] == 'G') { + axis_command = parse_axis_command(input); + move_x(axis_command); + move_y(axis_command); + } else if (input[0] == 'H'){ + } else { } + if (axis_command) { + FOO; + } + } + + void parse_command(char* input) { + axis_command = NULL; + if (input[0] == 'G') { + unit = parse_unit(input); // mm or inches + axis_command = parse_axis_command(input); + move_x(axis_command); + move_y(axis_command); + #ifdef Z_ENABLED + move_z(axis_command); + #endif + } else if (input[0] == 'H'){ + coolant(); + } else { FAIL(UNSUPPORTED_COMMAND) } + if (axis_command) {} + } \ No newline at end of file diff --git a/targets/gcode.c b/targets/gcode.c new file mode 100755 index 0000000000..2844e2c59c --- /dev/null +++ b/targets/gcode.c @@ -0,0 +1,1163 @@ +/* + gcode.c - rs274/ngc parser. + Part of Grbl + + Copyright (c) 2011-2016 Sungeun K. Jeon for Gnea Research LLC + Copyright (c) 2009-2011 Simen Svale Skogsrud + + Grbl is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Grbl is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Grbl. If not, see . +*/ + +#include "grbl.h" + +// NOTE: Max line number is defined by the g-code standard to be 99999. It seems to be an +// arbitrary value, and some GUIs may require more. So we increased it based on a max safe +// value when converting a float (7.2 digit precision)s to an integer. +#define MAX_LINE_NUMBER 10000000 +#define MAX_TOOL_NUMBER 255 // Limited by max unsigned 8-bit value + +#define AXIS_COMMAND_NONE 0 +#define AXIS_COMMAND_NON_MODAL 1 +#define AXIS_COMMAND_MOTION_MODE 2 +#define AXIS_COMMAND_TOOL_LENGTH_OFFSET 3 // *Undefined but required + +// Declare gc extern struct +parser_state_t gc_state; +parser_block_t gc_block; + +#define FAIL(status) return(status); + + +void gc_init() +{ + memset(&gc_state, 0, sizeof(parser_state_t)); + + // Load default G54 coordinate system. + if (!(settings_read_coord_data(gc_state.modal.coord_select,gc_state.coord_system))) { + report_status_message(STATUS_SETTING_READ_FAIL); + } +} + + +// Sets g-code parser position in mm. Input in steps. Called by the system abort and hard +// limit pull-off routines. +void gc_sync_position() +{ + system_convert_array_steps_to_mpos(gc_state.position,sys_position); +} + + +// Executes one line of 0-terminated G-Code. The line is assumed to contain only uppercase +// characters and signed floating point values (no whitespace). Comments and block delete +// characters have been removed. In this function, all units and positions are converted and +// exported to grbl's internal functions in terms of (mm, mm/min) and absolute machine +// coordinates, respectively. +uint8_t gc_execute_line(char *line) +{ + /* ------------------------------------------------------------------------------------- + STEP 1: Initialize parser block struct and copy current g-code state modes. The parser + updates these modes and commands as the block line is parser and will only be used and + executed after successful error-checking. The parser block struct also contains a block + values struct, word tracking variables, and a non-modal commands tracker for the new + block. This struct contains all of the necessary information to execute the block. */ + + memset(&gc_block, 0, sizeof(parser_block_t)); // Initialize the parser block struct. + memcpy(&gc_block.modal,&gc_state.modal,sizeof(gc_modal_t)); // Copy current modes + + uint8_t axis_command = AXIS_COMMAND_NONE; + uint8_t axis_0, axis_1, axis_linear; + #ifdef A_AXIS_ENABLE + uint8_t axis_a; + #endif + uint8_t coord_select = 0; // Tracks G10 P coordinate selection for execution + + // Initialize bitflag tracking variables for axis indices compatible operations. + uint8_t axis_words = 0; // XYZ tracking + uint8_t ijk_words = 0; // IJK tracking + + // Initialize command and value words and parser flags variables. + uint16_t command_words = 0; // Tracks G and M command words. Also used for modal group violations. + uint16_t value_words = 0; // Tracks value words. + uint8_t gc_parser_flags = GC_PARSER_NONE; + + // Determine if the line is a jogging motion or a normal g-code block. + if (line[0] == '$') { // NOTE: `$J=` already parsed when passed to this function. + // Set G1 and G94 enforced modes to ensure accurate error checks. + gc_parser_flags |= GC_PARSER_JOG_MOTION; + gc_block.modal.motion = MOTION_MODE_LINEAR; + gc_block.modal.feed_rate = FEED_RATE_MODE_UNITS_PER_MIN; + gc_block.values.n = JOG_LINE_NUMBER; // Initialize default line number reported during jog. + } + + /* ------------------------------------------------------------------------------------- + STEP 2: Import all g-code words in the block line. A g-code word is a letter followed by + a number, which can either be a 'G'/'M' command or sets/assigns a command value. Also, + perform initial error-checks for command word modal group violations, for any repeated + words, and for negative values set for the value words F, N, P, T, and S. */ + + uint8_t word_bit; // Bit-value for assigning tracking variables + uint8_t char_counter; + char letter; + float value; + uint8_t int_value = 0; + uint16_t mantissa = 0; + if (gc_parser_flags & GC_PARSER_JOG_MOTION) { char_counter = 3; } // Start parsing after `$J=` + else { char_counter = 0; } + + while (line[char_counter] != 0) { // Loop until no more g-code words in line. + + // Import the next g-code word, expecting a letter followed by a value. Otherwise, error out. + letter = line[char_counter]; + if((letter < 'A') || (letter > 'Z')) { FAIL(STATUS_EXPECTED_COMMAND_LETTER); } // [Expected word letter] + char_counter++; + if (!read_float(line, &char_counter, &value)) { FAIL(STATUS_BAD_NUMBER_FORMAT); } // [Expected word value] + + // Convert values to smaller uint8 significand and mantissa values for parsing this word. + // NOTE: Mantissa is multiplied by 100 to catch non-integer command values. This is more + // accurate than the NIST gcode requirement of x10 when used for commands, but not quite + // accurate enough for value words that require integers to within 0.0001. This should be + // a good enough comprimise and catch most all non-integer errors. To make it compliant, + // we would simply need to change the mantissa to int16, but this add compiled flash space. + // Maybe update this later. + int_value = trunc(value); + mantissa = round(100*(value - int_value)); // Compute mantissa for Gxx.x commands. + // NOTE: Rounding must be used to catch small floating point errors. + + // Check if the g-code word is supported or errors due to modal group violations or has + // been repeated in the g-code block. If ok, update the command or record its value. + switch(letter) { + + /* 'G' and 'M' Command Words: Parse commands and check for modal group violations. + NOTE: Modal group numbers are defined in Table 4 of NIST RS274-NGC v3, pg.20 */ + + case 'G': + // Determine 'G' command and its modal group + switch(int_value) { + case 10: case 28: case 30: case 92: + // Check for G10/28/30/92 being called with G0/1/2/3/38 on same block. + // * G43.1 is also an axis command but is not explicitly defined this way. + if (mantissa == 0) { // Ignore G28.1, G30.1, and G92.1 + if (axis_command) { FAIL(STATUS_GCODE_AXIS_COMMAND_CONFLICT); } // [Axis word/command conflict] + axis_command = AXIS_COMMAND_NON_MODAL; + } + // No break. Continues to next line. + case 4: case 53: + word_bit = MODAL_GROUP_G0; + gc_block.non_modal_command = int_value; + if ((int_value == 28) || (int_value == 30) || (int_value == 92)) { + if (!((mantissa == 0) || (mantissa == 10))) { FAIL(STATUS_GCODE_UNSUPPORTED_COMMAND); } + gc_block.non_modal_command += mantissa; + mantissa = 0; // Set to zero to indicate valid non-integer G command. + } + break; + case 0: case 1: case 2: case 3: case 38: + // Check for G0/1/2/3/38 being called with G10/28/30/92 on same block. + // * G43.1 is also an axis command but is not explicitly defined this way. + if (axis_command) { FAIL(STATUS_GCODE_AXIS_COMMAND_CONFLICT); } // [Axis word/command conflict] + axis_command = AXIS_COMMAND_MOTION_MODE; + // No break. Continues to next line. + case 80: + word_bit = MODAL_GROUP_G1; + gc_block.modal.motion = int_value; + if (int_value == 38){ + if (!((mantissa == 20) || (mantissa == 30) || (mantissa == 40) || (mantissa == 50))) { + FAIL(STATUS_GCODE_UNSUPPORTED_COMMAND); // [Unsupported G38.x command] + } + gc_block.modal.motion += (mantissa/10)+100; + mantissa = 0; // Set to zero to indicate valid non-integer G command. + } + break; + case 17: case 18: case 19: + word_bit = MODAL_GROUP_G2; + gc_block.modal.plane_select = int_value - 17; + break; + case 90: case 91: + if (mantissa == 0) { + word_bit = MODAL_GROUP_G3; + gc_block.modal.distance = int_value - 90; + } else { + word_bit = MODAL_GROUP_G4; + if ((mantissa != 10) || (int_value == 90)) { FAIL(STATUS_GCODE_UNSUPPORTED_COMMAND); } // [G90.1 not supported] + mantissa = 0; // Set to zero to indicate valid non-integer G command. + // Otherwise, arc IJK incremental mode is default. G91.1 does nothing. + } + break; + case 93: case 94: + word_bit = MODAL_GROUP_G5; + gc_block.modal.feed_rate = 94 - int_value; + break; + case 20: case 21: + word_bit = MODAL_GROUP_G6; + gc_block.modal.units = 21 - int_value; + break; + case 40: + word_bit = MODAL_GROUP_G7; + // NOTE: Not required since cutter radius compensation is always disabled. Only here + // to support G40 commands that often appear in g-code program headers to setup defaults. + // gc_block.modal.cutter_comp = CUTTER_COMP_DISABLE; // G40 + break; + case 43: case 49: + word_bit = MODAL_GROUP_G8; + // NOTE: The NIST g-code standard vaguely states that when a tool length offset is changed, + // there cannot be any axis motion or coordinate offsets updated. Meaning G43, G43.1, and G49 + // all are explicit axis commands, regardless if they require axis words or not. + if (axis_command) { FAIL(STATUS_GCODE_AXIS_COMMAND_CONFLICT); } // [Axis word/command conflict] } + axis_command = AXIS_COMMAND_TOOL_LENGTH_OFFSET; + if (int_value == 49) { // G49 + gc_block.modal.tool_length = TOOL_LENGTH_OFFSET_CANCEL; + } else if (mantissa == 10) { // G43.1 + gc_block.modal.tool_length = TOOL_LENGTH_OFFSET_ENABLE_DYNAMIC; + } else { FAIL(STATUS_GCODE_UNSUPPORTED_COMMAND); } // [Unsupported G43.x command] + mantissa = 0; // Set to zero to indicate valid non-integer G command. + break; + case 54: case 55: case 56: case 57: case 58: case 59: + // NOTE: G59.x are not supported. (But their int_values would be 60, 61, and 62.) + word_bit = MODAL_GROUP_G12; + gc_block.modal.coord_select = int_value - 54; // Shift to array indexing. + break; + case 61: + word_bit = MODAL_GROUP_G13; + if (mantissa != 0) { FAIL(STATUS_GCODE_UNSUPPORTED_COMMAND); } // [G61.1 not supported] + // gc_block.modal.control = CONTROL_MODE_EXACT_PATH; // G61 + break; + default: FAIL(STATUS_GCODE_UNSUPPORTED_COMMAND); // [Unsupported G command] + } + if (mantissa > 0) { FAIL(STATUS_GCODE_COMMAND_VALUE_NOT_INTEGER); } // [Unsupported or invalid Gxx.x command] + // Check for more than one command per modal group violations in the current block + // NOTE: Variable 'word_bit' is always assigned, if the command is valid. + if ( bit_istrue(command_words,bit(word_bit)) ) { FAIL(STATUS_GCODE_MODAL_GROUP_VIOLATION); } + command_words |= bit(word_bit); + break; + + case 'M': + + // Determine 'M' command and its modal group + if (mantissa > 0) { FAIL(STATUS_GCODE_COMMAND_VALUE_NOT_INTEGER); } // [No Mxx.x commands] + switch(int_value) { + case 0: case 1: case 2: case 30: + word_bit = MODAL_GROUP_M4; + switch(int_value) { + case 0: gc_block.modal.program_flow = PROGRAM_FLOW_PAUSED; break; // Program pause + case 1: break; // Optional stop not supported. Ignore. + default: gc_block.modal.program_flow = int_value; // Program end and reset + } + break; + case 3: case 4: case 5: + word_bit = MODAL_GROUP_M7; + switch(int_value) { + case 3: gc_block.modal.spindle = SPINDLE_ENABLE_CW; break; + case 4: gc_block.modal.spindle = SPINDLE_ENABLE_CCW; break; + case 5: gc_block.modal.spindle = SPINDLE_DISABLE; break; + } + break; + case 7: case 8: case 9: + word_bit = MODAL_GROUP_M8; + switch(int_value) { + case 7: gc_block.modal.coolant = COOLANT_MIST_ENABLE; break; + case 8: gc_block.modal.coolant = COOLANT_FLOOD_ENABLE; break; + case 9: gc_block.modal.coolant = COOLANT_DISABLE; break; + } + break; + #ifdef ENABLE_PARKING_OVERRIDE_CONTROL + case 56: + word_bit = MODAL_GROUP_M9; + gc_block.modal.override = OVERRIDE_PARKING_MOTION; + break; + #endif + default: FAIL(STATUS_GCODE_UNSUPPORTED_COMMAND); // [Unsupported M command] + } + + // Check for more than one command per modal group violations in the current block + // NOTE: Variable 'word_bit' is always assigned, if the command is valid. + if ( bit_istrue(command_words,bit(word_bit)) ) { FAIL(STATUS_GCODE_MODAL_GROUP_VIOLATION); } + command_words |= bit(word_bit); + break; + + // NOTE: All remaining letters assign values. + default: + + /* Non-Command Words: This initial parsing phase only checks for repeats of the remaining + legal g-code words and stores their value. Error-checking is performed later since some + words (I,J,K,L,P,R) have multiple connotations and/or depend on the issued commands. */ + switch(letter){ + // case 'B': // Not supported + // case 'C': // Not supported + // case 'D': // Not supported + case 'F': word_bit = WORD_F; gc_block.values.f = value; break; + // case 'H': // Not supported + case 'I': word_bit = WORD_I; gc_block.values.ijk[X_AXIS] = value; ijk_words |= (1< MAX_TOOL_NUMBER) { FAIL(STATUS_GCODE_MAX_VALUE_EXCEEDED); } + gc_block.values.t = int_value; + break; + case 'X': word_bit = WORD_X; gc_block.values.xyz[X_AXIS] = value; axis_words |= (1< MAX_LINE_NUMBER) { FAIL(STATUS_GCODE_INVALID_LINE_NUMBER); } // [Exceeds max line number] + } + // bit_false(value_words,bit(WORD_N)); // NOTE: Single-meaning value word. Set at end of error-checking. + + // Track for unused words at the end of error-checking. + // NOTE: Single-meaning value words are removed all at once at the end of error-checking, because + // they are always used when present. This was done to save a few bytes of flash. For clarity, the + // single-meaning value words may be removed as they are used. Also, axis words are treated in the + // same way. If there is an explicit/implicit axis command, XYZ words are always used and are + // are removed at the end of error-checking. + + // [1. Comments ]: MSG's NOT SUPPORTED. Comment handling performed by protocol. + + // [2. Set feed rate mode ]: G93 F word missing with G1,G2/3 active, implicitly or explicitly. Feed rate + // is not defined after switching to G94 from G93. + // NOTE: For jogging, ignore prior feed rate mode. Enforce G94 and check for required F word. + if (gc_parser_flags & GC_PARSER_JOG_MOTION) { + if (bit_isfalse(value_words,bit(WORD_F))) { FAIL(STATUS_GCODE_UNDEFINED_FEED_RATE); } + if (gc_block.modal.units == UNITS_MODE_INCHES) { gc_block.values.f *= MM_PER_INCH; } + } else { + if (gc_block.modal.feed_rate == FEED_RATE_MODE_INVERSE_TIME) { // = G93 + // NOTE: G38 can also operate in inverse time, but is undefined as an error. Missing F word check added here. + if (axis_command == AXIS_COMMAND_MOTION_MODE) { + if ((gc_block.modal.motion != MOTION_MODE_NONE) && (gc_block.modal.motion != MOTION_MODE_SEEK)) { + if (bit_isfalse(value_words,bit(WORD_F))) { FAIL(STATUS_GCODE_UNDEFINED_FEED_RATE); } // [F word missing] + } + } + // NOTE: It seems redundant to check for an F word to be passed after switching from G94 to G93. We would + // accomplish the exact same thing if the feed rate value is always reset to zero and undefined after each + // inverse time block, since the commands that use this value already perform undefined checks. This would + // also allow other commands, following this switch, to execute and not error out needlessly. This code is + // combined with the above feed rate mode and the below set feed rate error-checking. + + // [3. Set feed rate ]: F is negative (done.) + // - In inverse time mode: Always implicitly zero the feed rate value before and after block completion. + // NOTE: If in G93 mode or switched into it from G94, just keep F value as initialized zero or passed F word + // value in the block. If no F word is passed with a motion command that requires a feed rate, this will error + // out in the motion modes error-checking. However, if no F word is passed with NO motion command that requires + // a feed rate, we simply move on and the state feed rate value gets updated to zero and remains undefined. + } else { // = G94 + // - In units per mm mode: If F word passed, ensure value is in mm/min, otherwise push last state value. + if (gc_state.modal.feed_rate == FEED_RATE_MODE_UNITS_PER_MIN) { // Last state is also G94 + if (bit_istrue(value_words,bit(WORD_F))) { + if (gc_block.modal.units == UNITS_MODE_INCHES) { gc_block.values.f *= MM_PER_INCH; } + } else { + gc_block.values.f = gc_state.feed_rate; // Push last state feed rate + } + } // Else, switching to G94 from G93, so don't push last state feed rate. Its undefined or the passed F word value. + } + } + // bit_false(value_words,bit(WORD_F)); // NOTE: Single-meaning value word. Set at end of error-checking. + + // [4. Set spindle speed ]: S is negative (done.) + if (bit_isfalse(value_words,bit(WORD_S))) { gc_block.values.s = gc_state.spindle_speed; } + // bit_false(value_words,bit(WORD_S)); // NOTE: Single-meaning value word. Set at end of error-checking. + + // [5. Select tool ]: NOT SUPPORTED. Only tracks value. T is negative (done.) Not an integer. Greater than max tool value. + // bit_false(value_words,bit(WORD_T)); // NOTE: Single-meaning value word. Set at end of error-checking. + + // [6. Change tool ]: N/A + // [7. Spindle control ]: N/A + // [8. Coolant control ]: N/A + // [9. Override control ]: Not supported except for a Grbl-only parking motion override control. + #ifdef ENABLE_PARKING_OVERRIDE_CONTROL + if (bit_istrue(command_words,bit(MODAL_GROUP_M9))) { // Already set as enabled in parser. + if (bit_istrue(value_words,bit(WORD_P))) { + if (gc_block.values.p == 0.0) { gc_block.modal.override = OVERRIDE_DISABLED; } + bit_false(value_words,bit(WORD_P)); + } + } + #endif + + // [10. Dwell ]: P value missing. P is negative (done.) NOTE: See below. + if (gc_block.non_modal_command == NON_MODAL_DWELL) { + if (bit_isfalse(value_words,bit(WORD_P))) { FAIL(STATUS_GCODE_VALUE_WORD_MISSING); } // [P word missing] + bit_false(value_words,bit(WORD_P)); + } + + // [11. Set active plane ]: N/A + switch (gc_block.modal.plane_select) { + case PLANE_SELECT_XY: + axis_0 = X_AXIS; + axis_1 = Y_AXIS; + axis_linear = Z_AXIS; + break; + case PLANE_SELECT_ZX: + axis_0 = Z_AXIS; + axis_1 = X_AXIS; + axis_linear = Y_AXIS; + break; + default: // case PLANE_SELECT_YZ: + axis_0 = Y_AXIS; + axis_1 = Z_AXIS; + axis_linear = X_AXIS; + } + + // [12. Set length units ]: N/A + // Pre-convert XYZ coordinate values to millimeters, if applicable. + uint8_t idx; + if (gc_block.modal.units == UNITS_MODE_INCHES) { + for (idx=0; idx N_COORDINATE_SYSTEM) { FAIL(STATUS_GCODE_UNSUPPORTED_COORD_SYS); } // [Greater than N sys] + if (gc_state.modal.coord_select != gc_block.modal.coord_select) { + if (!(settings_read_coord_data(gc_block.modal.coord_select,block_coord_system))) { FAIL(STATUS_SETTING_READ_FAIL); } + } + } + + // [16. Set path control mode ]: N/A. Only G61. G61.1 and G64 NOT SUPPORTED. + // [17. Set distance mode ]: N/A. Only G91.1. G90.1 NOT SUPPORTED. + // [18. Set retract mode ]: NOT SUPPORTED. + + // [19. Remaining non-modal actions ]: Check go to predefined position, set G10, or set axis offsets. + // NOTE: We need to separate the non-modal commands that are axis word-using (G10/G28/G30/G92), as these + // commands all treat axis words differently. G10 as absolute offsets or computes current position as + // the axis value, G92 similarly to G10 L20, and G28/30 as an intermediate target position that observes + // all the current coordinate system and G92 offsets. + switch (gc_block.non_modal_command) { + case NON_MODAL_SET_COORDINATE_DATA: + // [G10 Errors]: L missing and is not 2 or 20. P word missing. (Negative P value done.) + // [G10 L2 Errors]: R word NOT SUPPORTED. P value not 0 to nCoordSys(max 9). Axis words missing. + // [G10 L20 Errors]: P must be 0 to nCoordSys(max 9). Axis words missing. + if (!axis_words) { FAIL(STATUS_GCODE_NO_AXIS_WORDS) }; // [No axis words] + if (bit_isfalse(value_words,((1< N_COORDINATE_SYSTEM) { FAIL(STATUS_GCODE_UNSUPPORTED_COORD_SYS); } // [Greater than N sys] + if (gc_block.values.l != 20) { + if (gc_block.values.l == 2) { + if (bit_istrue(value_words,bit(WORD_R))) { FAIL(STATUS_GCODE_UNSUPPORTED_COMMAND); } // [G10 L2 R not supported] + } else { FAIL(STATUS_GCODE_UNSUPPORTED_COMMAND); } // [Unsupported L] + } + bit_false(value_words,(bit(WORD_L)|bit(WORD_P))); + + // Determine coordinate system to change and try to load from EEPROM. + if (coord_select > 0) { coord_select--; } // Adjust P1-P6 index to EEPROM coordinate data indexing. + else { coord_select = gc_block.modal.coord_select; } // Index P0 as the active coordinate system + + // NOTE: Store parameter data in IJK values. By rule, they are not in use with this command. + if (!settings_read_coord_data(coord_select,gc_block.values.ijk)) { FAIL(STATUS_SETTING_READ_FAIL); } // [EEPROM read fail] + + // Pre-calculate the coordinate data changes. + for (idx=0; idx WCS = MPos - G92 - TLO - WPos + gc_block.values.ijk[idx] = gc_state.position[idx]-gc_state.coord_offset[idx]-gc_block.values.xyz[idx]; + if (idx == TOOL_LENGTH_OFFSET_AXIS) { gc_block.values.ijk[idx] -= gc_state.tool_length_offset; } + } else { + // L2: Update coordinate system axis to programmed value. + gc_block.values.ijk[idx] = gc_block.values.xyz[idx]; + } + } // Else, keep current stored value. + } + break; + case NON_MODAL_SET_COORDINATE_OFFSET: + // [G92 Errors]: No axis words. + if (!axis_words) { FAIL(STATUS_GCODE_NO_AXIS_WORDS); } // [No axis words] + + // Update axes defined only in block. Offsets current system to defined value. Does not update when + // active coordinate system is selected, but is still active unless G92.1 disables it. + for (idx=0; idx G92 = MPos - WCS - TLO - WPos + gc_block.values.xyz[idx] = gc_state.position[idx]-block_coord_system[idx]-gc_block.values.xyz[idx]; + if (idx == TOOL_LENGTH_OFFSET_AXIS) { gc_block.values.xyz[idx] -= gc_state.tool_length_offset; } + } else { + gc_block.values.xyz[idx] = gc_state.coord_offset[idx]; + } + } + break; + + default: + + // At this point, the rest of the explicit axis commands treat the axis values as the traditional + // target position with the coordinate system offsets, G92 offsets, absolute override, and distance + // modes applied. This includes the motion mode commands. We can now pre-compute the target position. + // NOTE: Tool offsets may be appended to these conversions when/if this feature is added. + if (axis_command != AXIS_COMMAND_TOOL_LENGTH_OFFSET ) { // TLO block any axis command. + if (axis_words) { + for (idx=0; idx C -----------------+--------------- T <- [x,y] + | <------ d/2 ---->| + + C - Current position + T - Target position + O - center of circle that pass through both C and T + d - distance from C to T + r - designated radius + h - distance from center of CT to O + + Expanding the equations: + + d -> sqrt(x^2 + y^2) + h -> sqrt(4 * r^2 - x^2 - y^2)/2 + i -> (x - (y * sqrt(4 * r^2 - x^2 - y^2)) / sqrt(x^2 + y^2)) / 2 + j -> (y + (x * sqrt(4 * r^2 - x^2 - y^2)) / sqrt(x^2 + y^2)) / 2 + + Which can be written: + + i -> (x - (y * sqrt(4 * r^2 - x^2 - y^2))/sqrt(x^2 + y^2))/2 + j -> (y + (x * sqrt(4 * r^2 - x^2 - y^2))/sqrt(x^2 + y^2))/2 + + Which we for size and speed reasons optimize to: + + h_x2_div_d = sqrt(4 * r^2 - x^2 - y^2)/sqrt(x^2 + y^2) + i = (x - (y * h_x2_div_d))/2 + j = (y + (x * h_x2_div_d))/2 + */ + + // First, use h_x2_div_d to compute 4*h^2 to check if it is negative or r is smaller + // than d. If so, the sqrt of a negative number is complex and error out. + float h_x2_div_d = 4.0 * gc_block.values.r*gc_block.values.r - x*x - y*y; + + if (h_x2_div_d < 0) { FAIL(STATUS_GCODE_ARC_RADIUS_ERROR); } // [Arc radius error] + + // Finish computing h_x2_div_d. + h_x2_div_d = -sqrt(h_x2_div_d)/hypot_f(x,y); // == -(h * 2 / d) + // Invert the sign of h_x2_div_d if the circle is counter clockwise (see sketch below) + if (gc_block.modal.motion == MOTION_MODE_CCW_ARC) { h_x2_div_d = -h_x2_div_d; } + + /* The counter clockwise circle lies to the left of the target direction. When offset is positive, + the left hand circle will be generated - when it is negative the right hand circle is generated. + + T <-- Target position + + ^ + Clockwise circles with this center | Clockwise circles with this center will have + will have > 180 deg of angular travel | < 180 deg of angular travel, which is a good thing! + \ | / + center of arc when h_x2_div_d is positive -> x <----- | -----> x <- center of arc when h_x2_div_d is negative + | + | + + C <-- Current position + */ + // Negative R is g-code-alese for "I want a circle with more than 180 degrees of travel" (go figure!), + // even though it is advised against ever generating such circles in a single line of g-code. By + // inverting the sign of h_x2_div_d the center of the circles is placed on the opposite side of the line of + // travel and thus we get the unadvisably long arcs as prescribed. + if (gc_block.values.r < 0) { + h_x2_div_d = -h_x2_div_d; + gc_block.values.r = -gc_block.values.r; // Finished with r. Set to positive for mc_arc + } + // Complete the operation by calculating the actual center of the arc + gc_block.values.ijk[axis_0] = 0.5*(x-(y*h_x2_div_d)); + gc_block.values.ijk[axis_1] = 0.5*(y+(x*h_x2_div_d)); + + } else { // Arc Center Format Offset Mode + if (!(ijk_words & (bit(axis_0)|bit(axis_1)))) { FAIL(STATUS_GCODE_NO_OFFSETS_IN_PLANE); } // [No offsets in plane] + bit_false(value_words,(bit(WORD_I)|bit(WORD_J)|bit(WORD_K))); + + // Convert IJK values to proper units. + if (gc_block.modal.units == UNITS_MODE_INCHES) { + for (idx=0; idx 0.005) { + if (delta_r > 0.5) { FAIL(STATUS_GCODE_INVALID_TARGET); } // [Arc definition error] > 0.5mm + if (delta_r > (0.001*gc_block.values.r)) { FAIL(STATUS_GCODE_INVALID_TARGET); } // [Arc definition error] > 0.005mm AND 0.1% radius + } + } + break; + case MOTION_MODE_PROBE_TOWARD_NO_ERROR: case MOTION_MODE_PROBE_AWAY_NO_ERROR: + gc_parser_flags |= GC_PARSER_PROBE_IS_NO_ERROR; // No break intentional. + case MOTION_MODE_PROBE_TOWARD: case MOTION_MODE_PROBE_AWAY: + if ((gc_block.modal.motion == MOTION_MODE_PROBE_AWAY) || + (gc_block.modal.motion == MOTION_MODE_PROBE_AWAY_NO_ERROR)) { gc_parser_flags |= GC_PARSER_PROBE_IS_AWAY; } + // [G38 Errors]: Target is same current. No axis words. Cutter compensation is enabled. Feed rate + // is undefined. Probe is triggered. NOTE: Probe check moved to probe cycle. Instead of returning + // an error, it issues an alarm to prevent further motion to the probe. It's also done there to + // allow the planner buffer to empty and move off the probe trigger before another probing cycle. + if (!axis_words) { FAIL(STATUS_GCODE_NO_AXIS_WORDS); } // [No axis words] + if (isequal_position_vector(gc_state.position, gc_block.values.xyz)) { FAIL(STATUS_GCODE_INVALID_TARGET); } // [Invalid target] + break; + } + } + } + + // [21. Program flow ]: No error checks required. + + // [0. Non-specific error-checks]: Complete unused value words check, i.e. IJK used when in arc + // radius mode, or axis words that aren't used in the block. + if (gc_parser_flags & GC_PARSER_JOG_MOTION) { + // Jogging only uses the F feed rate and XYZ value words. N is valid, but S and T are invalid. + bit_false(value_words,(bit(WORD_N)|bit(WORD_F))); + } else { + bit_false(value_words,(bit(WORD_N)|bit(WORD_F)|bit(WORD_S)|bit(WORD_T))); // Remove single-meaning value words. + } + if (axis_command) { bit_false(value_words,(bit(WORD_X)|bit(WORD_Y)|bit(WORD_Z) + #ifdef A_AXIS_ENABLE + |bit(WORD_A) + #endif + ));} // Remove axis words. + if (value_words) { FAIL(STATUS_GCODE_UNUSED_WORDS); } // [Unused words] + + /* ------------------------------------------------------------------------------------- + STEP 4: EXECUTE!! + Assumes that all error-checking has been completed and no failure modes exist. We just + need to update the state and execute the block according to the order-of-execution. + */ + + // Initialize planner data struct for motion blocks. + plan_line_data_t plan_data; + plan_line_data_t *pl_data = &plan_data; + memset(pl_data,0,sizeof(plan_line_data_t)); // Zero pl_data struct + + // Intercept jog commands and complete error checking for valid jog commands and execute. + // NOTE: G-code parser state is not updated, except the position to ensure sequential jog + // targets are computed correctly. The final parser position after a jog is updated in + // protocol_execute_realtime() when jogging completes or is canceled. + if (gc_parser_flags & GC_PARSER_JOG_MOTION) { + // Only distance and unit modal commands and G53 absolute override command are allowed. + // NOTE: Feed rate word and axis word checks have already been performed in STEP 3. + if (command_words & ~(bit(MODAL_GROUP_G3) | bit(MODAL_GROUP_G6 | bit(MODAL_GROUP_G0))) ) { FAIL(STATUS_INVALID_JOG_COMMAND) }; + if (!(gc_block.non_modal_command == NON_MODAL_ABSOLUTE_OVERRIDE || gc_block.non_modal_command == NON_MODAL_NO_ACTION)) { FAIL(STATUS_INVALID_JOG_COMMAND); } + + // Initialize planner data to current spindle and coolant modal state. + pl_data->spindle_speed = gc_state.spindle_speed; + plan_data.condition = (gc_state.modal.spindle | gc_state.modal.coolant); + + uint8_t status = jog_execute(&plan_data, &gc_block); + if (status == STATUS_OK) { memcpy(gc_state.position, gc_block.values.xyz, sizeof(gc_block.values.xyz)); } + return(status); + } + + // If in laser mode, setup laser power based on current and past parser conditions. + if (bit_istrue(settings.flags,BITFLAG_LASER_MODE)) { + if ( !((gc_block.modal.motion == MOTION_MODE_LINEAR) || (gc_block.modal.motion == MOTION_MODE_CW_ARC) + || (gc_block.modal.motion == MOTION_MODE_CCW_ARC)) ) { + gc_parser_flags |= GC_PARSER_LASER_DISABLE; + } + + // Any motion mode with axis words is allowed to be passed from a spindle speed update. + // NOTE: G1 and G0 without axis words sets axis_command to none. G28/30 are intentionally omitted. + // TODO: Check sync conditions for M3 enabled motions that don't enter the planner. (zero length). + if (axis_words && (axis_command == AXIS_COMMAND_MOTION_MODE)) { + gc_parser_flags |= GC_PARSER_LASER_ISMOTION; + } else { + // M3 constant power laser requires planner syncs to update the laser when changing between + // a G1/2/3 motion mode state and vice versa when there is no motion in the line. + if (gc_state.modal.spindle == SPINDLE_ENABLE_CW) { + if ((gc_state.modal.motion == MOTION_MODE_LINEAR) || (gc_state.modal.motion == MOTION_MODE_CW_ARC) + || (gc_state.modal.motion == MOTION_MODE_CCW_ARC)) { + if (bit_istrue(gc_parser_flags,GC_PARSER_LASER_DISABLE)) { + gc_parser_flags |= GC_PARSER_LASER_FORCE_SYNC; // Change from G1/2/3 motion mode. + } + } else { + // When changing to a G1 motion mode without axis words from a non-G1/2/3 motion mode. + if (bit_isfalse(gc_parser_flags,GC_PARSER_LASER_DISABLE)) { + gc_parser_flags |= GC_PARSER_LASER_FORCE_SYNC; + } + } + } + } + } + + // [0. Non-specific/common error-checks and miscellaneous setup]: + // NOTE: If no line number is present, the value is zero. + gc_state.line_number = gc_block.values.n; + pl_data->line_number = gc_state.line_number; // Record data for planner use. + + // [1. Comments feedback ]: NOT SUPPORTED + + // [2. Set feed rate mode ]: + gc_state.modal.feed_rate = gc_block.modal.feed_rate; + if (gc_state.modal.feed_rate) { pl_data->condition |= PL_COND_FLAG_INVERSE_TIME; } // Set condition flag for planner use. + + // [3. Set feed rate ]: + gc_state.feed_rate = gc_block.values.f; // Always copy this value. See feed rate error-checking. + pl_data->feed_rate = gc_state.feed_rate; // Record data for planner use. + + // [4. Set spindle speed ]: + if ((gc_state.spindle_speed != gc_block.values.s) || bit_istrue(gc_parser_flags,GC_PARSER_LASER_FORCE_SYNC)) { + if (gc_state.modal.spindle != SPINDLE_DISABLE) { + if (bit_isfalse(gc_parser_flags,GC_PARSER_LASER_ISMOTION)) { + if (bit_istrue(gc_parser_flags,GC_PARSER_LASER_DISABLE)) { + spindle_sync(gc_state.modal.spindle, 0.0); + } else { spindle_sync(gc_state.modal.spindle, gc_block.values.s); } + } + } + gc_state.spindle_speed = gc_block.values.s; // Update spindle speed state. + } + // NOTE: Pass zero spindle speed for all restricted laser motions. + if (bit_isfalse(gc_parser_flags,GC_PARSER_LASER_DISABLE)) { + pl_data->spindle_speed = gc_state.spindle_speed; // Record data for planner use. + } // else { pl_data->spindle_speed = 0.0; } // Initialized as zero already. + + // [5. Select tool ]: NOT SUPPORTED. Only tracks tool value. + gc_state.tool = gc_block.values.t; + + // [6. Change tool ]: NOT SUPPORTED + + // [7. Spindle control ]: + if (gc_state.modal.spindle != gc_block.modal.spindle) { + // Update spindle control and apply spindle speed when enabling it in this block. + // NOTE: All spindle state changes are synced, even in laser mode. Also, pl_data, + // rather than gc_state, is used to manage laser state for non-laser motions. + spindle_sync(gc_block.modal.spindle, pl_data->spindle_speed); + gc_state.modal.spindle = gc_block.modal.spindle; + } + pl_data->condition |= gc_state.modal.spindle; // Set condition flag for planner use. + + // [8. Coolant control ]: + if (gc_state.modal.coolant != gc_block.modal.coolant) { + // NOTE: Coolant M-codes are modal. Only one command per line is allowed. But, multiple states + // can exist at the same time, while coolant disable clears all states. + coolant_sync(gc_block.modal.coolant); + if (gc_block.modal.coolant == COOLANT_DISABLE) { gc_state.modal.coolant = COOLANT_DISABLE; } + else { gc_state.modal.coolant |= gc_block.modal.coolant; } + } + pl_data->condition |= gc_state.modal.coolant; // Set condition flag for planner use. + + // [9. Override control ]: NOT SUPPORTED. Always enabled. Except for a Grbl-only parking control. + #ifdef ENABLE_PARKING_OVERRIDE_CONTROL + if (gc_state.modal.override != gc_block.modal.override) { + gc_state.modal.override = gc_block.modal.override; + mc_override_ctrl_update(gc_state.modal.override); + } + #endif + + // [10. Dwell ]: + if (gc_block.non_modal_command == NON_MODAL_DWELL) { mc_dwell(gc_block.values.p); } + + // [11. Set active plane ]: + gc_state.modal.plane_select = gc_block.modal.plane_select; + + // [12. Set length units ]: + gc_state.modal.units = gc_block.modal.units; + + // [13. Cutter radius compensation ]: G41/42 NOT SUPPORTED + // gc_state.modal.cutter_comp = gc_block.modal.cutter_comp; // NOTE: Not needed since always disabled. + + // [14. Cutter length compensation ]: G43.1 and G49 supported. G43 NOT SUPPORTED. + // NOTE: If G43 were supported, its operation wouldn't be any different from G43.1 in terms + // of execution. The error-checking step would simply load the offset value into the correct + // axis of the block XYZ value array. + if (axis_command == AXIS_COMMAND_TOOL_LENGTH_OFFSET ) { // Indicates a change. + gc_state.modal.tool_length = gc_block.modal.tool_length; + if (gc_state.modal.tool_length == TOOL_LENGTH_OFFSET_CANCEL) { // G49 + gc_block.values.xyz[TOOL_LENGTH_OFFSET_AXIS] = 0.0; + } // else G43.1 + if ( gc_state.tool_length_offset != gc_block.values.xyz[TOOL_LENGTH_OFFSET_AXIS] ) { + gc_state.tool_length_offset = gc_block.values.xyz[TOOL_LENGTH_OFFSET_AXIS]; + system_flag_wco_change(); + } + } + + // [15. Coordinate system selection ]: + if (gc_state.modal.coord_select != gc_block.modal.coord_select) { + gc_state.modal.coord_select = gc_block.modal.coord_select; + memcpy(gc_state.coord_system,block_coord_system,N_AXIS*sizeof(float)); + system_flag_wco_change(); + } + + // [16. Set path control mode ]: G61.1/G64 NOT SUPPORTED + // gc_state.modal.control = gc_block.modal.control; // NOTE: Always default. + + // [17. Set distance mode ]: + gc_state.modal.distance = gc_block.modal.distance; + + // [18. Set retract mode ]: NOT SUPPORTED + + // [19. Go to predefined position, Set G10, or Set axis offsets ]: + switch(gc_block.non_modal_command) { + case NON_MODAL_SET_COORDINATE_DATA: + settings_write_coord_data(coord_select,gc_block.values.ijk); + // Update system coordinate system if currently active. + if (gc_state.modal.coord_select == coord_select) { + memcpy(gc_state.coord_system,gc_block.values.ijk,N_AXIS*sizeof(float)); + system_flag_wco_change(); + } + break; + case NON_MODAL_GO_HOME_0: case NON_MODAL_GO_HOME_1: + // Move to intermediate position before going home. Obeys current coordinate system and offsets + // and absolute and incremental modes. + pl_data->condition |= PL_COND_FLAG_RAPID_MOTION; // Set rapid motion condition flag. + if (axis_command) { mc_line(gc_block.values.xyz, pl_data); } + mc_line(gc_block.values.ijk, pl_data); + memcpy(gc_state.position, gc_block.values.ijk, N_AXIS*sizeof(float)); + break; + case NON_MODAL_SET_HOME_0: + settings_write_coord_data(SETTING_INDEX_G28,gc_state.position); + break; + case NON_MODAL_SET_HOME_1: + settings_write_coord_data(SETTING_INDEX_G30,gc_state.position); + break; + case NON_MODAL_SET_COORDINATE_OFFSET: + memcpy(gc_state.coord_offset,gc_block.values.xyz,sizeof(gc_block.values.xyz)); + system_flag_wco_change(); + break; + case NON_MODAL_RESET_COORDINATE_OFFSET: + clear_vector(gc_state.coord_offset); // Disable G92 offsets by zeroing offset vector. + system_flag_wco_change(); + break; + } + + + // [20. Motion modes ]: + // NOTE: Commands G10,G28,G30,G92 lock out and prevent axis words from use in motion modes. + // Enter motion modes only if there are axis words or a motion mode command word in the block. + gc_state.modal.motion = gc_block.modal.motion; + if (gc_state.modal.motion != MOTION_MODE_NONE) { + if (axis_command == AXIS_COMMAND_MOTION_MODE) { + uint8_t gc_update_pos = GC_UPDATE_POS_TARGET; + if (gc_state.modal.motion == MOTION_MODE_LINEAR) { + mc_line(gc_block.values.xyz, pl_data); + } else if (gc_state.modal.motion == MOTION_MODE_SEEK) { + pl_data->condition |= PL_COND_FLAG_RAPID_MOTION; // Set rapid motion condition flag. + mc_line(gc_block.values.xyz, pl_data); + } else if ((gc_state.modal.motion == MOTION_MODE_CW_ARC) || (gc_state.modal.motion == MOTION_MODE_CCW_ARC)) { + mc_arc(gc_block.values.xyz, pl_data, gc_state.position, gc_block.values.ijk, gc_block.values.r, + axis_0, axis_1, axis_linear, + #ifdef A_AXIS_ENABLE + // axis_a, + #endif + bit_istrue(gc_parser_flags,GC_PARSER_ARC_IS_CLOCKWISE)); + } else { + // NOTE: gc_block.values.xyz is returned from mc_probe_cycle with the updated position value. So + // upon a successful probing cycle, the machine position and the returned value should be the same. + #ifndef ALLOW_FEED_OVERRIDE_DURING_PROBE_CYCLES + pl_data->condition |= PL_COND_FLAG_NO_FEED_OVERRIDE; + #endif + gc_update_pos = mc_probe_cycle(gc_block.values.xyz, pl_data, gc_parser_flags); + } + + // As far as the parser is concerned, the position is now == target. In reality the + // motion control system might still be processing the action and the real tool position + // in any intermediate location. + if (gc_update_pos == GC_UPDATE_POS_TARGET) { + memcpy(gc_state.position, gc_block.values.xyz, sizeof(gc_block.values.xyz)); // gc_state.position[] = gc_block.values.xyz[] + } else if (gc_update_pos == GC_UPDATE_POS_SYSTEM) { + gc_sync_position(); // gc_state.position[] = sys_position + } // == GC_UPDATE_POS_NONE + } + } + + // [21. Program flow ]: + // M0,M1,M2,M30: Perform non-running program flow actions. During a program pause, the buffer may + // refill and can only be resumed by the cycle start run-time command. + gc_state.modal.program_flow = gc_block.modal.program_flow; + if (gc_state.modal.program_flow) { + protocol_buffer_synchronize(); // Sync and finish all remaining buffered motions before moving on. + if (gc_state.modal.program_flow == PROGRAM_FLOW_PAUSED) { + if (sys.state != STATE_CHECK_MODE) { + system_set_exec_state_flag(EXEC_FEED_HOLD); // Use feed hold for program pause. + protocol_execute_realtime(); // Execute suspend. + } + } else { // == PROGRAM_FLOW_COMPLETED + // Upon program complete, only a subset of g-codes reset to certain defaults, according to + // LinuxCNC's program end descriptions and testing. Only modal groups [G-code 1,2,3,5,7,12] + // and [M-code 7,8,9] reset to [G1,G17,G90,G94,G40,G54,M5,M9,M48]. The remaining modal groups + // [G-code 4,6,8,10,13,14,15] and [M-code 4,5,6] and the modal words [F,S,T,H] do not reset. + gc_state.modal.motion = MOTION_MODE_LINEAR; + gc_state.modal.plane_select = PLANE_SELECT_XY; + gc_state.modal.distance = DISTANCE_MODE_ABSOLUTE; + gc_state.modal.feed_rate = FEED_RATE_MODE_UNITS_PER_MIN; + // gc_state.modal.cutter_comp = CUTTER_COMP_DISABLE; // Not supported. + gc_state.modal.coord_select = 0; // G54 + gc_state.modal.spindle = SPINDLE_DISABLE; + gc_state.modal.coolant = COOLANT_DISABLE; + #ifdef ENABLE_PARKING_OVERRIDE_CONTROL + #ifdef DEACTIVATE_PARKING_UPON_INIT + gc_state.modal.override = OVERRIDE_DISABLED; + #else + gc_state.modal.override = OVERRIDE_PARKING_MOTION; + #endif + #endif + + #ifdef RESTORE_OVERRIDES_AFTER_PROGRAM_END + sys.f_override = DEFAULT_FEED_OVERRIDE; + sys.r_override = DEFAULT_RAPID_OVERRIDE; + sys.spindle_speed_ovr = DEFAULT_SPINDLE_SPEED_OVERRIDE; + #endif + + // Execute coordinate change and spindle/coolant stop. + if (sys.state != STATE_CHECK_MODE) { + if (!(settings_read_coord_data(gc_state.modal.coord_select,gc_state.coord_system))) { FAIL(STATUS_SETTING_READ_FAIL); } + system_flag_wco_change(); // Set to refresh immediately just in case something altered. + spindle_set_state(SPINDLE_DISABLE,0.0); + coolant_set_state(COOLANT_DISABLE); + } + report_feedback_message(MESSAGE_PROGRAM_END); + } + gc_state.modal.program_flow = PROGRAM_FLOW_RUNNING; // Reset program flow. + } + + // TODO: % to denote start of program. + + return(STATUS_OK); +} + + +/* + Not supported: + + - Canned cycles + - Tool radius compensation + - A,B,C-axes + - Evaluation of expressions + - Variables + - Override control (TBD) + - Tool changes + - Switches + + (*) Indicates optional parameter, enabled through config.h and re-compile + group 0 = {G92.2, G92.3} (Non modal: Cancel and re-enable G92 offsets) + group 1 = {G81 - G89} (Motion modes: Canned cycles) + group 4 = {M1} (Optional stop, ignored) + group 6 = {M6} (Tool change) + group 7 = {G41, G42} cutter radius compensation (G40 is supported) + group 8 = {G43} tool length offset (G43.1/G49 are supported) + group 8 = {M7*} enable mist coolant (* Compile-option) + group 9 = {M48, M49, M56*} enable/disable override switches (* Compile-option) + group 10 = {G98, G99} return mode canned cycles + group 13 = {G61.1, G64} path control mode (G61 is supported) +*/ diff --git a/targets/locations_fping_stats.json b/targets/locations_fping_stats.json new file mode 100644 index 0000000000..b1148770ae --- /dev/null +++ b/targets/locations_fping_stats.json @@ -0,0 +1,197 @@ +[ + { + "term": "stats", + "file": "fping.c", + "locations": [ + { + "line": 328, + "column": 11, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 352, + "column": 31, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 377, + "column": 23, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 380, + "column": 19, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 395, + "column": 6, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 531, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 705, + "column": 13, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 955, + "column": 13, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 956, + "column": 32, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1315, + "column": 13, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1548, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1551, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1554, + "column": 9, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1555, + "column": 22, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1577, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1588, + "column": 23, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1774, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1785, + "column": 19, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2011, + "column": 4, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 2017, + "column": 6, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2063, + "column": 4, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 2066, + "column": 6, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2358, + "column": 15, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 2386, + "column": 15, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 2387, + "column": 5, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2388, + "column": 22, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 2939, + "column": 28, + "meta": { + "Kind": "Identifier" + } + } + ] + } +] \ No newline at end of file diff --git a/targets/locations_inotify_stats.json b/targets/locations_inotify_stats.json new file mode 100644 index 0000000000..4604637ed0 --- /dev/null +++ b/targets/locations_inotify_stats.json @@ -0,0 +1,287 @@ +[ + { + "term": "stats", + "file": "inotifytools.c", + "locations": [ + { + "line": 144, + "column": 20, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 156, + "column": 13, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 294, + "column": 10, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 333, + "column": 10, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 351, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 425, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 428, + "column": 27, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 429, + "column": 14, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 430, + "column": 25, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 448, + "column": 10, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1137, + "column": 15, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1138, + "column": 10, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1410, + "column": 13, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1508, + "column": 28, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1511, + "column": 38, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1517, + "column": 58, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1521, + "column": 15, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1533, + "column": 28, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1540, + "column": 30, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1544, + "column": 15, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1581, + "column": 28, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1584, + "column": 40, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1590, + "column": 52, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1597, + "column": 22, + "meta": { + "Kind": "Identifier" + } + } + ] + }, + { + "term": "stat", + "file": "inotifytools.c", + "locations": [ + { + "line": 1335, + "column": 20, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1342, + "column": 20, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1352, + "column": 20, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1353, + "column": 20, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1472, + "column": 20, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1520, + "column": 20, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1525, + "column": 20, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1543, + "column": 20, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1597, + "column": 20, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1599, + "column": 20, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1621, + "column": 20, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1623, + "column": 20, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1629, + "column": 20, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2124, + "column": 20, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2125, + "column": 20, + "meta": { + "Kind": "Identifier" + } + } + ] + } +] \ No newline at end of file diff --git a/targets/locations_inotify_stats_nostat.json b/targets/locations_inotify_stats_nostat.json new file mode 100644 index 0000000000..9e2b062992 --- /dev/null +++ b/targets/locations_inotify_stats_nostat.json @@ -0,0 +1,176 @@ +[ + { + "term": "stats", + "file": "inotifytools.c", + "locations": [ + { + "line": 144, + "column": 20, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 156, + "column": 13, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 294, + "column": 10, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 333, + "column": 10, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 351, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 425, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 428, + "column": 27, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 429, + "column": 14, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 430, + "column": 25, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 448, + "column": 10, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1137, + "column": 15, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1138, + "column": 10, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1410, + "column": 13, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1508, + "column": 28, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1511, + "column": 38, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1517, + "column": 58, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1521, + "column": 15, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1533, + "column": 28, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1540, + "column": 30, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1544, + "column": 15, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1581, + "column": 28, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1584, + "column": 40, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1590, + "column": 52, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1597, + "column": 22, + "meta": { + "Kind": "Identifier" + } + } + ] + } +] \ No newline at end of file diff --git a/targets/locations_json.json b/targets/locations_json.json new file mode 100644 index 0000000000..4dc520273d --- /dev/null +++ b/targets/locations_json.json @@ -0,0 +1,1526 @@ +[ + { + "term": "axis", + "file": "ex.c", + "locations": [ + { + "line": 3, + "column": 7, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 4, + "column": 7, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 15, + "column": 3, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 18, + "column": 5, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 18, + "column": 20, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 19, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 20, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 22, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 28, + "column": 7, + "meta": { + "Kind": "Identifier" + } + } + ] + }, + { + "term": "axis", + "file": "gcode.c", + "locations": [ + { + "line": 30, + "column": 9, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 31, + "column": 9, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 32, + "column": 9, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 33, + "column": 9, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 78, + "column": 11, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 78, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 79, + "column": 11, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 79, + "column": 19, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 79, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 80, + "column": 10, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 81, + "column": 13, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 85, + "column": 3, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 86, + "column": 11, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 149, + "column": 13, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 151, + "column": 19, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 151, + "column": 40, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 151, + "column": 79, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 152, + "column": 15, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 152, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 166, + "column": 13, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 167, + "column": 17, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 167, + "column": 38, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 167, + "column": 77, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 168, + "column": 13, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 168, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 213, + "column": 13, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 214, + "column": 13, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 215, + "column": 17, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 215, + "column": 38, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 215, + "column": 77, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 216, + "column": 13, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 216, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 299, + "column": 59, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 299, + "column": 93, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 300, + "column": 59, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 300, + "column": 93, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 301, + "column": 59, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 301, + "column": 93, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 313, + "column": 59, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 313, + "column": 76, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 313, + "column": 94, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 314, + "column": 59, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 314, + "column": 76, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 314, + "column": 94, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 315, + "column": 59, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 315, + "column": 76, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 315, + "column": 94, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 316, + "column": 18, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 317, + "column": 61, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 317, + "column": 78, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 317, + "column": 96, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 319, + "column": 13, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 355, + "column": 3, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 368, + "column": 3, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 369, + "column": 3, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 370, + "column": 7, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 371, + "column": 10, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 371, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 371, + "column": 41, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 384, + "column": 3, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 385, + "column": 3, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 399, + "column": 11, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 399, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 458, + "column": 7, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 458, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 459, + "column": 7, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 459, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 460, + "column": 7, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 460, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 463, + "column": 7, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 463, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 464, + "column": 7, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 464, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 465, + "column": 7, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 465, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 468, + "column": 7, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 468, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 469, + "column": 7, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 469, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 470, + "column": 7, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 470, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 477, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 478, + "column": 22, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 492, + "column": 3, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 493, + "column": 3, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 494, + "column": 7, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 494, + "column": 23, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 496, + "column": 11, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 496, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 496, + "column": 61, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 505, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 518, + "column": 3, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 519, + "column": 3, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 520, + "column": 3, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 521, + "column": 3, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 526, + "column": 7, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 527, + "column": 7, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 528, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 528, + "column": 31, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 528, + "column": 62, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 547, + "column": 23, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 549, + "column": 24, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 551, + "column": 13, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 554, + "column": 24, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 556, + "column": 13, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 563, + "column": 7, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 564, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 564, + "column": 31, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 564, + "column": 62, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 568, + "column": 23, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 569, + "column": 24, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 572, + "column": 22, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 581, + "column": 7, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 585, + "column": 11, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 585, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 585, + "column": 63, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 586, + "column": 13, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 587, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 588, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 589, + "column": 66, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 597, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 619, + "column": 15, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 621, + "column": 29, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 622, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 625, + "column": 13, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 625, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 631, + "column": 11, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 634, + "column": 11, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 638, + "column": 11, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 648, + "column": 5, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 649, + "column": 5, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 650, + "column": 9, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 650, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 650, + "column": 62, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 652, + "column": 3, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 654, + "column": 15, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 654, + "column": 31, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 657, + "column": 7, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 658, + "column": 7, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 659, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 659, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 659, + "column": 41, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 669, + "column": 11, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 670, + "column": 11, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 671, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 671, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 671, + "column": 45, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 677, + "column": 11, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 678, + "column": 11, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 680, + "column": 11, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 683, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 683, + "column": 35, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 683, + "column": 66, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 684, + "column": 17, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 684, + "column": 35, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 684, + "column": 47, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 684, + "column": 65, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 684, + "column": 105, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 686, + "column": 11, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 688, + "column": 35, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 688, + "column": 61, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 689, + "column": 35, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 689, + "column": 61, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 780, + "column": 33, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 781, + "column": 33, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 784, + "column": 36, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 784, + "column": 48, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 789, + "column": 31, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 795, + "column": 38, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 796, + "column": 38, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 800, + "column": 61, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 800, + "column": 90, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 815, + "column": 11, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 819, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 819, + "column": 35, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 819, + "column": 66, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 829, + "column": 3, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 836, + "column": 7, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 837, + "column": 10, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 840, + "column": 8, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 860, + "column": 5, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 880, + "column": 5, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 881, + "column": 5, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 883, + "column": 9, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 883, + "column": 24, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 883, + "column": 40, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 895, + "column": 11, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 983, + "column": 3, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 984, + "column": 7, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 984, + "column": 23, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 987, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 989, + "column": 61, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 990, + "column": 57, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 998, + "column": 53, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1010, + "column": 3, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1016, + "column": 58, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1024, + "column": 11, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1026, + "column": 54, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1046, + "column": 3, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1047, + "column": 3, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1050, + "column": 9, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1050, + "column": 25, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1059, + "column": 13, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1059, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1059, + "column": 29, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1060, + "column": 20, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1061, + "column": 14, + "meta": { + "Kind": "Comment" + } + } + ] + } +] \ No newline at end of file diff --git a/targets/locations_memcached.json b/targets/locations_memcached.json new file mode 100644 index 0000000000..6c6cafe432 --- /dev/null +++ b/targets/locations_memcached.json @@ -0,0 +1,3570 @@ +[ + { + "term": "cmd", + "file": "slabs.c", + "locations": [ + { + "line": 584, + "column": 33, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 585, + "column": 72, + "meta": { + "Kind": "Identifier" + } + } + ] + }, + { + "term": "cmd", + "file": "proto_text.c", + "locations": [ + { + "line": 24, + "column": 26, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 30, + "column": 19, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 35, + "column": 53, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 77, + "column": 18, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 109, + "column": 38, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 113, + "column": 54, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 348, + "column": 31, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 353, + "column": 31, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 407, + "column": 13, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 557, + "column": 44, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 561, + "column": 42, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 575, + "column": 44, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 579, + "column": 42, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 786, + "column": 36, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 791, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1226, + "column": 36, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1230, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1234, + "column": 36, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1238, + "column": 36, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1242, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1409, + "column": 8, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1551, + "column": 32, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1774, + "column": 32, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1877, + "column": 8, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1909, + "column": 32, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1917, + "column": 32, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2122, + "column": 46, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2303, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2559, + "column": 51, + "meta": { + "Kind": "Comment" + } + } + ] + }, + { + "term": "cmd", + "file": "proto_bin.c", + "locations": [ + { + "line": 32, + "column": 15, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 101, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 107, + "column": 17, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 244, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 245, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 253, + "column": 32, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 293, + "column": 39, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 339, + "column": 20, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 362, + "column": 53, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 381, + "column": 29, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 385, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 423, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 425, + "column": 22, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 444, + "column": 36, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 457, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 458, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 459, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 460, + "column": 33, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 461, + "column": 33, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 462, + "column": 35, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 487, + "column": 36, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 490, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 503, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 549, + "column": 40, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 571, + "column": 36, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 574, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 586, + "column": 40, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 623, + "column": 18, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 624, + "column": 24, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 636, + "column": 31, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 638, + "column": 31, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 797, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 822, + "column": 24, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 836, + "column": 31, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 852, + "column": 31, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 862, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 874, + "column": 45, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 875, + "column": 20, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 909, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 911, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 914, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 917, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 920, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 923, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 926, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 929, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 932, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 935, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 938, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 941, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 944, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 947, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 950, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 956, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1093, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1095, + "column": 23, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1126, + "column": 29, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1133, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1149, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1151, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1154, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1157, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1164, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1219, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1221, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1224, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1274, + "column": 28, + "meta": { + "Kind": "Identifier" + } + } + ] + }, + { + "term": "cmd", + "file": "logger.c", + "locations": [ + { + "line": 188, + "column": 17, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 193, + "column": 24, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 196, + "column": 13, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 197, + "column": 9, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 201, + "column": 65, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 203, + "column": 45, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 679, + "column": 9, + "meta": { + "Kind": "Identifier" + } + } + ] + }, + { + "term": "cmd", + "file": "memcached.c", + "locations": [ + { + "line": 310, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 322, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 340, + "column": 38, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 343, + "column": 41, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 350, + "column": 29, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 351, + "column": 33, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 356, + "column": 74, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 503, + "column": 33, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 504, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 539, + "column": 25, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 610, + "column": 62, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 645, + "column": 8, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 654, + "column": 13, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 931, + "column": 50, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 934, + "column": 52, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1202, + "column": 36, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1222, + "column": 32, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1361, + "column": 19, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1362, + "column": 8, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1371, + "column": 38, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1553, + "column": 60, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1661, + "column": 36, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1735, + "column": 18, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1736, + "column": 18, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1737, + "column": 18, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1738, + "column": 18, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1739, + "column": 18, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1765, + "column": 23, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2104, + "column": 53, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2105, + "column": 55, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 3281, + "column": 49, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 3320, + "column": 46, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 3331, + "column": 25, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 3345, + "column": 23, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 3351, + "column": 23, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 3468, + "column": 44, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 3534, + "column": 48, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 4394, + "column": 17, + "meta": { + "Kind": "Identifier" + } + } + ] + }, + { + "term": "command", + "file": "proto_bin.c", + "locations": [ + { + "line": 24, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 51, + "column": 14, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 118, + "column": 22, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 185, + "column": 31, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 242, + "column": 34, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 550, + "column": 30, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 602, + "column": 14, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 609, + "column": 38, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 618, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 620, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 622, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 623, + "column": 31, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 645, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 821, + "column": 40, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 881, + "column": 26, + "meta": { + "Kind": "Identifier" + } + } + ] + }, + { + "term": "command", + "file": "linux_priv.c", + "locations": [ + { + "line": 162, + "column": 27, + "meta": { + "Kind": "Identifier" + } + } + ] + }, + { + "term": "command", + "file": "proto_text.c", + "locations": [ + { + "line": 15, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 23, + "column": 59, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 189, + "column": 17, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 197, + "column": 20, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 201, + "column": 10, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 202, + "column": 9, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 205, + "column": 24, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 208, + "column": 25, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 211, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 213, + "column": 13, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 249, + "column": 14, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 259, + "column": 36, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 281, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 330, + "column": 41, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 336, + "column": 24, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 346, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 361, + "column": 14, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 408, + "column": 13, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 425, + "column": 62, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 463, + "column": 32, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 475, + "column": 30, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 595, + "column": 19, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 599, + "column": 32, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 627, + "column": 45, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 638, + "column": 62, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 641, + "column": 16, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 645, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 649, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 660, + "column": 20, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 664, + "column": 41, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 671, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 675, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 683, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 685, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 695, + "column": 45, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 701, + "column": 45, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 713, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 716, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 720, + "column": 43, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 722, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 749, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 753, + "column": 41, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 843, + "column": 58, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 852, + "column": 58, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 862, + "column": 58, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 914, + "column": 58, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 963, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 974, + "column": 38, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 982, + "column": 44, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 990, + "column": 29, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 994, + "column": 44, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 997, + "column": 29, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1221, + "column": 22, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1261, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1268, + "column": 38, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1278, + "column": 44, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1286, + "column": 44, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1329, + "column": 37, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1432, + "column": 29, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1440, + "column": 38, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1450, + "column": 41, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1557, + "column": 33, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1562, + "column": 38, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1580, + "column": 41, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1600, + "column": 37, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1785, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1800, + "column": 41, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1810, + "column": 41, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1819, + "column": 45, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1825, + "column": 41, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1881, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1893, + "column": 41, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1925, + "column": 32, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1936, + "column": 41, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1975, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1989, + "column": 45, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2000, + "column": 41, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2030, + "column": 31, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2038, + "column": 41, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2047, + "column": 31, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2057, + "column": 26, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 2071, + "column": 36, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2087, + "column": 45, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2104, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2111, + "column": 43, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2116, + "column": 52, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2155, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2182, + "column": 25, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2239, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2296, + "column": 31, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2341, + "column": 29, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2345, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2350, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2351, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2359, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2370, + "column": 45, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2395, + "column": 32, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2401, + "column": 33, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2439, + "column": 56, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2473, + "column": 45, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2482, + "column": 45, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2514, + "column": 35, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2526, + "column": 20, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 2529, + "column": 22, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 2530, + "column": 39, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 2534, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2545, + "column": 45, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2548, + "column": 12, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 2558, + "column": 24, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2559, + "column": 12, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 2560, + "column": 32, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 2566, + "column": 13, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 2571, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2574, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2577, + "column": 33, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2581, + "column": 23, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 2585, + "column": 37, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2588, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2595, + "column": 24, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 2599, + "column": 25, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2602, + "column": 25, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2605, + "column": 25, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2608, + "column": 25, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2616, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2622, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2625, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2634, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2642, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2646, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2654, + "column": 32, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2662, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2666, + "column": 32, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2674, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2683, + "column": 24, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2686, + "column": 33, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 2690, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2695, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2699, + "column": 25, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2703, + "column": 22, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2707, + "column": 29, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2711, + "column": 23, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2715, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2718, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2720, + "column": 8, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 2722, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2727, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2731, + "column": 31, + "meta": { + "Kind": "Identifier" + } + } + ] + }, + { + "term": "command", + "file": "memcached.c", + "locations": [ + { + "line": 82, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 83, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 283, + "column": 23, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 602, + "column": 31, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 684, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 690, + "column": 33, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 693, + "column": 33, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 699, + "column": 29, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 702, + "column": 29, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1226, + "column": 28, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 1491, + "column": 4, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 2244, + "column": 25, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 2547, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2555, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2559, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2567, + "column": 24, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2570, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2577, + "column": 25, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2580, + "column": 25, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2625, + "column": 64, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 3333, + "column": 29, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 4077, + "column": 65, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 4091, + "column": 71, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 4107, + "column": 62, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 4123, + "column": 57, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 4125, + "column": 53, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 4173, + "column": 80, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 5007, + "column": 42, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 5035, + "column": 33, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 5036, + "column": 34, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 5090, + "column": 35, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 5091, + "column": 31, + "meta": { + "Kind": "Comment" + } + } + ] + }, + { + "term": "COMMAND", + "file": "proto_bin.c", + "locations": [ + { + "line": 184, + "column": 47, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 387, + "column": 19, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 391, + "column": 19, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 395, + "column": 19, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 399, + "column": 19, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 403, + "column": 19, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 496, + "column": 23, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 499, + "column": 23, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 580, + "column": 23, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 582, + "column": 23, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 695, + "column": 61, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 724, + "column": 61, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 889, + "column": 61, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 900, + "column": 23, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1065, + "column": 65, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1306, + "column": 23, + "meta": { + "Kind": "Identifier" + } + } + ] + }, + { + "term": "COMMAND", + "file": "proto_text.c", + "locations": [ + { + "line": 79, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 83, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 87, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 91, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 95, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 99, + "column": 21, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 158, + "column": 9, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 159, + "column": 12, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 509, + "column": 29, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 581, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 660, + "column": 40, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1244, + "column": 19, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1492, + "column": 19, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2010, + "column": 19, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2121, + "column": 18, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2360, + "column": 39, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2394, + "column": 24, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2402, + "column": 39, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2429, + "column": 46, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2470, + "column": 46, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2479, + "column": 46, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2493, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2499, + "column": 35, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2542, + "column": 23, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2561, + "column": 31, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2567, + "column": 25, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2568, + "column": 32, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2569, + "column": 24, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2597, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2600, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2603, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2606, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2613, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2617, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2620, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2623, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2630, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2631, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2639, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2643, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2651, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2659, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2663, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2671, + "column": 27, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2679, + "column": 32, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2680, + "column": 32, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2685, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2692, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2697, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2701, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2705, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2709, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2713, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2716, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2721, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2725, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2730, + "column": 30, + "meta": { + "Kind": "Identifier" + } + } + ] + }, + { + "term": "COMMAND", + "file": "memcached.c", + "locations": [ + { + "line": 962, + "column": 31, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2474, + "column": 19, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 2481, + "column": 19, + "meta": { + "Kind": "Identifier" + } + } + ] + }, + { + "term": "CMD", + "file": "proto_text.c", + "locations": [ + { + "line": 2123, + "column": 29, + "meta": { + "Kind": "Identifier" + } + } + ] + }, + { + "term": "CMD", + "file": "proto_bin.c", + "locations": [ + { + "line": 244, + "column": 50, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 245, + "column": 35, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 293, + "column": 62, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 339, + "column": 43, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 457, + "column": 51, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 458, + "column": 51, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 459, + "column": 51, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 460, + "column": 56, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 461, + "column": 56, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 462, + "column": 58, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 503, + "column": 39, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 798, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 804, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 817, + "column": 27, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 863, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 864, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 865, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 866, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 910, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 911, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 913, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 914, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 916, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 917, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 919, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 920, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 922, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 923, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 925, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 926, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 928, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 929, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 931, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 932, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 934, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 935, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 937, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 938, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 940, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 941, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 943, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 944, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 946, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 947, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 949, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 950, + "column": 34, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 957, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 964, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 971, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 980, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 981, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 982, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 989, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 990, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 991, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 992, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 999, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1006, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1007, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1014, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1015, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1022, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1029, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1038, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1045, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1046, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1053, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1054, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1055, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1056, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1057, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1093, + "column": 39, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1095, + "column": 46, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1133, + "column": 39, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1150, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1153, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1156, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1220, + "column": 30, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 1223, + "column": 30, + "meta": { + "Kind": "Identifier" + } + } + ] + }, + { + "term": "CMD", + "file": "memcached.c", + "locations": [ + { + "line": 1259, + "column": 44, + "meta": { + "Kind": "Identifier" + } + } + ] + }, + { + "term": "CMD", + "file": "logger.c", + "locations": [ + { + "line": 49, + "column": 19, + "meta": { + "Kind": "Identifier" + } + } + ] + } +] \ No newline at end of file diff --git a/targets/locations_memcached_command.json b/targets/locations_memcached_command.json new file mode 100644 index 0000000000..c2c4ef172b --- /dev/null +++ b/targets/locations_memcached_command.json @@ -0,0 +1,1719 @@ +[ + { + "term": "cmd", + "file": "proto_bin.c", + "locations": [ + { + "line": 32, + "column": 15, + "meta": {} + }, + { + "line": 101, + "column": 12, + "meta": {} + }, + { + "line": 107, + "column": 17, + "meta": {} + }, + { + "line": 244, + "column": 27, + "meta": {} + }, + { + "line": 245, + "column": 12, + "meta": {} + }, + { + "line": 253, + "column": 32, + "meta": {} + }, + { + "line": 293, + "column": 39, + "meta": {} + }, + { + "line": 339, + "column": 20, + "meta": {} + }, + { + "line": 362, + "column": 53, + "meta": {} + }, + { + "line": 381, + "column": 29, + "meta": {} + }, + { + "line": 385, + "column": 16, + "meta": {} + }, + { + "line": 423, + "column": 16, + "meta": {} + }, + { + "line": 425, + "column": 22, + "meta": {} + }, + { + "line": 444, + "column": 36, + "meta": {} + }, + { + "line": 457, + "column": 28, + "meta": {} + }, + { + "line": 458, + "column": 28, + "meta": {} + }, + { + "line": 459, + "column": 28, + "meta": {} + }, + { + "line": 460, + "column": 33, + "meta": {} + }, + { + "line": 461, + "column": 33, + "meta": {} + }, + { + "line": 462, + "column": 35, + "meta": {} + }, + { + "line": 487, + "column": 36, + "meta": {} + }, + { + "line": 490, + "column": 34, + "meta": {} + }, + { + "line": 503, + "column": 16, + "meta": {} + }, + { + "line": 549, + "column": 40, + "meta": {} + }, + { + "line": 571, + "column": 36, + "meta": {} + }, + { + "line": 574, + "column": 34, + "meta": {} + }, + { + "line": 586, + "column": 40, + "meta": {} + }, + { + "line": 623, + "column": 18, + "meta": {} + }, + { + "line": 624, + "column": 24, + "meta": {} + }, + { + "line": 636, + "column": 31, + "meta": {} + }, + { + "line": 638, + "column": 31, + "meta": {} + }, + { + "line": 797, + "column": 16, + "meta": {} + }, + { + "line": 822, + "column": 24, + "meta": {} + }, + { + "line": 836, + "column": 31, + "meta": {} + }, + { + "line": 852, + "column": 31, + "meta": {} + }, + { + "line": 862, + "column": 16, + "meta": {} + }, + { + "line": 874, + "column": 45, + "meta": {} + }, + { + "line": 875, + "column": 20, + "meta": {} + }, + { + "line": 909, + "column": 16, + "meta": {} + }, + { + "line": 911, + "column": 12, + "meta": {} + }, + { + "line": 914, + "column": 12, + "meta": {} + }, + { + "line": 917, + "column": 12, + "meta": {} + }, + { + "line": 920, + "column": 12, + "meta": {} + }, + { + "line": 923, + "column": 12, + "meta": {} + }, + { + "line": 926, + "column": 12, + "meta": {} + }, + { + "line": 929, + "column": 12, + "meta": {} + }, + { + "line": 932, + "column": 12, + "meta": {} + }, + { + "line": 935, + "column": 12, + "meta": {} + }, + { + "line": 938, + "column": 12, + "meta": {} + }, + { + "line": 941, + "column": 12, + "meta": {} + }, + { + "line": 944, + "column": 12, + "meta": {} + }, + { + "line": 947, + "column": 12, + "meta": {} + }, + { + "line": 950, + "column": 12, + "meta": {} + }, + { + "line": 956, + "column": 16, + "meta": {} + }, + { + "line": 1093, + "column": 16, + "meta": {} + }, + { + "line": 1095, + "column": 23, + "meta": {} + }, + { + "line": 1126, + "column": 29, + "meta": {} + }, + { + "line": 1133, + "column": 16, + "meta": {} + }, + { + "line": 1149, + "column": 16, + "meta": {} + }, + { + "line": 1151, + "column": 16, + "meta": {} + }, + { + "line": 1154, + "column": 16, + "meta": {} + }, + { + "line": 1157, + "column": 16, + "meta": {} + }, + { + "line": 1164, + "column": 12, + "meta": {} + }, + { + "line": 1219, + "column": 16, + "meta": {} + }, + { + "line": 1221, + "column": 16, + "meta": {} + }, + { + "line": 1224, + "column": 16, + "meta": {} + }, + { + "line": 1274, + "column": 28, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "proto_text.c", + "locations": [ + { + "line": 24, + "column": 26, + "meta": {} + }, + { + "line": 30, + "column": 19, + "meta": {} + }, + { + "line": 35, + "column": 53, + "meta": {} + }, + { + "line": 77, + "column": 18, + "meta": {} + }, + { + "line": 109, + "column": 38, + "meta": {} + }, + { + "line": 113, + "column": 54, + "meta": {} + }, + { + "line": 348, + "column": 31, + "meta": {} + }, + { + "line": 353, + "column": 31, + "meta": {} + }, + { + "line": 407, + "column": 13, + "meta": {} + }, + { + "line": 557, + "column": 44, + "meta": {} + }, + { + "line": 561, + "column": 42, + "meta": {} + }, + { + "line": 575, + "column": 44, + "meta": {} + }, + { + "line": 579, + "column": 42, + "meta": {} + }, + { + "line": 786, + "column": 36, + "meta": {} + }, + { + "line": 791, + "column": 27, + "meta": {} + }, + { + "line": 1226, + "column": 36, + "meta": {} + }, + { + "line": 1230, + "column": 34, + "meta": {} + }, + { + "line": 1234, + "column": 36, + "meta": {} + }, + { + "line": 1238, + "column": 36, + "meta": {} + }, + { + "line": 1242, + "column": 34, + "meta": {} + }, + { + "line": 1409, + "column": 8, + "meta": {} + }, + { + "line": 1551, + "column": 32, + "meta": {} + }, + { + "line": 1774, + "column": 32, + "meta": {} + }, + { + "line": 1877, + "column": 8, + "meta": {} + }, + { + "line": 1909, + "column": 32, + "meta": {} + }, + { + "line": 1917, + "column": 32, + "meta": {} + }, + { + "line": 2122, + "column": 46, + "meta": {} + }, + { + "line": 2303, + "column": 28, + "meta": {} + }, + { + "line": 2559, + "column": 51, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "logger.c", + "locations": [ + { + "line": 188, + "column": 17, + "meta": {} + }, + { + "line": 193, + "column": 24, + "meta": {} + }, + { + "line": 196, + "column": 13, + "meta": {} + }, + { + "line": 197, + "column": 9, + "meta": {} + }, + { + "line": 201, + "column": 65, + "meta": {} + }, + { + "line": 203, + "column": 45, + "meta": {} + }, + { + "line": 679, + "column": 9, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "memcached.c", + "locations": [ + { + "line": 310, + "column": 28, + "meta": {} + }, + { + "line": 322, + "column": 21, + "meta": {} + }, + { + "line": 340, + "column": 38, + "meta": {} + }, + { + "line": 343, + "column": 41, + "meta": {} + }, + { + "line": 350, + "column": 29, + "meta": {} + }, + { + "line": 351, + "column": 33, + "meta": {} + }, + { + "line": 356, + "column": 74, + "meta": {} + }, + { + "line": 503, + "column": 33, + "meta": {} + }, + { + "line": 504, + "column": 34, + "meta": {} + }, + { + "line": 539, + "column": 25, + "meta": {} + }, + { + "line": 610, + "column": 62, + "meta": {} + }, + { + "line": 645, + "column": 8, + "meta": {} + }, + { + "line": 654, + "column": 13, + "meta": {} + }, + { + "line": 931, + "column": 50, + "meta": {} + }, + { + "line": 934, + "column": 52, + "meta": {} + }, + { + "line": 1202, + "column": 36, + "meta": {} + }, + { + "line": 1222, + "column": 32, + "meta": {} + }, + { + "line": 1361, + "column": 19, + "meta": {} + }, + { + "line": 1362, + "column": 8, + "meta": {} + }, + { + "line": 1371, + "column": 38, + "meta": {} + }, + { + "line": 1553, + "column": 60, + "meta": {} + }, + { + "line": 1661, + "column": 36, + "meta": {} + }, + { + "line": 1735, + "column": 18, + "meta": {} + }, + { + "line": 1736, + "column": 18, + "meta": {} + }, + { + "line": 1737, + "column": 18, + "meta": {} + }, + { + "line": 1738, + "column": 18, + "meta": {} + }, + { + "line": 1739, + "column": 18, + "meta": {} + }, + { + "line": 1765, + "column": 23, + "meta": {} + }, + { + "line": 2104, + "column": 53, + "meta": {} + }, + { + "line": 2105, + "column": 55, + "meta": {} + }, + { + "line": 3281, + "column": 49, + "meta": {} + }, + { + "line": 3320, + "column": 46, + "meta": {} + }, + { + "line": 3331, + "column": 25, + "meta": {} + }, + { + "line": 3345, + "column": 23, + "meta": {} + }, + { + "line": 3351, + "column": 23, + "meta": {} + }, + { + "line": 3468, + "column": 44, + "meta": {} + }, + { + "line": 3534, + "column": 48, + "meta": {} + }, + { + "line": 4394, + "column": 17, + "meta": {} + } + ] + }, + { + "term": "command", + "file": "proto_bin.c", + "locations": [ + { + "line": 24, + "column": 26, + "meta": {} + }, + { + "line": 51, + "column": 14, + "meta": {} + }, + { + "line": 118, + "column": 22, + "meta": {} + }, + { + "line": 185, + "column": 31, + "meta": {} + }, + { + "line": 242, + "column": 34, + "meta": {} + }, + { + "line": 550, + "column": 30, + "meta": {} + }, + { + "line": 602, + "column": 14, + "meta": {} + }, + { + "line": 609, + "column": 38, + "meta": {} + }, + { + "line": 618, + "column": 27, + "meta": {} + }, + { + "line": 620, + "column": 27, + "meta": {} + }, + { + "line": 622, + "column": 27, + "meta": {} + }, + { + "line": 623, + "column": 31, + "meta": {} + }, + { + "line": 645, + "column": 26, + "meta": {} + }, + { + "line": 821, + "column": 40, + "meta": {} + }, + { + "line": 881, + "column": 26, + "meta": {} + } + ] + }, + { + "term": "command", + "file": "memcached.c", + "locations": [ + { + "line": 82, + "column": 21, + "meta": {} + }, + { + "line": 83, + "column": 21, + "meta": {} + }, + { + "line": 283, + "column": 23, + "meta": {} + }, + { + "line": 602, + "column": 31, + "meta": {} + }, + { + "line": 684, + "column": 21, + "meta": {} + }, + { + "line": 690, + "column": 33, + "meta": {} + }, + { + "line": 693, + "column": 33, + "meta": {} + }, + { + "line": 699, + "column": 29, + "meta": {} + }, + { + "line": 702, + "column": 29, + "meta": {} + }, + { + "line": 1226, + "column": 28, + "meta": {} + }, + { + "line": 1491, + "column": 4, + "meta": {} + }, + { + "line": 2244, + "column": 25, + "meta": {} + }, + { + "line": 2547, + "column": 21, + "meta": {} + }, + { + "line": 2555, + "column": 21, + "meta": {} + }, + { + "line": 2559, + "column": 21, + "meta": {} + }, + { + "line": 2567, + "column": 24, + "meta": {} + }, + { + "line": 2570, + "column": 21, + "meta": {} + }, + { + "line": 2577, + "column": 25, + "meta": {} + }, + { + "line": 2580, + "column": 25, + "meta": {} + }, + { + "line": 2625, + "column": 64, + "meta": {} + }, + { + "line": 3333, + "column": 29, + "meta": {} + }, + { + "line": 4077, + "column": 65, + "meta": {} + }, + { + "line": 4091, + "column": 71, + "meta": {} + }, + { + "line": 4107, + "column": 62, + "meta": {} + }, + { + "line": 4123, + "column": 57, + "meta": {} + }, + { + "line": 4125, + "column": 53, + "meta": {} + }, + { + "line": 4173, + "column": 80, + "meta": {} + }, + { + "line": 5007, + "column": 42, + "meta": {} + }, + { + "line": 5035, + "column": 33, + "meta": {} + }, + { + "line": 5036, + "column": 34, + "meta": {} + }, + { + "line": 5090, + "column": 35, + "meta": {} + }, + { + "line": 5091, + "column": 31, + "meta": {} + } + ] + }, + { + "term": "command", + "file": "proto_text.c", + "locations": [ + { + "line": 15, + "column": 21, + "meta": {} + }, + { + "line": 23, + "column": 59, + "meta": {} + }, + { + "line": 189, + "column": 17, + "meta": {} + }, + { + "line": 197, + "column": 20, + "meta": {} + }, + { + "line": 201, + "column": 10, + "meta": {} + }, + { + "line": 202, + "column": 9, + "meta": {} + }, + { + "line": 205, + "column": 24, + "meta": {} + }, + { + "line": 208, + "column": 25, + "meta": {} + }, + { + "line": 211, + "column": 12, + "meta": {} + }, + { + "line": 213, + "column": 13, + "meta": {} + }, + { + "line": 249, + "column": 14, + "meta": {} + }, + { + "line": 259, + "column": 36, + "meta": {} + }, + { + "line": 281, + "column": 28, + "meta": {} + }, + { + "line": 330, + "column": 41, + "meta": {} + }, + { + "line": 336, + "column": 24, + "meta": {} + }, + { + "line": 346, + "column": 21, + "meta": {} + }, + { + "line": 361, + "column": 14, + "meta": {} + }, + { + "line": 408, + "column": 13, + "meta": {} + }, + { + "line": 425, + "column": 62, + "meta": {} + }, + { + "line": 463, + "column": 32, + "meta": {} + }, + { + "line": 475, + "column": 30, + "meta": {} + }, + { + "line": 595, + "column": 19, + "meta": {} + }, + { + "line": 599, + "column": 32, + "meta": {} + }, + { + "line": 627, + "column": 45, + "meta": {} + }, + { + "line": 638, + "column": 62, + "meta": {} + }, + { + "line": 641, + "column": 16, + "meta": {} + }, + { + "line": 645, + "column": 21, + "meta": {} + }, + { + "line": 649, + "column": 21, + "meta": {} + }, + { + "line": 660, + "column": 20, + "meta": {} + }, + { + "line": 664, + "column": 41, + "meta": {} + }, + { + "line": 671, + "column": 26, + "meta": {} + }, + { + "line": 675, + "column": 26, + "meta": {} + }, + { + "line": 683, + "column": 26, + "meta": {} + }, + { + "line": 685, + "column": 26, + "meta": {} + }, + { + "line": 695, + "column": 45, + "meta": {} + }, + { + "line": 701, + "column": 45, + "meta": {} + }, + { + "line": 713, + "column": 26, + "meta": {} + }, + { + "line": 716, + "column": 26, + "meta": {} + }, + { + "line": 720, + "column": 43, + "meta": {} + }, + { + "line": 722, + "column": 26, + "meta": {} + }, + { + "line": 749, + "column": 26, + "meta": {} + }, + { + "line": 753, + "column": 41, + "meta": {} + }, + { + "line": 843, + "column": 58, + "meta": {} + }, + { + "line": 852, + "column": 58, + "meta": {} + }, + { + "line": 862, + "column": 58, + "meta": {} + }, + { + "line": 914, + "column": 58, + "meta": {} + }, + { + "line": 963, + "column": 26, + "meta": {} + }, + { + "line": 974, + "column": 38, + "meta": {} + }, + { + "line": 982, + "column": 44, + "meta": {} + }, + { + "line": 990, + "column": 29, + "meta": {} + }, + { + "line": 994, + "column": 44, + "meta": {} + }, + { + "line": 997, + "column": 29, + "meta": {} + }, + { + "line": 1221, + "column": 22, + "meta": {} + }, + { + "line": 1261, + "column": 26, + "meta": {} + }, + { + "line": 1268, + "column": 38, + "meta": {} + }, + { + "line": 1278, + "column": 44, + "meta": {} + }, + { + "line": 1286, + "column": 44, + "meta": {} + }, + { + "line": 1329, + "column": 37, + "meta": {} + }, + { + "line": 1432, + "column": 29, + "meta": {} + }, + { + "line": 1440, + "column": 38, + "meta": {} + }, + { + "line": 1450, + "column": 41, + "meta": {} + }, + { + "line": 1557, + "column": 33, + "meta": {} + }, + { + "line": 1562, + "column": 38, + "meta": {} + }, + { + "line": 1580, + "column": 41, + "meta": {} + }, + { + "line": 1600, + "column": 37, + "meta": {} + }, + { + "line": 1785, + "column": 28, + "meta": {} + }, + { + "line": 1800, + "column": 41, + "meta": {} + }, + { + "line": 1810, + "column": 41, + "meta": {} + }, + { + "line": 1819, + "column": 45, + "meta": {} + }, + { + "line": 1825, + "column": 41, + "meta": {} + }, + { + "line": 1881, + "column": 27, + "meta": {} + }, + { + "line": 1893, + "column": 41, + "meta": {} + }, + { + "line": 1925, + "column": 32, + "meta": {} + }, + { + "line": 1936, + "column": 41, + "meta": {} + }, + { + "line": 1975, + "column": 28, + "meta": {} + }, + { + "line": 1989, + "column": 45, + "meta": {} + }, + { + "line": 2000, + "column": 41, + "meta": {} + }, + { + "line": 2030, + "column": 31, + "meta": {} + }, + { + "line": 2038, + "column": 41, + "meta": {} + }, + { + "line": 2047, + "column": 31, + "meta": {} + }, + { + "line": 2057, + "column": 26, + "meta": {} + }, + { + "line": 2071, + "column": 36, + "meta": {} + }, + { + "line": 2087, + "column": 45, + "meta": {} + }, + { + "line": 2104, + "column": 27, + "meta": {} + }, + { + "line": 2111, + "column": 43, + "meta": {} + }, + { + "line": 2116, + "column": 52, + "meta": {} + }, + { + "line": 2155, + "column": 30, + "meta": {} + }, + { + "line": 2182, + "column": 25, + "meta": {} + }, + { + "line": 2239, + "column": 30, + "meta": {} + }, + { + "line": 2296, + "column": 31, + "meta": {} + }, + { + "line": 2341, + "column": 29, + "meta": {} + }, + { + "line": 2345, + "column": 26, + "meta": {} + }, + { + "line": 2350, + "column": 30, + "meta": {} + }, + { + "line": 2351, + "column": 27, + "meta": {} + }, + { + "line": 2359, + "column": 27, + "meta": {} + }, + { + "line": 2370, + "column": 45, + "meta": {} + }, + { + "line": 2395, + "column": 32, + "meta": {} + }, + { + "line": 2401, + "column": 33, + "meta": {} + }, + { + "line": 2439, + "column": 56, + "meta": {} + }, + { + "line": 2473, + "column": 45, + "meta": {} + }, + { + "line": 2482, + "column": 45, + "meta": {} + }, + { + "line": 2514, + "column": 35, + "meta": {} + }, + { + "line": 2526, + "column": 20, + "meta": {} + }, + { + "line": 2529, + "column": 22, + "meta": {} + }, + { + "line": 2530, + "column": 39, + "meta": {} + }, + { + "line": 2534, + "column": 21, + "meta": {} + }, + { + "line": 2545, + "column": 45, + "meta": {} + }, + { + "line": 2548, + "column": 12, + "meta": {} + }, + { + "line": 2558, + "column": 24, + "meta": {} + }, + { + "line": 2559, + "column": 12, + "meta": {} + }, + { + "line": 2560, + "column": 32, + "meta": {} + }, + { + "line": 2566, + "column": 13, + "meta": {} + }, + { + "line": 2571, + "column": 30, + "meta": {} + }, + { + "line": 2574, + "column": 30, + "meta": {} + }, + { + "line": 2577, + "column": 33, + "meta": {} + }, + { + "line": 2581, + "column": 23, + "meta": {} + }, + { + "line": 2585, + "column": 37, + "meta": {} + }, + { + "line": 2588, + "column": 30, + "meta": {} + }, + { + "line": 2595, + "column": 24, + "meta": {} + }, + { + "line": 2599, + "column": 25, + "meta": {} + }, + { + "line": 2602, + "column": 25, + "meta": {} + }, + { + "line": 2605, + "column": 25, + "meta": {} + }, + { + "line": 2608, + "column": 25, + "meta": {} + }, + { + "line": 2616, + "column": 28, + "meta": {} + }, + { + "line": 2622, + "column": 30, + "meta": {} + }, + { + "line": 2625, + "column": 27, + "meta": {} + }, + { + "line": 2634, + "column": 28, + "meta": {} + }, + { + "line": 2642, + "column": 28, + "meta": {} + }, + { + "line": 2646, + "column": 30, + "meta": {} + }, + { + "line": 2654, + "column": 32, + "meta": {} + }, + { + "line": 2662, + "column": 28, + "meta": {} + }, + { + "line": 2666, + "column": 32, + "meta": {} + }, + { + "line": 2674, + "column": 27, + "meta": {} + }, + { + "line": 2683, + "column": 24, + "meta": {} + }, + { + "line": 2686, + "column": 33, + "meta": {} + }, + { + "line": 2690, + "column": 21, + "meta": {} + }, + { + "line": 2695, + "column": 27, + "meta": {} + }, + { + "line": 2699, + "column": 25, + "meta": {} + }, + { + "line": 2703, + "column": 22, + "meta": {} + }, + { + "line": 2707, + "column": 29, + "meta": {} + }, + { + "line": 2711, + "column": 23, + "meta": {} + }, + { + "line": 2715, + "column": 27, + "meta": {} + }, + { + "line": 2718, + "column": 21, + "meta": {} + }, + { + "line": 2720, + "column": 8, + "meta": {} + }, + { + "line": 2722, + "column": 27, + "meta": {} + }, + { + "line": 2727, + "column": 26, + "meta": {} + }, + { + "line": 2731, + "column": 31, + "meta": {} + } + ] + } +] \ No newline at end of file diff --git a/targets/locations_memcached_single.json b/targets/locations_memcached_single.json new file mode 100644 index 0000000000..2fa50a59f7 --- /dev/null +++ b/targets/locations_memcached_single.json @@ -0,0 +1,10 @@ +[ + { + "term": "cmd", + "file": "memcached.c", + "locations": [ + {"line" : 1362, "column" : 8, "meta" : {}} + + ] + } +] \ No newline at end of file diff --git a/targets/locations_memcached_stats.json b/targets/locations_memcached_stats.json new file mode 100644 index 0000000000..e371ddb09a --- /dev/null +++ b/targets/locations_memcached_stats.json @@ -0,0 +1,3956 @@ +[ + { + "term": "cmd", + "file": "tls.c", + "locations": [ + { + "line": 243, + "column": 5, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "thread.c", + "locations": [ + { + "line": 61, + "column": 20, + "meta": {} + }, + { + "line": 62, + "column": 24, + "meta": {} + }, + { + "line": 326, + "column": 13, + "meta": {} + }, + { + "line": 422, + "column": 33, + "meta": {} + }, + { + "line": 778, + "column": 25, + "meta": {} + }, + { + "line": 782, + "column": 27, + "meta": {} + }, + { + "line": 785, + "column": 18, + "meta": {} + }, + { + "line": 788, + "column": 41, + "meta": {} + }, + { + "line": 789, + "column": 29, + "meta": {} + }, + { + "line": 796, + "column": 29, + "meta": {} + }, + { + "line": 797, + "column": 36, + "meta": {} + }, + { + "line": 798, + "column": 29, + "meta": {} + }, + { + "line": 801, + "column": 43, + "meta": {} + }, + { + "line": 805, + "column": 18, + "meta": {} + }, + { + "line": 810, + "column": 12, + "meta": {} + }, + { + "line": 813, + "column": 41, + "meta": {} + }, + { + "line": 814, + "column": 17, + "meta": {} + }, + { + "line": 822, + "column": 17, + "meta": {} + }, + { + "line": 823, + "column": 25, + "meta": {} + }, + { + "line": 829, + "column": 13, + "meta": {} + }, + { + "line": 830, + "column": 29, + "meta": {} + }, + { + "line": 831, + "column": 13, + "meta": {} + }, + { + "line": 832, + "column": 29, + "meta": {} + }, + { + "line": 835, + "column": 9, + "meta": {} + }, + { + "line": 836, + "column": 9, + "meta": {} + }, + { + "line": 837, + "column": 9, + "meta": {} + }, + { + "line": 838, + "column": 43, + "meta": {} + }, + { + "line": 842, + "column": 11, + "meta": {} + }, + { + "line": 848, + "column": 30, + "meta": {} + }, + { + "line": 929, + "column": 9, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "storage.c", + "locations": [ + { + "line": 238, + "column": 10, + "meta": {} + }, + { + "line": 245, + "column": 21, + "meta": {} + }, + { + "line": 253, + "column": 18, + "meta": {} + }, + { + "line": 408, + "column": 5, + "meta": {} + }, + { + "line": 409, + "column": 5, + "meta": {} + }, + { + "line": 410, + "column": 5, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "stats_prefix.c", + "locations": [ + { + "line": 10, + "column": 29, + "meta": {} + }, + { + "line": 16, + "column": 6, + "meta": {} + }, + { + "line": 18, + "column": 19, + "meta": {} + }, + { + "line": 21, + "column": 6, + "meta": {} + }, + { + "line": 26, + "column": 27, + "meta": {} + }, + { + "line": 31, + "column": 16, + "meta": {} + }, + { + "line": 37, + "column": 15, + "meta": {} + }, + { + "line": 58, + "column": 23, + "meta": {} + }, + { + "line": 65, + "column": 42, + "meta": {} + }, + { + "line": 80, + "column": 24, + "meta": {} + }, + { + "line": 81, + "column": 12, + "meta": {} + }, + { + "line": 89, + "column": 6, + "meta": {} + }, + { + "line": 93, + "column": 11, + "meta": {} + }, + { + "line": 103, + "column": 6, + "meta": {} + }, + { + "line": 107, + "column": 11, + "meta": {} + }, + { + "line": 114, + "column": 6, + "meta": {} + }, + { + "line": 118, + "column": 11, + "meta": {} + }, + { + "line": 125, + "column": 7, + "meta": {} + }, + { + "line": 145, + "column": 32, + "meta": {} + }, + { + "line": 152, + "column": 27, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "testapp.c", + "locations": [ + { + "line": 25, + "column": 11, + "meta": {} + }, + { + "line": 247, + "column": 30, + "meta": {} + }, + { + "line": 250, + "column": 5, + "meta": {} + }, + { + "line": 251, + "column": 12, + "meta": {} + }, + { + "line": 253, + "column": 12, + "meta": {} + }, + { + "line": 256, + "column": 12, + "meta": {} + }, + { + "line": 259, + "column": 12, + "meta": {} + }, + { + "line": 261, + "column": 12, + "meta": {} + }, + { + "line": 263, + "column": 12, + "meta": {} + }, + { + "line": 265, + "column": 12, + "meta": {} + }, + { + "line": 270, + "column": 30, + "meta": {} + }, + { + "line": 272, + "column": 5, + "meta": {} + }, + { + "line": 274, + "column": 5, + "meta": {} + }, + { + "line": 275, + "column": 11, + "meta": {} + }, + { + "line": 278, + "column": 5, + "meta": {} + }, + { + "line": 281, + "column": 5, + "meta": {} + }, + { + "line": 284, + "column": 5, + "meta": {} + }, + { + "line": 290, + "column": 30, + "meta": {} + }, + { + "line": 292, + "column": 5, + "meta": {} + }, + { + "line": 294, + "column": 5, + "meta": {} + }, + { + "line": 295, + "column": 11, + "meta": {} + }, + { + "line": 300, + "column": 5, + "meta": {} + }, + { + "line": 305, + "column": 30, + "meta": {} + }, + { + "line": 307, + "column": 5, + "meta": {} + }, + { + "line": 309, + "column": 5, + "meta": {} + }, + { + "line": 310, + "column": 11, + "meta": {} + }, + { + "line": 315, + "column": 5, + "meta": {} + }, + { + "line": 320, + "column": 30, + "meta": {} + }, + { + "line": 328, + "column": 5, + "meta": {} + }, + { + "line": 330, + "column": 37, + "meta": {} + }, + { + "line": 332, + "column": 5, + "meta": {} + }, + { + "line": 335, + "column": 36, + "meta": {} + }, + { + "line": 337, + "column": 5, + "meta": {} + }, + { + "line": 340, + "column": 36, + "meta": {} + }, + { + "line": 342, + "column": 5, + "meta": {} + }, + { + "line": 345, + "column": 36, + "meta": {} + }, + { + "line": 347, + "column": 5, + "meta": {} + }, + { + "line": 350, + "column": 36, + "meta": {} + }, + { + "line": 353, + "column": 5, + "meta": {} + }, + { + "line": 357, + "column": 11, + "meta": {} + }, + { + "line": 374, + "column": 5, + "meta": {} + }, + { + "line": 375, + "column": 11, + "meta": {} + }, + { + "line": 384, + "column": 5, + "meta": {} + }, + { + "line": 840, + "column": 25, + "meta": {} + }, + { + "line": 845, + "column": 25, + "meta": {} + }, + { + "line": 2154, + "column": 28, + "meta": {} + }, + { + "line": 2240, + "column": 8, + "meta": {} + }, + { + "line": 2241, + "column": 8, + "meta": {} + }, + { + "line": 2242, + "column": 8, + "meta": {} + }, + { + "line": 2243, + "column": 8, + "meta": {} + }, + { + "line": 2244, + "column": 8, + "meta": {} + }, + { + "line": 2317, + "column": 5, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "slab_automove_extstore.c", + "locations": [ + { + "line": 43, + "column": 10, + "meta": {} + }, + { + "line": 44, + "column": 10, + "meta": {} + }, + { + "line": 45, + "column": 10, + "meta": {} + }, + { + "line": 46, + "column": 10, + "meta": {} + }, + { + "line": 74, + "column": 15, + "meta": {} + }, + { + "line": 75, + "column": 15, + "meta": {} + }, + { + "line": 142, + "column": 14, + "meta": {} + }, + { + "line": 180, + "column": 15, + "meta": {} + }, + { + "line": 181, + "column": 15, + "meta": {} + }, + { + "line": 264, + "column": 25, + "meta": {} + }, + { + "line": 266, + "column": 25, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "slabs.c", + "locations": [ + { + "line": 524, + "column": 36, + "meta": {} + }, + { + "line": 527, + "column": 16, + "meta": {} + }, + { + "line": 532, + "column": 14, + "meta": {} + }, + { + "line": 555, + "column": 22, + "meta": {} + }, + { + "line": 557, + "column": 27, + "meta": {} + }, + { + "line": 558, + "column": 19, + "meta": {} + }, + { + "line": 559, + "column": 17, + "meta": {} + }, + { + "line": 583, + "column": 48, + "meta": {} + }, + { + "line": 585, + "column": 48, + "meta": {} + }, + { + "line": 587, + "column": 48, + "meta": {} + }, + { + "line": 589, + "column": 48, + "meta": {} + }, + { + "line": 591, + "column": 48, + "meta": {} + }, + { + "line": 593, + "column": 48, + "meta": {} + }, + { + "line": 595, + "column": 48, + "meta": {} + }, + { + "line": 597, + "column": 48, + "meta": {} + }, + { + "line": 602, + "column": 25, + "meta": {} + }, + { + "line": 606, + "column": 9, + "meta": {} + }, + { + "line": 671, + "column": 12, + "meta": {} + }, + { + "line": 673, + "column": 14, + "meta": {} + }, + { + "line": 781, + "column": 5, + "meta": {} + }, + { + "line": 1096, + "column": 13, + "meta": {} + }, + { + "line": 1184, + "column": 5, + "meta": {} + }, + { + "line": 1185, + "column": 5, + "meta": {} + }, + { + "line": 1186, + "column": 5, + "meta": {} + }, + { + "line": 1187, + "column": 5, + "meta": {} + }, + { + "line": 1188, + "column": 5, + "meta": {} + }, + { + "line": 1189, + "column": 5, + "meta": {} + }, + { + "line": 1190, + "column": 5, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "crawler.c", + "locations": [ + { + "line": 149, + "column": 23, + "meta": {} + }, + { + "line": 151, + "column": 19, + "meta": {} + }, + { + "line": 152, + "column": 19, + "meta": {} + }, + { + "line": 161, + "column": 15, + "meta": {} + }, + { + "line": 162, + "column": 15, + "meta": {} + }, + { + "line": 184, + "column": 12, + "meta": {} + }, + { + "line": 346, + "column": 13, + "meta": {} + }, + { + "line": 457, + "column": 5, + "meta": {} + }, + { + "line": 559, + "column": 9, + "meta": {} + }, + { + "line": 560, + "column": 9, + "meta": {} + }, + { + "line": 589, + "column": 18, + "meta": {} + }, + { + "line": 641, + "column": 31, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "sizes.c", + "locations": [ + { + "line": 11, + "column": 46, + "meta": {} + }, + { + "line": 12, + "column": 21, + "meta": {} + }, + { + "line": 13, + "column": 34, + "meta": {} + }, + { + "line": 14, + "column": 41, + "meta": {} + }, + { + "line": 15, + "column": 21, + "meta": {} + }, + { + "line": 23, + "column": 60, + "meta": {} + }, + { + "line": 32, + "column": 21, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "assoc.c", + "locations": [ + { + "line": 68, + "column": 5, + "meta": {} + }, + { + "line": 69, + "column": 5, + "meta": {} + }, + { + "line": 132, + "column": 9, + "meta": {} + }, + { + "line": 133, + "column": 9, + "meta": {} + }, + { + "line": 134, + "column": 9, + "meta": {} + }, + { + "line": 227, + "column": 25, + "meta": {} + }, + { + "line": 228, + "column": 25, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "proto_bin.c", + "locations": [ + { + "line": 338, + "column": 44, + "meta": {} + }, + { + "line": 340, + "column": 28, + "meta": {} + }, + { + "line": 342, + "column": 28, + "meta": {} + }, + { + "line": 344, + "column": 46, + "meta": {} + }, + { + "line": 361, + "column": 36, + "meta": {} + }, + { + "line": 362, + "column": 16, + "meta": {} + }, + { + "line": 363, + "column": 38, + "meta": {} + }, + { + "line": 485, + "column": 40, + "meta": {} + }, + { + "line": 487, + "column": 24, + "meta": {} + }, + { + "line": 488, + "column": 24, + "meta": {} + }, + { + "line": 490, + "column": 24, + "meta": {} + }, + { + "line": 491, + "column": 24, + "meta": {} + }, + { + "line": 493, + "column": 42, + "meta": {} + }, + { + "line": 527, + "column": 52, + "meta": {} + }, + { + "line": 528, + "column": 32, + "meta": {} + }, + { + "line": 529, + "column": 54, + "meta": {} + }, + { + "line": 569, + "column": 40, + "meta": {} + }, + { + "line": 571, + "column": 24, + "meta": {} + }, + { + "line": 572, + "column": 24, + "meta": {} + }, + { + "line": 574, + "column": 24, + "meta": {} + }, + { + "line": 575, + "column": 24, + "meta": {} + }, + { + "line": 577, + "column": 42, + "meta": {} + }, + { + "line": 597, + "column": 9, + "meta": {} + }, + { + "line": 616, + "column": 16, + "meta": {} + }, + { + "line": 617, + "column": 19, + "meta": {} + }, + { + "line": 619, + "column": 9, + "meta": {} + }, + { + "line": 621, + "column": 39, + "meta": {} + }, + { + "line": 626, + "column": 30, + "meta": {} + }, + { + "line": 628, + "column": 73, + "meta": {} + }, + { + "line": 633, + "column": 24, + "meta": {} + }, + { + "line": 645, + "column": 17, + "meta": {} + }, + { + "line": 646, + "column": 20, + "meta": {} + }, + { + "line": 647, + "column": 73, + "meta": {} + }, + { + "line": 649, + "column": 38, + "meta": {} + }, + { + "line": 650, + "column": 20, + "meta": {} + }, + { + "line": 660, + "column": 12, + "meta": {} + }, + { + "line": 661, + "column": 12, + "meta": {} + }, + { + "line": 662, + "column": 72, + "meta": {} + }, + { + "line": 664, + "column": 30, + "meta": {} + }, + { + "line": 665, + "column": 12, + "meta": {} + }, + { + "line": 835, + "column": 40, + "meta": {} + }, + { + "line": 836, + "column": 20, + "meta": {} + }, + { + "line": 837, + "column": 42, + "meta": {} + }, + { + "line": 851, + "column": 40, + "meta": {} + }, + { + "line": 852, + "column": 20, + "meta": {} + }, + { + "line": 853, + "column": 20, + "meta": {} + }, + { + "line": 854, + "column": 42, + "meta": {} + }, + { + "line": 1109, + "column": 9, + "meta": {} + }, + { + "line": 1199, + "column": 9, + "meta": {} + }, + { + "line": 1251, + "column": 52, + "meta": {} + }, + { + "line": 1273, + "column": 36, + "meta": {} + }, + { + "line": 1274, + "column": 16, + "meta": {} + }, + { + "line": 1275, + "column": 38, + "meta": {} + }, + { + "line": 1299, + "column": 9, + "meta": {} + }, + { + "line": 1307, + "column": 44, + "meta": {} + }, + { + "line": 1308, + "column": 24, + "meta": {} + }, + { + "line": 1309, + "column": 46, + "meta": {} + }, + { + "line": 1319, + "column": 40, + "meta": {} + }, + { + "line": 1320, + "column": 20, + "meta": {} + }, + { + "line": 1321, + "column": 42, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "logger.c", + "locations": [ + { + "line": 251, + "column": 89, + "meta": {} + }, + { + "line": 289, + "column": 66, + "meta": {} + }, + { + "line": 352, + "column": 56, + "meta": {} + }, + { + "line": 374, + "column": 22, + "meta": {} + }, + { + "line": 504, + "column": 31, + "meta": {} + }, + { + "line": 506, + "column": 5, + "meta": {} + }, + { + "line": 507, + "column": 5, + "meta": {} + }, + { + "line": 508, + "column": 5, + "meta": {} + }, + { + "line": 509, + "column": 5, + "meta": {} + }, + { + "line": 525, + "column": 23, + "meta": {} + }, + { + "line": 526, + "column": 45, + "meta": {} + }, + { + "line": 553, + "column": 27, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "globals.c", + "locations": [ + { + "line": 22, + "column": 8, + "meta": {} + }, + { + "line": 23, + "column": 8, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "memcached.c", + "locations": [ + { + "line": 91, + "column": 4, + "meta": {} + }, + { + "line": 92, + "column": 13, + "meta": {} + }, + { + "line": 111, + "column": 8, + "meta": {} + }, + { + "line": 112, + "column": 8, + "meta": {} + }, + { + "line": 202, + "column": 13, + "meta": {} + }, + { + "line": 203, + "column": 13, + "meta": {} + }, + { + "line": 204, + "column": 13, + "meta": {} + }, + { + "line": 205, + "column": 5, + "meta": {} + }, + { + "line": 212, + "column": 5, + "meta": {} + }, + { + "line": 215, + "column": 6, + "meta": {} + }, + { + "line": 217, + "column": 13, + "meta": {} + }, + { + "line": 218, + "column": 5, + "meta": {} + }, + { + "line": 220, + "column": 17, + "meta": {} + }, + { + "line": 221, + "column": 10, + "meta": {} + }, + { + "line": 417, + "column": 24, + "meta": {} + }, + { + "line": 514, + "column": 40, + "meta": {} + }, + { + "line": 515, + "column": 20, + "meta": {} + }, + { + "line": 516, + "column": 42, + "meta": {} + }, + { + "line": 563, + "column": 13, + "meta": {} + }, + { + "line": 584, + "column": 13, + "meta": {} + }, + { + "line": 591, + "column": 9, + "meta": {} + }, + { + "line": 717, + "column": 5, + "meta": {} + }, + { + "line": 718, + "column": 5, + "meta": {} + }, + { + "line": 738, + "column": 40, + "meta": {} + }, + { + "line": 739, + "column": 20, + "meta": {} + }, + { + "line": 740, + "column": 42, + "meta": {} + }, + { + "line": 747, + "column": 40, + "meta": {} + }, + { + "line": 748, + "column": 20, + "meta": {} + }, + { + "line": 750, + "column": 24, + "meta": {} + }, + { + "line": 751, + "column": 42, + "meta": {} + }, + { + "line": 772, + "column": 48, + "meta": {} + }, + { + "line": 773, + "column": 28, + "meta": {} + }, + { + "line": 774, + "column": 50, + "meta": {} + }, + { + "line": 908, + "column": 5, + "meta": {} + }, + { + "line": 1048, + "column": 24, + "meta": {} + }, + { + "line": 1096, + "column": 24, + "meta": {} + }, + { + "line": 1119, + "column": 20, + "meta": {} + }, + { + "line": 1123, + "column": 21, + "meta": {} + }, + { + "line": 1125, + "column": 16, + "meta": {} + }, + { + "line": 1174, + "column": 16, + "meta": {} + }, + { + "line": 1252, + "column": 24, + "meta": {} + }, + { + "line": 1255, + "column": 20, + "meta": {} + }, + { + "line": 1278, + "column": 8, + "meta": {} + }, + { + "line": 1281, + "column": 26, + "meta": {} + }, + { + "line": 1284, + "column": 20, + "meta": {} + }, + { + "line": 1286, + "column": 24, + "meta": {} + }, + { + "line": 1297, + "column": 8, + "meta": {} + }, + { + "line": 1300, + "column": 18, + "meta": {} + }, + { + "line": 1301, + "column": 23, + "meta": {} + }, + { + "line": 1302, + "column": 35, + "meta": {} + }, + { + "line": 1306, + "column": 12, + "meta": {} + }, + { + "line": 1308, + "column": 24, + "meta": {} + }, + { + "line": 1314, + "column": 32, + "meta": {} + }, + { + "line": 1317, + "column": 21, + "meta": {} + }, + { + "line": 1318, + "column": 32, + "meta": {} + }, + { + "line": 1320, + "column": 16, + "meta": {} + }, + { + "line": 1321, + "column": 16, + "meta": {} + }, + { + "line": 1324, + "column": 13, + "meta": {} + }, + { + "line": 1333, + "column": 13, + "meta": {} + }, + { + "line": 1346, + "column": 19, + "meta": {} + }, + { + "line": 1349, + "column": 20, + "meta": {} + }, + { + "line": 1352, + "column": 19, + "meta": {} + }, + { + "line": 1355, + "column": 22, + "meta": {} + }, + { + "line": 1358, + "column": 15, + "meta": {} + }, + { + "line": 1532, + "column": 41, + "meta": {} + }, + { + "line": 1533, + "column": 52, + "meta": {} + }, + { + "line": 1534, + "column": 32, + "meta": {} + }, + { + "line": 1535, + "column": 54, + "meta": {} + }, + { + "line": 1548, + "column": 52, + "meta": {} + }, + { + "line": 1549, + "column": 32, + "meta": {} + }, + { + "line": 1550, + "column": 54, + "meta": {} + }, + { + "line": 1554, + "column": 52, + "meta": {} + }, + { + "line": 1555, + "column": 32, + "meta": {} + }, + { + "line": 1556, + "column": 54, + "meta": {} + }, + { + "line": 1629, + "column": 48, + "meta": {} + }, + { + "line": 1630, + "column": 28, + "meta": {} + }, + { + "line": 1631, + "column": 50, + "meta": {} + }, + { + "line": 1655, + "column": 65, + "meta": {} + }, + { + "line": 1663, + "column": 62, + "meta": {} + }, + { + "line": 1667, + "column": 49, + "meta": {} + }, + { + "line": 1674, + "column": 16, + "meta": {} + }, + { + "line": 1682, + "column": 9, + "meta": {} + }, + { + "line": 1685, + "column": 27, + "meta": {} + }, + { + "line": 1686, + "column": 13, + "meta": {} + }, + { + "line": 1690, + "column": 19, + "meta": {} + }, + { + "line": 1691, + "column": 17, + "meta": {} + }, + { + "line": 1692, + "column": 17, + "meta": {} + }, + { + "line": 1693, + "column": 10, + "meta": {} + }, + { + "line": 1695, + "column": 21, + "meta": {} + }, + { + "line": 1712, + "column": 36, + "meta": {} + }, + { + "line": 1715, + "column": 38, + "meta": {} + }, + { + "line": 1721, + "column": 65, + "meta": {} + }, + { + "line": 1722, + "column": 66, + "meta": {} + }, + { + "line": 1724, + "column": 73, + "meta": {} + }, + { + "line": 1726, + "column": 48, + "meta": {} + }, + { + "line": 1727, + "column": 72, + "meta": {} + }, + { + "line": 1728, + "column": 74, + "meta": {} + }, + { + "line": 1729, + "column": 74, + "meta": {} + }, + { + "line": 1730, + "column": 70, + "meta": {} + }, + { + "line": 1731, + "column": 70, + "meta": {} + }, + { + "line": 1732, + "column": 75, + "meta": {} + }, + { + "line": 1733, + "column": 68, + "meta": {} + }, + { + "line": 1734, + "column": 39, + "meta": {} + }, + { + "line": 1735, + "column": 63, + "meta": {} + }, + { + "line": 1736, + "column": 61, + "meta": {} + }, + { + "line": 1737, + "column": 65, + "meta": {} + }, + { + "line": 1738, + "column": 65, + "meta": {} + }, + { + "line": 1739, + "column": 64, + "meta": {} + }, + { + "line": 1740, + "column": 62, + "meta": {} + }, + { + "line": 1741, + "column": 66, + "meta": {} + }, + { + "line": 1742, + "column": 67, + "meta": {} + }, + { + "line": 1743, + "column": 67, + "meta": {} + }, + { + "line": 1746, + "column": 72, + "meta": {} + }, + { + "line": 1747, + "column": 80, + "meta": {} + }, + { + "line": 1748, + "column": 76, + "meta": {} + }, + { + "line": 1749, + "column": 81, + "meta": {} + }, + { + "line": 1750, + "column": 78, + "meta": {} + }, + { + "line": 1751, + "column": 80, + "meta": {} + }, + { + "line": 1754, + "column": 69, + "meta": {} + }, + { + "line": 1755, + "column": 65, + "meta": {} + }, + { + "line": 1756, + "column": 67, + "meta": {} + }, + { + "line": 1757, + "column": 63, + "meta": {} + }, + { + "line": 1758, + "column": 67, + "meta": {} + }, + { + "line": 1759, + "column": 63, + "meta": {} + }, + { + "line": 1760, + "column": 66, + "meta": {} + }, + { + "line": 1761, + "column": 62, + "meta": {} + }, + { + "line": 1762, + "column": 64, + "meta": {} + }, + { + "line": 1763, + "column": 64, + "meta": {} + }, + { + "line": 1764, + "column": 68, + "meta": {} + }, + { + "line": 1765, + "column": 65, + "meta": {} + }, + { + "line": 1766, + "column": 67, + "meta": {} + }, + { + "line": 1768, + "column": 70, + "meta": {} + }, + { + "line": 1770, + "column": 66, + "meta": {} + }, + { + "line": 1771, + "column": 69, + "meta": {} + }, + { + "line": 1773, + "column": 42, + "meta": {} + }, + { + "line": 1774, + "column": 68, + "meta": {} + }, + { + "line": 1775, + "column": 55, + "meta": {} + }, + { + "line": 1777, + "column": 67, + "meta": {} + }, + { + "line": 1778, + "column": 43, + "meta": {} + }, + { + "line": 1779, + "column": 59, + "meta": {} + }, + { + "line": 1780, + "column": 44, + "meta": {} + }, + { + "line": 1782, + "column": 54, + "meta": {} + }, + { + "line": 1783, + "column": 60, + "meta": {} + }, + { + "line": 1784, + "column": 62, + "meta": {} + }, + { + "line": 1785, + "column": 61, + "meta": {} + }, + { + "line": 1786, + "column": 57, + "meta": {} + }, + { + "line": 1787, + "column": 59, + "meta": {} + }, + { + "line": 1788, + "column": 52, + "meta": {} + }, + { + "line": 1789, + "column": 44, + "meta": {} + }, + { + "line": 1792, + "column": 50, + "meta": {} + }, + { + "line": 1793, + "column": 49, + "meta": {} + }, + { + "line": 1796, + "column": 75, + "meta": {} + }, + { + "line": 1799, + "column": 37, + "meta": {} + }, + { + "line": 1800, + "column": 67, + "meta": {} + }, + { + "line": 1801, + "column": 67, + "meta": {} + }, + { + "line": 1802, + "column": 68, + "meta": {} + }, + { + "line": 1803, + "column": 65, + "meta": {} + }, + { + "line": 1808, + "column": 74, + "meta": {} + }, + { + "line": 1809, + "column": 77, + "meta": {} + }, + { + "line": 1810, + "column": 77, + "meta": {} + }, + { + "line": 1812, + "column": 22, + "meta": {} + }, + { + "line": 1834, + "column": 73, + "meta": {} + }, + { + "line": 1836, + "column": 73, + "meta": {} + }, + { + "line": 1842, + "column": 41, + "meta": {} + }, + { + "line": 1843, + "column": 16, + "meta": {} + }, + { + "line": 1896, + "column": 43, + "meta": {} + }, + { + "line": 1931, + "column": 10, + "meta": {} + }, + { + "line": 1934, + "column": 13, + "meta": {} + }, + { + "line": 1938, + "column": 62, + "meta": {} + }, + { + "line": 1939, + "column": 67, + "meta": {} + }, + { + "line": 1940, + "column": 68, + "meta": {} + }, + { + "line": 1943, + "column": 18, + "meta": {} + }, + { + "line": 1945, + "column": 18, + "meta": {} + }, + { + "line": 1947, + "column": 19, + "meta": {} + }, + { + "line": 1949, + "column": 18, + "meta": {} + }, + { + "line": 1951, + "column": 18, + "meta": {} + }, + { + "line": 1953, + "column": 18, + "meta": {} + }, + { + "line": 2073, + "column": 14, + "meta": {} + }, + { + "line": 2082, + "column": 16, + "meta": {} + }, + { + "line": 2111, + "column": 23, + "meta": {} + }, + { + "line": 2116, + "column": 21, + "meta": {} + }, + { + "line": 2118, + "column": 16, + "meta": {} + }, + { + "line": 2121, + "column": 18, + "meta": {} + }, + { + "line": 2415, + "column": 36, + "meta": {} + }, + { + "line": 2416, + "column": 16, + "meta": {} + }, + { + "line": 2417, + "column": 38, + "meta": {} + }, + { + "line": 2484, + "column": 36, + "meta": {} + }, + { + "line": 2486, + "column": 20, + "meta": {} + }, + { + "line": 2488, + "column": 20, + "meta": {} + }, + { + "line": 2490, + "column": 38, + "meta": {} + }, + { + "line": 2503, + "column": 14, + "meta": {} + }, + { + "line": 2505, + "column": 14, + "meta": {} + }, + { + "line": 2598, + "column": 40, + "meta": {} + }, + { + "line": 2599, + "column": 20, + "meta": {} + }, + { + "line": 2600, + "column": 42, + "meta": {} + }, + { + "line": 2656, + "column": 17, + "meta": {} + }, + { + "line": 2673, + "column": 44, + "meta": {} + }, + { + "line": 2674, + "column": 24, + "meta": {} + }, + { + "line": 2675, + "column": 46, + "meta": {} + }, + { + "line": 2739, + "column": 39, + "meta": {} + }, + { + "line": 2740, + "column": 42, + "meta": {} + }, + { + "line": 2741, + "column": 9, + "meta": {} + }, + { + "line": 2742, + "column": 9, + "meta": {} + }, + { + "line": 2746, + "column": 9, + "meta": {} + }, + { + "line": 2747, + "column": 23, + "meta": {} + }, + { + "line": 2748, + "column": 9, + "meta": {} + }, + { + "line": 2908, + "column": 40, + "meta": {} + }, + { + "line": 2909, + "column": 20, + "meta": {} + }, + { + "line": 2910, + "column": 42, + "meta": {} + }, + { + "line": 3044, + "column": 40, + "meta": {} + }, + { + "line": 3045, + "column": 20, + "meta": {} + }, + { + "line": 3046, + "column": 42, + "meta": {} + }, + { + "line": 3132, + "column": 48, + "meta": {} + }, + { + "line": 3133, + "column": 28, + "meta": {} + }, + { + "line": 3134, + "column": 50, + "meta": {} + }, + { + "line": 3224, + "column": 26, + "meta": {} + }, + { + "line": 3226, + "column": 21, + "meta": {} + }, + { + "line": 3272, + "column": 29, + "meta": {} + }, + { + "line": 3356, + "column": 48, + "meta": {} + }, + { + "line": 3357, + "column": 28, + "meta": {} + }, + { + "line": 3358, + "column": 50, + "meta": {} + }, + { + "line": 3409, + "column": 52, + "meta": {} + }, + { + "line": 3410, + "column": 32, + "meta": {} + }, + { + "line": 3411, + "column": 54, + "meta": {} + }, + { + "line": 3484, + "column": 48, + "meta": {} + }, + { + "line": 3485, + "column": 28, + "meta": {} + }, + { + "line": 3486, + "column": 50, + "meta": {} + }, + { + "line": 3784, + "column": 33, + "meta": {} + }, + { + "line": 4026, + "column": 24, + "meta": {} + }, + { + "line": 4104, + "column": 55, + "meta": {} + }, + { + "line": 4105, + "column": 72, + "meta": {} + }, + { + "line": 4107, + "column": 44, + "meta": {} + }, + { + "line": 4124, + "column": 47, + "meta": {} + }, + { + "line": 4173, + "column": 67, + "meta": {} + }, + { + "line": 4554, + "column": 44, + "meta": {} + }, + { + "line": 5513, + "column": 22, + "meta": {} + }, + { + "line": 6125, + "column": 5, + "meta": {} + }, + { + "line": 6348, + "column": 9, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "items.c", + "locations": [ + { + "line": 53, + "column": 7, + "meta": {} + }, + { + "line": 57, + "column": 12, + "meta": {} + }, + { + "line": 60, + "column": 22, + "meta": {} + }, + { + "line": 61, + "column": 17, + "meta": {} + }, + { + "line": 62, + "column": 12, + "meta": {} + }, + { + "line": 69, + "column": 24, + "meta": {} + }, + { + "line": 71, + "column": 11, + "meta": {} + }, + { + "line": 75, + "column": 21, + "meta": {} + }, + { + "line": 81, + "column": 14, + "meta": {} + }, + { + "line": 83, + "column": 9, + "meta": {} + }, + { + "line": 84, + "column": 9, + "meta": {} + }, + { + "line": 85, + "column": 9, + "meta": {} + }, + { + "line": 209, + "column": 13, + "meta": {} + }, + { + "line": 296, + "column": 13, + "meta": {} + }, + { + "line": 381, + "column": 11, + "meta": {} + }, + { + "line": 396, + "column": 5, + "meta": {} + }, + { + "line": 397, + "column": 5, + "meta": {} + }, + { + "line": 398, + "column": 5, + "meta": {} + }, + { + "line": 401, + "column": 10, + "meta": {} + }, + { + "line": 442, + "column": 9, + "meta": {} + }, + { + "line": 491, + "column": 5, + "meta": {} + }, + { + "line": 492, + "column": 5, + "meta": {} + }, + { + "line": 493, + "column": 5, + "meta": {} + }, + { + "line": 501, + "column": 10, + "meta": {} + }, + { + "line": 511, + "column": 9, + "meta": {} + }, + { + "line": 512, + "column": 9, + "meta": {} + }, + { + "line": 514, + "column": 14, + "meta": {} + }, + { + "line": 527, + "column": 9, + "meta": {} + }, + { + "line": 528, + "column": 9, + "meta": {} + }, + { + "line": 530, + "column": 14, + "meta": {} + }, + { + "line": 644, + "column": 36, + "meta": {} + }, + { + "line": 647, + "column": 16, + "meta": {} + }, + { + "line": 650, + "column": 14, + "meta": {} + }, + { + "line": 655, + "column": 32, + "meta": {} + }, + { + "line": 661, + "column": 28, + "meta": {} + }, + { + "line": 671, + "column": 11, + "meta": {} + }, + { + "line": 672, + "column": 9, + "meta": {} + }, + { + "line": 673, + "column": 35, + "meta": {} + }, + { + "line": 681, + "column": 45, + "meta": {} + }, + { + "line": 682, + "column": 45, + "meta": {} + }, + { + "line": 683, + "column": 42, + "meta": {} + }, + { + "line": 684, + "column": 35, + "meta": {} + }, + { + "line": 685, + "column": 37, + "meta": {} + }, + { + "line": 686, + "column": 45, + "meta": {} + }, + { + "line": 687, + "column": 49, + "meta": {} + }, + { + "line": 688, + "column": 45, + "meta": {} + }, + { + "line": 689, + "column": 41, + "meta": {} + }, + { + "line": 690, + "column": 41, + "meta": {} + }, + { + "line": 691, + "column": 44, + "meta": {} + }, + { + "line": 692, + "column": 43, + "meta": {} + }, + { + "line": 728, + "column": 11, + "meta": {} + }, + { + "line": 729, + "column": 19, + "meta": {} + }, + { + "line": 730, + "column": 17, + "meta": {} + }, + { + "line": 731, + "column": 9, + "meta": {} + }, + { + "line": 734, + "column": 39, + "meta": {} + }, + { + "line": 749, + "column": 35, + "meta": {} + }, + { + "line": 750, + "column": 43, + "meta": {} + }, + { + "line": 751, + "column": 39, + "meta": {} + }, + { + "line": 752, + "column": 39, + "meta": {} + }, + { + "line": 753, + "column": 37, + "meta": {} + }, + { + "line": 754, + "column": 45, + "meta": {} + }, + { + "line": 755, + "column": 45, + "meta": {} + }, + { + "line": 756, + "column": 42, + "meta": {} + }, + { + "line": 757, + "column": 45, + "meta": {} + }, + { + "line": 758, + "column": 49, + "meta": {} + }, + { + "line": 759, + "column": 45, + "meta": {} + }, + { + "line": 760, + "column": 41, + "meta": {} + }, + { + "line": 761, + "column": 41, + "meta": {} + }, + { + "line": 762, + "column": 44, + "meta": {} + }, + { + "line": 763, + "column": 43, + "meta": {} + }, + { + "line": 775, + "column": 43, + "meta": {} + }, + { + "line": 778, + "column": 49, + "meta": {} + }, + { + "line": 781, + "column": 50, + "meta": {} + }, + { + "line": 784, + "column": 50, + "meta": {} + }, + { + "line": 787, + "column": 50, + "meta": {} + }, + { + "line": 858, + "column": 9, + "meta": {} + }, + { + "line": 861, + "column": 11, + "meta": {} + }, + { + "line": 863, + "column": 17, + "meta": {} + }, + { + "line": 864, + "column": 9, + "meta": {} + }, + { + "line": 866, + "column": 19, + "meta": {} + }, + { + "line": 870, + "column": 11, + "meta": {} + }, + { + "line": 871, + "column": 9, + "meta": {} + }, + { + "line": 873, + "column": 5, + "meta": {} + }, + { + "line": 874, + "column": 5, + "meta": {} + }, + { + "line": 875, + "column": 5, + "meta": {} + }, + { + "line": 878, + "column": 11, + "meta": {} + }, + { + "line": 879, + "column": 17, + "meta": {} + }, + { + "line": 883, + "column": 16, + "meta": {} + }, + { + "line": 884, + "column": 14, + "meta": {} + }, + { + "line": 885, + "column": 13, + "meta": {} + }, + { + "line": 894, + "column": 19, + "meta": {} + }, + { + "line": 897, + "column": 11, + "meta": {} + }, + { + "line": 898, + "column": 17, + "meta": {} + }, + { + "line": 899, + "column": 9, + "meta": {} + }, + { + "line": 900, + "column": 14, + "meta": {} + }, + { + "line": 901, + "column": 9, + "meta": {} + }, + { + "line": 904, + "column": 19, + "meta": {} + }, + { + "line": 907, + "column": 11, + "meta": {} + }, + { + "line": 908, + "column": 9, + "meta": {} + }, + { + "line": 913, + "column": 18, + "meta": {} + }, + { + "line": 919, + "column": 11, + "meta": {} + }, + { + "line": 920, + "column": 9, + "meta": {} + }, + { + "line": 925, + "column": 18, + "meta": {} + }, + { + "line": 934, + "column": 11, + "meta": {} + }, + { + "line": 935, + "column": 17, + "meta": {} + }, + { + "line": 937, + "column": 9, + "meta": {} + }, + { + "line": 939, + "column": 25, + "meta": {} + }, + { + "line": 940, + "column": 17, + "meta": {} + }, + { + "line": 943, + "column": 40, + "meta": {} + }, + { + "line": 950, + "column": 9, + "meta": {} + }, + { + "line": 951, + "column": 19, + "meta": {} + }, + { + "line": 1001, + "column": 44, + "meta": {} + }, + { + "line": 1002, + "column": 24, + "meta": {} + }, + { + "line": 1003, + "column": 46, + "meta": {} + }, + { + "line": 1013, + "column": 44, + "meta": {} + }, + { + "line": 1014, + "column": 24, + "meta": {} + }, + { + "line": 1015, + "column": 46, + "meta": {} + }, + { + "line": 1121, + "column": 17, + "meta": {} + }, + { + "line": 1126, + "column": 21, + "meta": {} + }, + { + "line": 1139, + "column": 17, + "meta": {} + }, + { + "line": 1141, + "column": 21, + "meta": {} + }, + { + "line": 1169, + "column": 29, + "meta": {} + }, + { + "line": 1176, + "column": 29, + "meta": {} + }, + { + "line": 1183, + "column": 25, + "meta": {} + }, + { + "line": 1201, + "column": 25, + "meta": {} + }, + { + "line": 1202, + "column": 25, + "meta": {} + }, + { + "line": 1204, + "column": 29, + "meta": {} + }, + { + "line": 1206, + "column": 29, + "meta": {} + }, + { + "line": 1209, + "column": 29, + "meta": {} + }, + { + "line": 1224, + "column": 25, + "meta": {} + }, + { + "line": 1462, + "column": 16, + "meta": {} + }, + { + "line": 1606, + "column": 9, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "extstore.c", + "locations": [ + { + "line": 31, + "column": 42, + "meta": {} + }, + { + "line": 32, + "column": 45, + "meta": {} + }, + { + "line": 34, + "column": 28, + "meta": {} + }, + { + "line": 35, + "column": 8, + "meta": {} + }, + { + "line": 36, + "column": 30, + "meta": {} + }, + { + "line": 40, + "column": 28, + "meta": {} + }, + { + "line": 41, + "column": 8, + "meta": {} + }, + { + "line": 42, + "column": 30, + "meta": {} + }, + { + "line": 110, + "column": 21, + "meta": {} + }, + { + "line": 111, + "column": 21, + "meta": {} + }, + { + "line": 157, + "column": 11, + "meta": {} + }, + { + "line": 158, + "column": 19, + "meta": {} + }, + { + "line": 161, + "column": 20, + "meta": {} + }, + { + "line": 181, + "column": 56, + "meta": {} + }, + { + "line": 184, + "column": 30, + "meta": {} + }, + { + "line": 328, + "column": 25, + "meta": {} + }, + { + "line": 329, + "column": 8, + "meta": {} + }, + { + "line": 331, + "column": 8, + "meta": {} + }, + { + "line": 332, + "column": 8, + "meta": {} + }, + { + "line": 351, + "column": 28, + "meta": {} + }, + { + "line": 579, + "column": 8, + "meta": {} + }, + { + "line": 580, + "column": 8, + "meta": {} + }, + { + "line": 581, + "column": 8, + "meta": {} + }, + { + "line": 582, + "column": 8, + "meta": {} + }, + { + "line": 649, + "column": 12, + "meta": {} + }, + { + "line": 650, + "column": 12, + "meta": {} + }, + { + "line": 768, + "column": 28, + "meta": {} + }, + { + "line": 769, + "column": 28, + "meta": {} + }, + { + "line": 832, + "column": 8, + "meta": {} + }, + { + "line": 833, + "column": 8, + "meta": {} + }, + { + "line": 834, + "column": 8, + "meta": {} + }, + { + "line": 949, + "column": 20, + "meta": {} + }, + { + "line": 950, + "column": 20, + "meta": {} + }, + { + "line": 951, + "column": 20, + "meta": {} + }, + { + "line": 961, + "column": 16, + "meta": {} + }, + { + "line": 963, + "column": 19, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "slab_automove.c", + "locations": [ + { + "line": 28, + "column": 10, + "meta": {} + }, + { + "line": 29, + "column": 10, + "meta": {} + }, + { + "line": 30, + "column": 10, + "meta": {} + }, + { + "line": 31, + "column": 10, + "meta": {} + }, + { + "line": 49, + "column": 15, + "meta": {} + }, + { + "line": 50, + "column": 15, + "meta": {} + }, + { + "line": 87, + "column": 15, + "meta": {} + }, + { + "line": 88, + "column": 15, + "meta": {} + }, + { + "line": 155, + "column": 25, + "meta": {} + }, + { + "line": 157, + "column": 25, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "proto_text.c", + "locations": [ + { + "line": 34, + "column": 36, + "meta": {} + }, + { + "line": 35, + "column": 16, + "meta": {} + }, + { + "line": 36, + "column": 38, + "meta": {} + }, + { + "line": 347, + "column": 40, + "meta": {} + }, + { + "line": 348, + "column": 20, + "meta": {} + }, + { + "line": 349, + "column": 42, + "meta": {} + }, + { + "line": 352, + "column": 40, + "meta": {} + }, + { + "line": 353, + "column": 20, + "meta": {} + }, + { + "line": 354, + "column": 20, + "meta": {} + }, + { + "line": 355, + "column": 42, + "meta": {} + }, + { + "line": 497, + "column": 17, + "meta": {} + }, + { + "line": 524, + "column": 58, + "meta": {} + }, + { + "line": 525, + "column": 38, + "meta": {} + }, + { + "line": 526, + "column": 60, + "meta": {} + }, + { + "line": 555, + "column": 48, + "meta": {} + }, + { + "line": 557, + "column": 32, + "meta": {} + }, + { + "line": 558, + "column": 32, + "meta": {} + }, + { + "line": 560, + "column": 32, + "meta": {} + }, + { + "line": 561, + "column": 32, + "meta": {} + }, + { + "line": 563, + "column": 50, + "meta": {} + }, + { + "line": 573, + "column": 48, + "meta": {} + }, + { + "line": 575, + "column": 32, + "meta": {} + }, + { + "line": 576, + "column": 32, + "meta": {} + }, + { + "line": 578, + "column": 32, + "meta": {} + }, + { + "line": 579, + "column": 32, + "meta": {} + }, + { + "line": 582, + "column": 50, + "meta": {} + }, + { + "line": 638, + "column": 28, + "meta": {} + }, + { + "line": 651, + "column": 15, + "meta": {} + }, + { + "line": 652, + "column": 27, + "meta": {} + }, + { + "line": 655, + "column": 44, + "meta": {} + }, + { + "line": 669, + "column": 16, + "meta": {} + }, + { + "line": 670, + "column": 19, + "meta": {} + }, + { + "line": 672, + "column": 9, + "meta": {} + }, + { + "line": 678, + "column": 21, + "meta": {} + }, + { + "line": 680, + "column": 21, + "meta": {} + }, + { + "line": 684, + "column": 39, + "meta": {} + }, + { + "line": 690, + "column": 41, + "meta": {} + }, + { + "line": 714, + "column": 17, + "meta": {} + }, + { + "line": 717, + "column": 26, + "meta": {} + }, + { + "line": 722, + "column": 17, + "meta": {} + }, + { + "line": 723, + "column": 20, + "meta": {} + }, + { + "line": 724, + "column": 70, + "meta": {} + }, + { + "line": 726, + "column": 38, + "meta": {} + }, + { + "line": 727, + "column": 20, + "meta": {} + }, + { + "line": 736, + "column": 12, + "meta": {} + }, + { + "line": 738, + "column": 12, + "meta": {} + }, + { + "line": 739, + "column": 62, + "meta": {} + }, + { + "line": 741, + "column": 30, + "meta": {} + }, + { + "line": 742, + "column": 12, + "meta": {} + }, + { + "line": 790, + "column": 36, + "meta": {} + }, + { + "line": 791, + "column": 16, + "meta": {} + }, + { + "line": 792, + "column": 38, + "meta": {} + }, + { + "line": 1169, + "column": 52, + "meta": {} + }, + { + "line": 1170, + "column": 32, + "meta": {} + }, + { + "line": 1171, + "column": 54, + "meta": {} + }, + { + "line": 1224, + "column": 40, + "meta": {} + }, + { + "line": 1226, + "column": 24, + "meta": {} + }, + { + "line": 1227, + "column": 24, + "meta": {} + }, + { + "line": 1229, + "column": 24, + "meta": {} + }, + { + "line": 1230, + "column": 24, + "meta": {} + }, + { + "line": 1232, + "column": 42, + "meta": {} + }, + { + "line": 1236, + "column": 40, + "meta": {} + }, + { + "line": 1238, + "column": 24, + "meta": {} + }, + { + "line": 1239, + "column": 24, + "meta": {} + }, + { + "line": 1241, + "column": 24, + "meta": {} + }, + { + "line": 1242, + "column": 24, + "meta": {} + }, + { + "line": 1245, + "column": 42, + "meta": {} + }, + { + "line": 1496, + "column": 44, + "meta": {} + }, + { + "line": 1497, + "column": 24, + "meta": {} + }, + { + "line": 1498, + "column": 46, + "meta": {} + }, + { + "line": 1522, + "column": 44, + "meta": {} + }, + { + "line": 1523, + "column": 24, + "meta": {} + }, + { + "line": 1524, + "column": 46, + "meta": {} + }, + { + "line": 1534, + "column": 40, + "meta": {} + }, + { + "line": 1535, + "column": 20, + "meta": {} + }, + { + "line": 1536, + "column": 42, + "meta": {} + }, + { + "line": 1662, + "column": 44, + "meta": {} + }, + { + "line": 1664, + "column": 28, + "meta": {} + }, + { + "line": 1666, + "column": 28, + "meta": {} + }, + { + "line": 1668, + "column": 46, + "meta": {} + }, + { + "line": 1831, + "column": 9, + "meta": {} + }, + { + "line": 1908, + "column": 40, + "meta": {} + }, + { + "line": 1909, + "column": 20, + "meta": {} + }, + { + "line": 1910, + "column": 20, + "meta": {} + }, + { + "line": 1911, + "column": 42, + "meta": {} + }, + { + "line": 1916, + "column": 40, + "meta": {} + }, + { + "line": 1917, + "column": 20, + "meta": {} + }, + { + "line": 1918, + "column": 20, + "meta": {} + }, + { + "line": 1919, + "column": 42, + "meta": {} + }, + { + "line": 1959, + "column": 40, + "meta": {} + }, + { + "line": 1961, + "column": 24, + "meta": {} + }, + { + "line": 1963, + "column": 24, + "meta": {} + }, + { + "line": 1965, + "column": 42, + "meta": {} + }, + { + "line": 2005, + "column": 9, + "meta": {} + }, + { + "line": 2012, + "column": 40, + "meta": {} + }, + { + "line": 2013, + "column": 20, + "meta": {} + }, + { + "line": 2014, + "column": 42, + "meta": {} + }, + { + "line": 2021, + "column": 40, + "meta": {} + }, + { + "line": 2022, + "column": 20, + "meta": {} + }, + { + "line": 2023, + "column": 42, + "meta": {} + }, + { + "line": 2302, + "column": 36, + "meta": {} + }, + { + "line": 2303, + "column": 16, + "meta": {} + }, + { + "line": 2304, + "column": 38, + "meta": {} + }, + { + "line": 2307, + "column": 54, + "meta": {} + }, + { + "line": 2617, + "column": 57, + "meta": {} + } + ] + } +] + diff --git a/targets/locations_memcached_stats_filtered.json b/targets/locations_memcached_stats_filtered.json new file mode 100644 index 0000000000..e371ddb09a --- /dev/null +++ b/targets/locations_memcached_stats_filtered.json @@ -0,0 +1,3956 @@ +[ + { + "term": "cmd", + "file": "tls.c", + "locations": [ + { + "line": 243, + "column": 5, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "thread.c", + "locations": [ + { + "line": 61, + "column": 20, + "meta": {} + }, + { + "line": 62, + "column": 24, + "meta": {} + }, + { + "line": 326, + "column": 13, + "meta": {} + }, + { + "line": 422, + "column": 33, + "meta": {} + }, + { + "line": 778, + "column": 25, + "meta": {} + }, + { + "line": 782, + "column": 27, + "meta": {} + }, + { + "line": 785, + "column": 18, + "meta": {} + }, + { + "line": 788, + "column": 41, + "meta": {} + }, + { + "line": 789, + "column": 29, + "meta": {} + }, + { + "line": 796, + "column": 29, + "meta": {} + }, + { + "line": 797, + "column": 36, + "meta": {} + }, + { + "line": 798, + "column": 29, + "meta": {} + }, + { + "line": 801, + "column": 43, + "meta": {} + }, + { + "line": 805, + "column": 18, + "meta": {} + }, + { + "line": 810, + "column": 12, + "meta": {} + }, + { + "line": 813, + "column": 41, + "meta": {} + }, + { + "line": 814, + "column": 17, + "meta": {} + }, + { + "line": 822, + "column": 17, + "meta": {} + }, + { + "line": 823, + "column": 25, + "meta": {} + }, + { + "line": 829, + "column": 13, + "meta": {} + }, + { + "line": 830, + "column": 29, + "meta": {} + }, + { + "line": 831, + "column": 13, + "meta": {} + }, + { + "line": 832, + "column": 29, + "meta": {} + }, + { + "line": 835, + "column": 9, + "meta": {} + }, + { + "line": 836, + "column": 9, + "meta": {} + }, + { + "line": 837, + "column": 9, + "meta": {} + }, + { + "line": 838, + "column": 43, + "meta": {} + }, + { + "line": 842, + "column": 11, + "meta": {} + }, + { + "line": 848, + "column": 30, + "meta": {} + }, + { + "line": 929, + "column": 9, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "storage.c", + "locations": [ + { + "line": 238, + "column": 10, + "meta": {} + }, + { + "line": 245, + "column": 21, + "meta": {} + }, + { + "line": 253, + "column": 18, + "meta": {} + }, + { + "line": 408, + "column": 5, + "meta": {} + }, + { + "line": 409, + "column": 5, + "meta": {} + }, + { + "line": 410, + "column": 5, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "stats_prefix.c", + "locations": [ + { + "line": 10, + "column": 29, + "meta": {} + }, + { + "line": 16, + "column": 6, + "meta": {} + }, + { + "line": 18, + "column": 19, + "meta": {} + }, + { + "line": 21, + "column": 6, + "meta": {} + }, + { + "line": 26, + "column": 27, + "meta": {} + }, + { + "line": 31, + "column": 16, + "meta": {} + }, + { + "line": 37, + "column": 15, + "meta": {} + }, + { + "line": 58, + "column": 23, + "meta": {} + }, + { + "line": 65, + "column": 42, + "meta": {} + }, + { + "line": 80, + "column": 24, + "meta": {} + }, + { + "line": 81, + "column": 12, + "meta": {} + }, + { + "line": 89, + "column": 6, + "meta": {} + }, + { + "line": 93, + "column": 11, + "meta": {} + }, + { + "line": 103, + "column": 6, + "meta": {} + }, + { + "line": 107, + "column": 11, + "meta": {} + }, + { + "line": 114, + "column": 6, + "meta": {} + }, + { + "line": 118, + "column": 11, + "meta": {} + }, + { + "line": 125, + "column": 7, + "meta": {} + }, + { + "line": 145, + "column": 32, + "meta": {} + }, + { + "line": 152, + "column": 27, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "testapp.c", + "locations": [ + { + "line": 25, + "column": 11, + "meta": {} + }, + { + "line": 247, + "column": 30, + "meta": {} + }, + { + "line": 250, + "column": 5, + "meta": {} + }, + { + "line": 251, + "column": 12, + "meta": {} + }, + { + "line": 253, + "column": 12, + "meta": {} + }, + { + "line": 256, + "column": 12, + "meta": {} + }, + { + "line": 259, + "column": 12, + "meta": {} + }, + { + "line": 261, + "column": 12, + "meta": {} + }, + { + "line": 263, + "column": 12, + "meta": {} + }, + { + "line": 265, + "column": 12, + "meta": {} + }, + { + "line": 270, + "column": 30, + "meta": {} + }, + { + "line": 272, + "column": 5, + "meta": {} + }, + { + "line": 274, + "column": 5, + "meta": {} + }, + { + "line": 275, + "column": 11, + "meta": {} + }, + { + "line": 278, + "column": 5, + "meta": {} + }, + { + "line": 281, + "column": 5, + "meta": {} + }, + { + "line": 284, + "column": 5, + "meta": {} + }, + { + "line": 290, + "column": 30, + "meta": {} + }, + { + "line": 292, + "column": 5, + "meta": {} + }, + { + "line": 294, + "column": 5, + "meta": {} + }, + { + "line": 295, + "column": 11, + "meta": {} + }, + { + "line": 300, + "column": 5, + "meta": {} + }, + { + "line": 305, + "column": 30, + "meta": {} + }, + { + "line": 307, + "column": 5, + "meta": {} + }, + { + "line": 309, + "column": 5, + "meta": {} + }, + { + "line": 310, + "column": 11, + "meta": {} + }, + { + "line": 315, + "column": 5, + "meta": {} + }, + { + "line": 320, + "column": 30, + "meta": {} + }, + { + "line": 328, + "column": 5, + "meta": {} + }, + { + "line": 330, + "column": 37, + "meta": {} + }, + { + "line": 332, + "column": 5, + "meta": {} + }, + { + "line": 335, + "column": 36, + "meta": {} + }, + { + "line": 337, + "column": 5, + "meta": {} + }, + { + "line": 340, + "column": 36, + "meta": {} + }, + { + "line": 342, + "column": 5, + "meta": {} + }, + { + "line": 345, + "column": 36, + "meta": {} + }, + { + "line": 347, + "column": 5, + "meta": {} + }, + { + "line": 350, + "column": 36, + "meta": {} + }, + { + "line": 353, + "column": 5, + "meta": {} + }, + { + "line": 357, + "column": 11, + "meta": {} + }, + { + "line": 374, + "column": 5, + "meta": {} + }, + { + "line": 375, + "column": 11, + "meta": {} + }, + { + "line": 384, + "column": 5, + "meta": {} + }, + { + "line": 840, + "column": 25, + "meta": {} + }, + { + "line": 845, + "column": 25, + "meta": {} + }, + { + "line": 2154, + "column": 28, + "meta": {} + }, + { + "line": 2240, + "column": 8, + "meta": {} + }, + { + "line": 2241, + "column": 8, + "meta": {} + }, + { + "line": 2242, + "column": 8, + "meta": {} + }, + { + "line": 2243, + "column": 8, + "meta": {} + }, + { + "line": 2244, + "column": 8, + "meta": {} + }, + { + "line": 2317, + "column": 5, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "slab_automove_extstore.c", + "locations": [ + { + "line": 43, + "column": 10, + "meta": {} + }, + { + "line": 44, + "column": 10, + "meta": {} + }, + { + "line": 45, + "column": 10, + "meta": {} + }, + { + "line": 46, + "column": 10, + "meta": {} + }, + { + "line": 74, + "column": 15, + "meta": {} + }, + { + "line": 75, + "column": 15, + "meta": {} + }, + { + "line": 142, + "column": 14, + "meta": {} + }, + { + "line": 180, + "column": 15, + "meta": {} + }, + { + "line": 181, + "column": 15, + "meta": {} + }, + { + "line": 264, + "column": 25, + "meta": {} + }, + { + "line": 266, + "column": 25, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "slabs.c", + "locations": [ + { + "line": 524, + "column": 36, + "meta": {} + }, + { + "line": 527, + "column": 16, + "meta": {} + }, + { + "line": 532, + "column": 14, + "meta": {} + }, + { + "line": 555, + "column": 22, + "meta": {} + }, + { + "line": 557, + "column": 27, + "meta": {} + }, + { + "line": 558, + "column": 19, + "meta": {} + }, + { + "line": 559, + "column": 17, + "meta": {} + }, + { + "line": 583, + "column": 48, + "meta": {} + }, + { + "line": 585, + "column": 48, + "meta": {} + }, + { + "line": 587, + "column": 48, + "meta": {} + }, + { + "line": 589, + "column": 48, + "meta": {} + }, + { + "line": 591, + "column": 48, + "meta": {} + }, + { + "line": 593, + "column": 48, + "meta": {} + }, + { + "line": 595, + "column": 48, + "meta": {} + }, + { + "line": 597, + "column": 48, + "meta": {} + }, + { + "line": 602, + "column": 25, + "meta": {} + }, + { + "line": 606, + "column": 9, + "meta": {} + }, + { + "line": 671, + "column": 12, + "meta": {} + }, + { + "line": 673, + "column": 14, + "meta": {} + }, + { + "line": 781, + "column": 5, + "meta": {} + }, + { + "line": 1096, + "column": 13, + "meta": {} + }, + { + "line": 1184, + "column": 5, + "meta": {} + }, + { + "line": 1185, + "column": 5, + "meta": {} + }, + { + "line": 1186, + "column": 5, + "meta": {} + }, + { + "line": 1187, + "column": 5, + "meta": {} + }, + { + "line": 1188, + "column": 5, + "meta": {} + }, + { + "line": 1189, + "column": 5, + "meta": {} + }, + { + "line": 1190, + "column": 5, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "crawler.c", + "locations": [ + { + "line": 149, + "column": 23, + "meta": {} + }, + { + "line": 151, + "column": 19, + "meta": {} + }, + { + "line": 152, + "column": 19, + "meta": {} + }, + { + "line": 161, + "column": 15, + "meta": {} + }, + { + "line": 162, + "column": 15, + "meta": {} + }, + { + "line": 184, + "column": 12, + "meta": {} + }, + { + "line": 346, + "column": 13, + "meta": {} + }, + { + "line": 457, + "column": 5, + "meta": {} + }, + { + "line": 559, + "column": 9, + "meta": {} + }, + { + "line": 560, + "column": 9, + "meta": {} + }, + { + "line": 589, + "column": 18, + "meta": {} + }, + { + "line": 641, + "column": 31, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "sizes.c", + "locations": [ + { + "line": 11, + "column": 46, + "meta": {} + }, + { + "line": 12, + "column": 21, + "meta": {} + }, + { + "line": 13, + "column": 34, + "meta": {} + }, + { + "line": 14, + "column": 41, + "meta": {} + }, + { + "line": 15, + "column": 21, + "meta": {} + }, + { + "line": 23, + "column": 60, + "meta": {} + }, + { + "line": 32, + "column": 21, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "assoc.c", + "locations": [ + { + "line": 68, + "column": 5, + "meta": {} + }, + { + "line": 69, + "column": 5, + "meta": {} + }, + { + "line": 132, + "column": 9, + "meta": {} + }, + { + "line": 133, + "column": 9, + "meta": {} + }, + { + "line": 134, + "column": 9, + "meta": {} + }, + { + "line": 227, + "column": 25, + "meta": {} + }, + { + "line": 228, + "column": 25, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "proto_bin.c", + "locations": [ + { + "line": 338, + "column": 44, + "meta": {} + }, + { + "line": 340, + "column": 28, + "meta": {} + }, + { + "line": 342, + "column": 28, + "meta": {} + }, + { + "line": 344, + "column": 46, + "meta": {} + }, + { + "line": 361, + "column": 36, + "meta": {} + }, + { + "line": 362, + "column": 16, + "meta": {} + }, + { + "line": 363, + "column": 38, + "meta": {} + }, + { + "line": 485, + "column": 40, + "meta": {} + }, + { + "line": 487, + "column": 24, + "meta": {} + }, + { + "line": 488, + "column": 24, + "meta": {} + }, + { + "line": 490, + "column": 24, + "meta": {} + }, + { + "line": 491, + "column": 24, + "meta": {} + }, + { + "line": 493, + "column": 42, + "meta": {} + }, + { + "line": 527, + "column": 52, + "meta": {} + }, + { + "line": 528, + "column": 32, + "meta": {} + }, + { + "line": 529, + "column": 54, + "meta": {} + }, + { + "line": 569, + "column": 40, + "meta": {} + }, + { + "line": 571, + "column": 24, + "meta": {} + }, + { + "line": 572, + "column": 24, + "meta": {} + }, + { + "line": 574, + "column": 24, + "meta": {} + }, + { + "line": 575, + "column": 24, + "meta": {} + }, + { + "line": 577, + "column": 42, + "meta": {} + }, + { + "line": 597, + "column": 9, + "meta": {} + }, + { + "line": 616, + "column": 16, + "meta": {} + }, + { + "line": 617, + "column": 19, + "meta": {} + }, + { + "line": 619, + "column": 9, + "meta": {} + }, + { + "line": 621, + "column": 39, + "meta": {} + }, + { + "line": 626, + "column": 30, + "meta": {} + }, + { + "line": 628, + "column": 73, + "meta": {} + }, + { + "line": 633, + "column": 24, + "meta": {} + }, + { + "line": 645, + "column": 17, + "meta": {} + }, + { + "line": 646, + "column": 20, + "meta": {} + }, + { + "line": 647, + "column": 73, + "meta": {} + }, + { + "line": 649, + "column": 38, + "meta": {} + }, + { + "line": 650, + "column": 20, + "meta": {} + }, + { + "line": 660, + "column": 12, + "meta": {} + }, + { + "line": 661, + "column": 12, + "meta": {} + }, + { + "line": 662, + "column": 72, + "meta": {} + }, + { + "line": 664, + "column": 30, + "meta": {} + }, + { + "line": 665, + "column": 12, + "meta": {} + }, + { + "line": 835, + "column": 40, + "meta": {} + }, + { + "line": 836, + "column": 20, + "meta": {} + }, + { + "line": 837, + "column": 42, + "meta": {} + }, + { + "line": 851, + "column": 40, + "meta": {} + }, + { + "line": 852, + "column": 20, + "meta": {} + }, + { + "line": 853, + "column": 20, + "meta": {} + }, + { + "line": 854, + "column": 42, + "meta": {} + }, + { + "line": 1109, + "column": 9, + "meta": {} + }, + { + "line": 1199, + "column": 9, + "meta": {} + }, + { + "line": 1251, + "column": 52, + "meta": {} + }, + { + "line": 1273, + "column": 36, + "meta": {} + }, + { + "line": 1274, + "column": 16, + "meta": {} + }, + { + "line": 1275, + "column": 38, + "meta": {} + }, + { + "line": 1299, + "column": 9, + "meta": {} + }, + { + "line": 1307, + "column": 44, + "meta": {} + }, + { + "line": 1308, + "column": 24, + "meta": {} + }, + { + "line": 1309, + "column": 46, + "meta": {} + }, + { + "line": 1319, + "column": 40, + "meta": {} + }, + { + "line": 1320, + "column": 20, + "meta": {} + }, + { + "line": 1321, + "column": 42, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "logger.c", + "locations": [ + { + "line": 251, + "column": 89, + "meta": {} + }, + { + "line": 289, + "column": 66, + "meta": {} + }, + { + "line": 352, + "column": 56, + "meta": {} + }, + { + "line": 374, + "column": 22, + "meta": {} + }, + { + "line": 504, + "column": 31, + "meta": {} + }, + { + "line": 506, + "column": 5, + "meta": {} + }, + { + "line": 507, + "column": 5, + "meta": {} + }, + { + "line": 508, + "column": 5, + "meta": {} + }, + { + "line": 509, + "column": 5, + "meta": {} + }, + { + "line": 525, + "column": 23, + "meta": {} + }, + { + "line": 526, + "column": 45, + "meta": {} + }, + { + "line": 553, + "column": 27, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "globals.c", + "locations": [ + { + "line": 22, + "column": 8, + "meta": {} + }, + { + "line": 23, + "column": 8, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "memcached.c", + "locations": [ + { + "line": 91, + "column": 4, + "meta": {} + }, + { + "line": 92, + "column": 13, + "meta": {} + }, + { + "line": 111, + "column": 8, + "meta": {} + }, + { + "line": 112, + "column": 8, + "meta": {} + }, + { + "line": 202, + "column": 13, + "meta": {} + }, + { + "line": 203, + "column": 13, + "meta": {} + }, + { + "line": 204, + "column": 13, + "meta": {} + }, + { + "line": 205, + "column": 5, + "meta": {} + }, + { + "line": 212, + "column": 5, + "meta": {} + }, + { + "line": 215, + "column": 6, + "meta": {} + }, + { + "line": 217, + "column": 13, + "meta": {} + }, + { + "line": 218, + "column": 5, + "meta": {} + }, + { + "line": 220, + "column": 17, + "meta": {} + }, + { + "line": 221, + "column": 10, + "meta": {} + }, + { + "line": 417, + "column": 24, + "meta": {} + }, + { + "line": 514, + "column": 40, + "meta": {} + }, + { + "line": 515, + "column": 20, + "meta": {} + }, + { + "line": 516, + "column": 42, + "meta": {} + }, + { + "line": 563, + "column": 13, + "meta": {} + }, + { + "line": 584, + "column": 13, + "meta": {} + }, + { + "line": 591, + "column": 9, + "meta": {} + }, + { + "line": 717, + "column": 5, + "meta": {} + }, + { + "line": 718, + "column": 5, + "meta": {} + }, + { + "line": 738, + "column": 40, + "meta": {} + }, + { + "line": 739, + "column": 20, + "meta": {} + }, + { + "line": 740, + "column": 42, + "meta": {} + }, + { + "line": 747, + "column": 40, + "meta": {} + }, + { + "line": 748, + "column": 20, + "meta": {} + }, + { + "line": 750, + "column": 24, + "meta": {} + }, + { + "line": 751, + "column": 42, + "meta": {} + }, + { + "line": 772, + "column": 48, + "meta": {} + }, + { + "line": 773, + "column": 28, + "meta": {} + }, + { + "line": 774, + "column": 50, + "meta": {} + }, + { + "line": 908, + "column": 5, + "meta": {} + }, + { + "line": 1048, + "column": 24, + "meta": {} + }, + { + "line": 1096, + "column": 24, + "meta": {} + }, + { + "line": 1119, + "column": 20, + "meta": {} + }, + { + "line": 1123, + "column": 21, + "meta": {} + }, + { + "line": 1125, + "column": 16, + "meta": {} + }, + { + "line": 1174, + "column": 16, + "meta": {} + }, + { + "line": 1252, + "column": 24, + "meta": {} + }, + { + "line": 1255, + "column": 20, + "meta": {} + }, + { + "line": 1278, + "column": 8, + "meta": {} + }, + { + "line": 1281, + "column": 26, + "meta": {} + }, + { + "line": 1284, + "column": 20, + "meta": {} + }, + { + "line": 1286, + "column": 24, + "meta": {} + }, + { + "line": 1297, + "column": 8, + "meta": {} + }, + { + "line": 1300, + "column": 18, + "meta": {} + }, + { + "line": 1301, + "column": 23, + "meta": {} + }, + { + "line": 1302, + "column": 35, + "meta": {} + }, + { + "line": 1306, + "column": 12, + "meta": {} + }, + { + "line": 1308, + "column": 24, + "meta": {} + }, + { + "line": 1314, + "column": 32, + "meta": {} + }, + { + "line": 1317, + "column": 21, + "meta": {} + }, + { + "line": 1318, + "column": 32, + "meta": {} + }, + { + "line": 1320, + "column": 16, + "meta": {} + }, + { + "line": 1321, + "column": 16, + "meta": {} + }, + { + "line": 1324, + "column": 13, + "meta": {} + }, + { + "line": 1333, + "column": 13, + "meta": {} + }, + { + "line": 1346, + "column": 19, + "meta": {} + }, + { + "line": 1349, + "column": 20, + "meta": {} + }, + { + "line": 1352, + "column": 19, + "meta": {} + }, + { + "line": 1355, + "column": 22, + "meta": {} + }, + { + "line": 1358, + "column": 15, + "meta": {} + }, + { + "line": 1532, + "column": 41, + "meta": {} + }, + { + "line": 1533, + "column": 52, + "meta": {} + }, + { + "line": 1534, + "column": 32, + "meta": {} + }, + { + "line": 1535, + "column": 54, + "meta": {} + }, + { + "line": 1548, + "column": 52, + "meta": {} + }, + { + "line": 1549, + "column": 32, + "meta": {} + }, + { + "line": 1550, + "column": 54, + "meta": {} + }, + { + "line": 1554, + "column": 52, + "meta": {} + }, + { + "line": 1555, + "column": 32, + "meta": {} + }, + { + "line": 1556, + "column": 54, + "meta": {} + }, + { + "line": 1629, + "column": 48, + "meta": {} + }, + { + "line": 1630, + "column": 28, + "meta": {} + }, + { + "line": 1631, + "column": 50, + "meta": {} + }, + { + "line": 1655, + "column": 65, + "meta": {} + }, + { + "line": 1663, + "column": 62, + "meta": {} + }, + { + "line": 1667, + "column": 49, + "meta": {} + }, + { + "line": 1674, + "column": 16, + "meta": {} + }, + { + "line": 1682, + "column": 9, + "meta": {} + }, + { + "line": 1685, + "column": 27, + "meta": {} + }, + { + "line": 1686, + "column": 13, + "meta": {} + }, + { + "line": 1690, + "column": 19, + "meta": {} + }, + { + "line": 1691, + "column": 17, + "meta": {} + }, + { + "line": 1692, + "column": 17, + "meta": {} + }, + { + "line": 1693, + "column": 10, + "meta": {} + }, + { + "line": 1695, + "column": 21, + "meta": {} + }, + { + "line": 1712, + "column": 36, + "meta": {} + }, + { + "line": 1715, + "column": 38, + "meta": {} + }, + { + "line": 1721, + "column": 65, + "meta": {} + }, + { + "line": 1722, + "column": 66, + "meta": {} + }, + { + "line": 1724, + "column": 73, + "meta": {} + }, + { + "line": 1726, + "column": 48, + "meta": {} + }, + { + "line": 1727, + "column": 72, + "meta": {} + }, + { + "line": 1728, + "column": 74, + "meta": {} + }, + { + "line": 1729, + "column": 74, + "meta": {} + }, + { + "line": 1730, + "column": 70, + "meta": {} + }, + { + "line": 1731, + "column": 70, + "meta": {} + }, + { + "line": 1732, + "column": 75, + "meta": {} + }, + { + "line": 1733, + "column": 68, + "meta": {} + }, + { + "line": 1734, + "column": 39, + "meta": {} + }, + { + "line": 1735, + "column": 63, + "meta": {} + }, + { + "line": 1736, + "column": 61, + "meta": {} + }, + { + "line": 1737, + "column": 65, + "meta": {} + }, + { + "line": 1738, + "column": 65, + "meta": {} + }, + { + "line": 1739, + "column": 64, + "meta": {} + }, + { + "line": 1740, + "column": 62, + "meta": {} + }, + { + "line": 1741, + "column": 66, + "meta": {} + }, + { + "line": 1742, + "column": 67, + "meta": {} + }, + { + "line": 1743, + "column": 67, + "meta": {} + }, + { + "line": 1746, + "column": 72, + "meta": {} + }, + { + "line": 1747, + "column": 80, + "meta": {} + }, + { + "line": 1748, + "column": 76, + "meta": {} + }, + { + "line": 1749, + "column": 81, + "meta": {} + }, + { + "line": 1750, + "column": 78, + "meta": {} + }, + { + "line": 1751, + "column": 80, + "meta": {} + }, + { + "line": 1754, + "column": 69, + "meta": {} + }, + { + "line": 1755, + "column": 65, + "meta": {} + }, + { + "line": 1756, + "column": 67, + "meta": {} + }, + { + "line": 1757, + "column": 63, + "meta": {} + }, + { + "line": 1758, + "column": 67, + "meta": {} + }, + { + "line": 1759, + "column": 63, + "meta": {} + }, + { + "line": 1760, + "column": 66, + "meta": {} + }, + { + "line": 1761, + "column": 62, + "meta": {} + }, + { + "line": 1762, + "column": 64, + "meta": {} + }, + { + "line": 1763, + "column": 64, + "meta": {} + }, + { + "line": 1764, + "column": 68, + "meta": {} + }, + { + "line": 1765, + "column": 65, + "meta": {} + }, + { + "line": 1766, + "column": 67, + "meta": {} + }, + { + "line": 1768, + "column": 70, + "meta": {} + }, + { + "line": 1770, + "column": 66, + "meta": {} + }, + { + "line": 1771, + "column": 69, + "meta": {} + }, + { + "line": 1773, + "column": 42, + "meta": {} + }, + { + "line": 1774, + "column": 68, + "meta": {} + }, + { + "line": 1775, + "column": 55, + "meta": {} + }, + { + "line": 1777, + "column": 67, + "meta": {} + }, + { + "line": 1778, + "column": 43, + "meta": {} + }, + { + "line": 1779, + "column": 59, + "meta": {} + }, + { + "line": 1780, + "column": 44, + "meta": {} + }, + { + "line": 1782, + "column": 54, + "meta": {} + }, + { + "line": 1783, + "column": 60, + "meta": {} + }, + { + "line": 1784, + "column": 62, + "meta": {} + }, + { + "line": 1785, + "column": 61, + "meta": {} + }, + { + "line": 1786, + "column": 57, + "meta": {} + }, + { + "line": 1787, + "column": 59, + "meta": {} + }, + { + "line": 1788, + "column": 52, + "meta": {} + }, + { + "line": 1789, + "column": 44, + "meta": {} + }, + { + "line": 1792, + "column": 50, + "meta": {} + }, + { + "line": 1793, + "column": 49, + "meta": {} + }, + { + "line": 1796, + "column": 75, + "meta": {} + }, + { + "line": 1799, + "column": 37, + "meta": {} + }, + { + "line": 1800, + "column": 67, + "meta": {} + }, + { + "line": 1801, + "column": 67, + "meta": {} + }, + { + "line": 1802, + "column": 68, + "meta": {} + }, + { + "line": 1803, + "column": 65, + "meta": {} + }, + { + "line": 1808, + "column": 74, + "meta": {} + }, + { + "line": 1809, + "column": 77, + "meta": {} + }, + { + "line": 1810, + "column": 77, + "meta": {} + }, + { + "line": 1812, + "column": 22, + "meta": {} + }, + { + "line": 1834, + "column": 73, + "meta": {} + }, + { + "line": 1836, + "column": 73, + "meta": {} + }, + { + "line": 1842, + "column": 41, + "meta": {} + }, + { + "line": 1843, + "column": 16, + "meta": {} + }, + { + "line": 1896, + "column": 43, + "meta": {} + }, + { + "line": 1931, + "column": 10, + "meta": {} + }, + { + "line": 1934, + "column": 13, + "meta": {} + }, + { + "line": 1938, + "column": 62, + "meta": {} + }, + { + "line": 1939, + "column": 67, + "meta": {} + }, + { + "line": 1940, + "column": 68, + "meta": {} + }, + { + "line": 1943, + "column": 18, + "meta": {} + }, + { + "line": 1945, + "column": 18, + "meta": {} + }, + { + "line": 1947, + "column": 19, + "meta": {} + }, + { + "line": 1949, + "column": 18, + "meta": {} + }, + { + "line": 1951, + "column": 18, + "meta": {} + }, + { + "line": 1953, + "column": 18, + "meta": {} + }, + { + "line": 2073, + "column": 14, + "meta": {} + }, + { + "line": 2082, + "column": 16, + "meta": {} + }, + { + "line": 2111, + "column": 23, + "meta": {} + }, + { + "line": 2116, + "column": 21, + "meta": {} + }, + { + "line": 2118, + "column": 16, + "meta": {} + }, + { + "line": 2121, + "column": 18, + "meta": {} + }, + { + "line": 2415, + "column": 36, + "meta": {} + }, + { + "line": 2416, + "column": 16, + "meta": {} + }, + { + "line": 2417, + "column": 38, + "meta": {} + }, + { + "line": 2484, + "column": 36, + "meta": {} + }, + { + "line": 2486, + "column": 20, + "meta": {} + }, + { + "line": 2488, + "column": 20, + "meta": {} + }, + { + "line": 2490, + "column": 38, + "meta": {} + }, + { + "line": 2503, + "column": 14, + "meta": {} + }, + { + "line": 2505, + "column": 14, + "meta": {} + }, + { + "line": 2598, + "column": 40, + "meta": {} + }, + { + "line": 2599, + "column": 20, + "meta": {} + }, + { + "line": 2600, + "column": 42, + "meta": {} + }, + { + "line": 2656, + "column": 17, + "meta": {} + }, + { + "line": 2673, + "column": 44, + "meta": {} + }, + { + "line": 2674, + "column": 24, + "meta": {} + }, + { + "line": 2675, + "column": 46, + "meta": {} + }, + { + "line": 2739, + "column": 39, + "meta": {} + }, + { + "line": 2740, + "column": 42, + "meta": {} + }, + { + "line": 2741, + "column": 9, + "meta": {} + }, + { + "line": 2742, + "column": 9, + "meta": {} + }, + { + "line": 2746, + "column": 9, + "meta": {} + }, + { + "line": 2747, + "column": 23, + "meta": {} + }, + { + "line": 2748, + "column": 9, + "meta": {} + }, + { + "line": 2908, + "column": 40, + "meta": {} + }, + { + "line": 2909, + "column": 20, + "meta": {} + }, + { + "line": 2910, + "column": 42, + "meta": {} + }, + { + "line": 3044, + "column": 40, + "meta": {} + }, + { + "line": 3045, + "column": 20, + "meta": {} + }, + { + "line": 3046, + "column": 42, + "meta": {} + }, + { + "line": 3132, + "column": 48, + "meta": {} + }, + { + "line": 3133, + "column": 28, + "meta": {} + }, + { + "line": 3134, + "column": 50, + "meta": {} + }, + { + "line": 3224, + "column": 26, + "meta": {} + }, + { + "line": 3226, + "column": 21, + "meta": {} + }, + { + "line": 3272, + "column": 29, + "meta": {} + }, + { + "line": 3356, + "column": 48, + "meta": {} + }, + { + "line": 3357, + "column": 28, + "meta": {} + }, + { + "line": 3358, + "column": 50, + "meta": {} + }, + { + "line": 3409, + "column": 52, + "meta": {} + }, + { + "line": 3410, + "column": 32, + "meta": {} + }, + { + "line": 3411, + "column": 54, + "meta": {} + }, + { + "line": 3484, + "column": 48, + "meta": {} + }, + { + "line": 3485, + "column": 28, + "meta": {} + }, + { + "line": 3486, + "column": 50, + "meta": {} + }, + { + "line": 3784, + "column": 33, + "meta": {} + }, + { + "line": 4026, + "column": 24, + "meta": {} + }, + { + "line": 4104, + "column": 55, + "meta": {} + }, + { + "line": 4105, + "column": 72, + "meta": {} + }, + { + "line": 4107, + "column": 44, + "meta": {} + }, + { + "line": 4124, + "column": 47, + "meta": {} + }, + { + "line": 4173, + "column": 67, + "meta": {} + }, + { + "line": 4554, + "column": 44, + "meta": {} + }, + { + "line": 5513, + "column": 22, + "meta": {} + }, + { + "line": 6125, + "column": 5, + "meta": {} + }, + { + "line": 6348, + "column": 9, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "items.c", + "locations": [ + { + "line": 53, + "column": 7, + "meta": {} + }, + { + "line": 57, + "column": 12, + "meta": {} + }, + { + "line": 60, + "column": 22, + "meta": {} + }, + { + "line": 61, + "column": 17, + "meta": {} + }, + { + "line": 62, + "column": 12, + "meta": {} + }, + { + "line": 69, + "column": 24, + "meta": {} + }, + { + "line": 71, + "column": 11, + "meta": {} + }, + { + "line": 75, + "column": 21, + "meta": {} + }, + { + "line": 81, + "column": 14, + "meta": {} + }, + { + "line": 83, + "column": 9, + "meta": {} + }, + { + "line": 84, + "column": 9, + "meta": {} + }, + { + "line": 85, + "column": 9, + "meta": {} + }, + { + "line": 209, + "column": 13, + "meta": {} + }, + { + "line": 296, + "column": 13, + "meta": {} + }, + { + "line": 381, + "column": 11, + "meta": {} + }, + { + "line": 396, + "column": 5, + "meta": {} + }, + { + "line": 397, + "column": 5, + "meta": {} + }, + { + "line": 398, + "column": 5, + "meta": {} + }, + { + "line": 401, + "column": 10, + "meta": {} + }, + { + "line": 442, + "column": 9, + "meta": {} + }, + { + "line": 491, + "column": 5, + "meta": {} + }, + { + "line": 492, + "column": 5, + "meta": {} + }, + { + "line": 493, + "column": 5, + "meta": {} + }, + { + "line": 501, + "column": 10, + "meta": {} + }, + { + "line": 511, + "column": 9, + "meta": {} + }, + { + "line": 512, + "column": 9, + "meta": {} + }, + { + "line": 514, + "column": 14, + "meta": {} + }, + { + "line": 527, + "column": 9, + "meta": {} + }, + { + "line": 528, + "column": 9, + "meta": {} + }, + { + "line": 530, + "column": 14, + "meta": {} + }, + { + "line": 644, + "column": 36, + "meta": {} + }, + { + "line": 647, + "column": 16, + "meta": {} + }, + { + "line": 650, + "column": 14, + "meta": {} + }, + { + "line": 655, + "column": 32, + "meta": {} + }, + { + "line": 661, + "column": 28, + "meta": {} + }, + { + "line": 671, + "column": 11, + "meta": {} + }, + { + "line": 672, + "column": 9, + "meta": {} + }, + { + "line": 673, + "column": 35, + "meta": {} + }, + { + "line": 681, + "column": 45, + "meta": {} + }, + { + "line": 682, + "column": 45, + "meta": {} + }, + { + "line": 683, + "column": 42, + "meta": {} + }, + { + "line": 684, + "column": 35, + "meta": {} + }, + { + "line": 685, + "column": 37, + "meta": {} + }, + { + "line": 686, + "column": 45, + "meta": {} + }, + { + "line": 687, + "column": 49, + "meta": {} + }, + { + "line": 688, + "column": 45, + "meta": {} + }, + { + "line": 689, + "column": 41, + "meta": {} + }, + { + "line": 690, + "column": 41, + "meta": {} + }, + { + "line": 691, + "column": 44, + "meta": {} + }, + { + "line": 692, + "column": 43, + "meta": {} + }, + { + "line": 728, + "column": 11, + "meta": {} + }, + { + "line": 729, + "column": 19, + "meta": {} + }, + { + "line": 730, + "column": 17, + "meta": {} + }, + { + "line": 731, + "column": 9, + "meta": {} + }, + { + "line": 734, + "column": 39, + "meta": {} + }, + { + "line": 749, + "column": 35, + "meta": {} + }, + { + "line": 750, + "column": 43, + "meta": {} + }, + { + "line": 751, + "column": 39, + "meta": {} + }, + { + "line": 752, + "column": 39, + "meta": {} + }, + { + "line": 753, + "column": 37, + "meta": {} + }, + { + "line": 754, + "column": 45, + "meta": {} + }, + { + "line": 755, + "column": 45, + "meta": {} + }, + { + "line": 756, + "column": 42, + "meta": {} + }, + { + "line": 757, + "column": 45, + "meta": {} + }, + { + "line": 758, + "column": 49, + "meta": {} + }, + { + "line": 759, + "column": 45, + "meta": {} + }, + { + "line": 760, + "column": 41, + "meta": {} + }, + { + "line": 761, + "column": 41, + "meta": {} + }, + { + "line": 762, + "column": 44, + "meta": {} + }, + { + "line": 763, + "column": 43, + "meta": {} + }, + { + "line": 775, + "column": 43, + "meta": {} + }, + { + "line": 778, + "column": 49, + "meta": {} + }, + { + "line": 781, + "column": 50, + "meta": {} + }, + { + "line": 784, + "column": 50, + "meta": {} + }, + { + "line": 787, + "column": 50, + "meta": {} + }, + { + "line": 858, + "column": 9, + "meta": {} + }, + { + "line": 861, + "column": 11, + "meta": {} + }, + { + "line": 863, + "column": 17, + "meta": {} + }, + { + "line": 864, + "column": 9, + "meta": {} + }, + { + "line": 866, + "column": 19, + "meta": {} + }, + { + "line": 870, + "column": 11, + "meta": {} + }, + { + "line": 871, + "column": 9, + "meta": {} + }, + { + "line": 873, + "column": 5, + "meta": {} + }, + { + "line": 874, + "column": 5, + "meta": {} + }, + { + "line": 875, + "column": 5, + "meta": {} + }, + { + "line": 878, + "column": 11, + "meta": {} + }, + { + "line": 879, + "column": 17, + "meta": {} + }, + { + "line": 883, + "column": 16, + "meta": {} + }, + { + "line": 884, + "column": 14, + "meta": {} + }, + { + "line": 885, + "column": 13, + "meta": {} + }, + { + "line": 894, + "column": 19, + "meta": {} + }, + { + "line": 897, + "column": 11, + "meta": {} + }, + { + "line": 898, + "column": 17, + "meta": {} + }, + { + "line": 899, + "column": 9, + "meta": {} + }, + { + "line": 900, + "column": 14, + "meta": {} + }, + { + "line": 901, + "column": 9, + "meta": {} + }, + { + "line": 904, + "column": 19, + "meta": {} + }, + { + "line": 907, + "column": 11, + "meta": {} + }, + { + "line": 908, + "column": 9, + "meta": {} + }, + { + "line": 913, + "column": 18, + "meta": {} + }, + { + "line": 919, + "column": 11, + "meta": {} + }, + { + "line": 920, + "column": 9, + "meta": {} + }, + { + "line": 925, + "column": 18, + "meta": {} + }, + { + "line": 934, + "column": 11, + "meta": {} + }, + { + "line": 935, + "column": 17, + "meta": {} + }, + { + "line": 937, + "column": 9, + "meta": {} + }, + { + "line": 939, + "column": 25, + "meta": {} + }, + { + "line": 940, + "column": 17, + "meta": {} + }, + { + "line": 943, + "column": 40, + "meta": {} + }, + { + "line": 950, + "column": 9, + "meta": {} + }, + { + "line": 951, + "column": 19, + "meta": {} + }, + { + "line": 1001, + "column": 44, + "meta": {} + }, + { + "line": 1002, + "column": 24, + "meta": {} + }, + { + "line": 1003, + "column": 46, + "meta": {} + }, + { + "line": 1013, + "column": 44, + "meta": {} + }, + { + "line": 1014, + "column": 24, + "meta": {} + }, + { + "line": 1015, + "column": 46, + "meta": {} + }, + { + "line": 1121, + "column": 17, + "meta": {} + }, + { + "line": 1126, + "column": 21, + "meta": {} + }, + { + "line": 1139, + "column": 17, + "meta": {} + }, + { + "line": 1141, + "column": 21, + "meta": {} + }, + { + "line": 1169, + "column": 29, + "meta": {} + }, + { + "line": 1176, + "column": 29, + "meta": {} + }, + { + "line": 1183, + "column": 25, + "meta": {} + }, + { + "line": 1201, + "column": 25, + "meta": {} + }, + { + "line": 1202, + "column": 25, + "meta": {} + }, + { + "line": 1204, + "column": 29, + "meta": {} + }, + { + "line": 1206, + "column": 29, + "meta": {} + }, + { + "line": 1209, + "column": 29, + "meta": {} + }, + { + "line": 1224, + "column": 25, + "meta": {} + }, + { + "line": 1462, + "column": 16, + "meta": {} + }, + { + "line": 1606, + "column": 9, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "extstore.c", + "locations": [ + { + "line": 31, + "column": 42, + "meta": {} + }, + { + "line": 32, + "column": 45, + "meta": {} + }, + { + "line": 34, + "column": 28, + "meta": {} + }, + { + "line": 35, + "column": 8, + "meta": {} + }, + { + "line": 36, + "column": 30, + "meta": {} + }, + { + "line": 40, + "column": 28, + "meta": {} + }, + { + "line": 41, + "column": 8, + "meta": {} + }, + { + "line": 42, + "column": 30, + "meta": {} + }, + { + "line": 110, + "column": 21, + "meta": {} + }, + { + "line": 111, + "column": 21, + "meta": {} + }, + { + "line": 157, + "column": 11, + "meta": {} + }, + { + "line": 158, + "column": 19, + "meta": {} + }, + { + "line": 161, + "column": 20, + "meta": {} + }, + { + "line": 181, + "column": 56, + "meta": {} + }, + { + "line": 184, + "column": 30, + "meta": {} + }, + { + "line": 328, + "column": 25, + "meta": {} + }, + { + "line": 329, + "column": 8, + "meta": {} + }, + { + "line": 331, + "column": 8, + "meta": {} + }, + { + "line": 332, + "column": 8, + "meta": {} + }, + { + "line": 351, + "column": 28, + "meta": {} + }, + { + "line": 579, + "column": 8, + "meta": {} + }, + { + "line": 580, + "column": 8, + "meta": {} + }, + { + "line": 581, + "column": 8, + "meta": {} + }, + { + "line": 582, + "column": 8, + "meta": {} + }, + { + "line": 649, + "column": 12, + "meta": {} + }, + { + "line": 650, + "column": 12, + "meta": {} + }, + { + "line": 768, + "column": 28, + "meta": {} + }, + { + "line": 769, + "column": 28, + "meta": {} + }, + { + "line": 832, + "column": 8, + "meta": {} + }, + { + "line": 833, + "column": 8, + "meta": {} + }, + { + "line": 834, + "column": 8, + "meta": {} + }, + { + "line": 949, + "column": 20, + "meta": {} + }, + { + "line": 950, + "column": 20, + "meta": {} + }, + { + "line": 951, + "column": 20, + "meta": {} + }, + { + "line": 961, + "column": 16, + "meta": {} + }, + { + "line": 963, + "column": 19, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "slab_automove.c", + "locations": [ + { + "line": 28, + "column": 10, + "meta": {} + }, + { + "line": 29, + "column": 10, + "meta": {} + }, + { + "line": 30, + "column": 10, + "meta": {} + }, + { + "line": 31, + "column": 10, + "meta": {} + }, + { + "line": 49, + "column": 15, + "meta": {} + }, + { + "line": 50, + "column": 15, + "meta": {} + }, + { + "line": 87, + "column": 15, + "meta": {} + }, + { + "line": 88, + "column": 15, + "meta": {} + }, + { + "line": 155, + "column": 25, + "meta": {} + }, + { + "line": 157, + "column": 25, + "meta": {} + } + ] + }, + { + "term": "cmd", + "file": "proto_text.c", + "locations": [ + { + "line": 34, + "column": 36, + "meta": {} + }, + { + "line": 35, + "column": 16, + "meta": {} + }, + { + "line": 36, + "column": 38, + "meta": {} + }, + { + "line": 347, + "column": 40, + "meta": {} + }, + { + "line": 348, + "column": 20, + "meta": {} + }, + { + "line": 349, + "column": 42, + "meta": {} + }, + { + "line": 352, + "column": 40, + "meta": {} + }, + { + "line": 353, + "column": 20, + "meta": {} + }, + { + "line": 354, + "column": 20, + "meta": {} + }, + { + "line": 355, + "column": 42, + "meta": {} + }, + { + "line": 497, + "column": 17, + "meta": {} + }, + { + "line": 524, + "column": 58, + "meta": {} + }, + { + "line": 525, + "column": 38, + "meta": {} + }, + { + "line": 526, + "column": 60, + "meta": {} + }, + { + "line": 555, + "column": 48, + "meta": {} + }, + { + "line": 557, + "column": 32, + "meta": {} + }, + { + "line": 558, + "column": 32, + "meta": {} + }, + { + "line": 560, + "column": 32, + "meta": {} + }, + { + "line": 561, + "column": 32, + "meta": {} + }, + { + "line": 563, + "column": 50, + "meta": {} + }, + { + "line": 573, + "column": 48, + "meta": {} + }, + { + "line": 575, + "column": 32, + "meta": {} + }, + { + "line": 576, + "column": 32, + "meta": {} + }, + { + "line": 578, + "column": 32, + "meta": {} + }, + { + "line": 579, + "column": 32, + "meta": {} + }, + { + "line": 582, + "column": 50, + "meta": {} + }, + { + "line": 638, + "column": 28, + "meta": {} + }, + { + "line": 651, + "column": 15, + "meta": {} + }, + { + "line": 652, + "column": 27, + "meta": {} + }, + { + "line": 655, + "column": 44, + "meta": {} + }, + { + "line": 669, + "column": 16, + "meta": {} + }, + { + "line": 670, + "column": 19, + "meta": {} + }, + { + "line": 672, + "column": 9, + "meta": {} + }, + { + "line": 678, + "column": 21, + "meta": {} + }, + { + "line": 680, + "column": 21, + "meta": {} + }, + { + "line": 684, + "column": 39, + "meta": {} + }, + { + "line": 690, + "column": 41, + "meta": {} + }, + { + "line": 714, + "column": 17, + "meta": {} + }, + { + "line": 717, + "column": 26, + "meta": {} + }, + { + "line": 722, + "column": 17, + "meta": {} + }, + { + "line": 723, + "column": 20, + "meta": {} + }, + { + "line": 724, + "column": 70, + "meta": {} + }, + { + "line": 726, + "column": 38, + "meta": {} + }, + { + "line": 727, + "column": 20, + "meta": {} + }, + { + "line": 736, + "column": 12, + "meta": {} + }, + { + "line": 738, + "column": 12, + "meta": {} + }, + { + "line": 739, + "column": 62, + "meta": {} + }, + { + "line": 741, + "column": 30, + "meta": {} + }, + { + "line": 742, + "column": 12, + "meta": {} + }, + { + "line": 790, + "column": 36, + "meta": {} + }, + { + "line": 791, + "column": 16, + "meta": {} + }, + { + "line": 792, + "column": 38, + "meta": {} + }, + { + "line": 1169, + "column": 52, + "meta": {} + }, + { + "line": 1170, + "column": 32, + "meta": {} + }, + { + "line": 1171, + "column": 54, + "meta": {} + }, + { + "line": 1224, + "column": 40, + "meta": {} + }, + { + "line": 1226, + "column": 24, + "meta": {} + }, + { + "line": 1227, + "column": 24, + "meta": {} + }, + { + "line": 1229, + "column": 24, + "meta": {} + }, + { + "line": 1230, + "column": 24, + "meta": {} + }, + { + "line": 1232, + "column": 42, + "meta": {} + }, + { + "line": 1236, + "column": 40, + "meta": {} + }, + { + "line": 1238, + "column": 24, + "meta": {} + }, + { + "line": 1239, + "column": 24, + "meta": {} + }, + { + "line": 1241, + "column": 24, + "meta": {} + }, + { + "line": 1242, + "column": 24, + "meta": {} + }, + { + "line": 1245, + "column": 42, + "meta": {} + }, + { + "line": 1496, + "column": 44, + "meta": {} + }, + { + "line": 1497, + "column": 24, + "meta": {} + }, + { + "line": 1498, + "column": 46, + "meta": {} + }, + { + "line": 1522, + "column": 44, + "meta": {} + }, + { + "line": 1523, + "column": 24, + "meta": {} + }, + { + "line": 1524, + "column": 46, + "meta": {} + }, + { + "line": 1534, + "column": 40, + "meta": {} + }, + { + "line": 1535, + "column": 20, + "meta": {} + }, + { + "line": 1536, + "column": 42, + "meta": {} + }, + { + "line": 1662, + "column": 44, + "meta": {} + }, + { + "line": 1664, + "column": 28, + "meta": {} + }, + { + "line": 1666, + "column": 28, + "meta": {} + }, + { + "line": 1668, + "column": 46, + "meta": {} + }, + { + "line": 1831, + "column": 9, + "meta": {} + }, + { + "line": 1908, + "column": 40, + "meta": {} + }, + { + "line": 1909, + "column": 20, + "meta": {} + }, + { + "line": 1910, + "column": 20, + "meta": {} + }, + { + "line": 1911, + "column": 42, + "meta": {} + }, + { + "line": 1916, + "column": 40, + "meta": {} + }, + { + "line": 1917, + "column": 20, + "meta": {} + }, + { + "line": 1918, + "column": 20, + "meta": {} + }, + { + "line": 1919, + "column": 42, + "meta": {} + }, + { + "line": 1959, + "column": 40, + "meta": {} + }, + { + "line": 1961, + "column": 24, + "meta": {} + }, + { + "line": 1963, + "column": 24, + "meta": {} + }, + { + "line": 1965, + "column": 42, + "meta": {} + }, + { + "line": 2005, + "column": 9, + "meta": {} + }, + { + "line": 2012, + "column": 40, + "meta": {} + }, + { + "line": 2013, + "column": 20, + "meta": {} + }, + { + "line": 2014, + "column": 42, + "meta": {} + }, + { + "line": 2021, + "column": 40, + "meta": {} + }, + { + "line": 2022, + "column": 20, + "meta": {} + }, + { + "line": 2023, + "column": 42, + "meta": {} + }, + { + "line": 2302, + "column": 36, + "meta": {} + }, + { + "line": 2303, + "column": 16, + "meta": {} + }, + { + "line": 2304, + "column": 38, + "meta": {} + }, + { + "line": 2307, + "column": 54, + "meta": {} + }, + { + "line": 2617, + "column": 57, + "meta": {} + } + ] + } +] + diff --git a/targets/locations_redis_cluster_manager.json b/targets/locations_redis_cluster_manager.json new file mode 100644 index 0000000000..6b3d7da24b --- /dev/null +++ b/targets/locations_redis_cluster_manager.json @@ -0,0 +1,637 @@ +[ + { + "term": "clustermanager", + "file": "src/redis-cli.c", + "locations": [ +{"line": 94,"column": 5,"meta": {}}, +{"line": 97,"column": 9,"meta": {}}, +{"line": 98,"column": 5,"meta": {}}, +{"line": 100,"column": 9,"meta": {}}, +{"line": 101,"column": 5,"meta": {}}, +{"line": 103,"column": 9,"meta": {}}, +{"line": 104,"column": 5,"meta": {}}, +{"line": 106,"column": 9,"meta": {}}, +{"line": 107,"column": 5,"meta": {}}, +{"line": 171,"column": 16,"meta": {}}, +{"line": 187,"column": 3,"meta": {}}, +{"line": 245,"column": 5,"meta": {}}, +{"line": 2159,"column": 15,"meta": {}}, +{"line": 2165,"column": 12,"meta": {}}, +{"line": 2166,"column": 7,"meta": {}}, +{"line": 2168,"column": 16,"meta": {}}, +{"line": 2192,"column": 3,"meta": {}}, +{"line": 2195,"column": 16,"meta": {}}, +{"line": 2196,"column": 5,"meta": {}}, +{"line": 2197,"column": 5,"meta": {}}, +{"line": 2200,"column": 3,"meta": {}}, +{"line": 2203,"column": 16,"meta": {}}, +{"line": 2204,"column": 5,"meta": {}}, +{"line": 2206,"column": 3,"meta": {}}, +{"line": 2210,"column": 16,"meta": {}}, +{"line": 2215,"column": 3,"meta": {}}, +{"line": 2217,"column": 17,"meta": {}}, +{"line": 2226,"column": 17,"meta": {}}, +{"line": 2235,"column": 13,"meta": {}}, +{"line": 2236,"column": 15,"meta": {}}, +{"line": 2237,"column": 5,"meta": {}}, +{"line": 2241,"column": 8,"meta": {}}, +{"line": 2242,"column": 8,"meta": {}}, +{"line": 2243,"column": 8,"meta": {}}, +{"line": 2244,"column": 13,"meta": {}}, +{"line": 2245,"column": 12,"meta": {}}, +{"line": 2246,"column": 13,"meta": {}}, +{"line": 2248,"column": 12,"meta": {}}, +{"line": 2250,"column": 12,"meta": {}}, +{"line": 2251,"column": 12,"meta": {}}, +{"line": 2252,"column": 12,"meta": {}}, +{"line": 2253,"column": 19,"meta": {}}, +{"line": 2254,"column": 13,"meta": {}}, +{"line": 2256,"column": 12,"meta": {}}, +{"line": 2257,"column": 13,"meta": {}}, +{"line": 2258,"column": 13,"meta": {}}, +{"line": 2259,"column": 12,"meta": {}}, +{"line": 2260,"column": 13,"meta": {}}, +{"line": 2261,"column": 12,"meta": {}}, +{"line": 2262,"column": 13,"meta": {}}, +{"line": 2263,"column": 12,"meta": {}}, +{"line": 2264,"column": 14,"meta": {}}, +{"line": 2265,"column": 13,"meta": {}}, +{"line": 2266,"column": 13,"meta": {}}, +{"line": 2268,"column": 13,"meta": {}}, +{"line": 2269,"column": 13,"meta": {}}, +{"line": 2270,"column": 42,"meta": {}}, +{"line": 2271,"column": 13,"meta": {}}, +{"line": 2272,"column": 40,"meta": {}}, +{"line": 2276,"column": 12,"meta": {}}, +{"line": 2277,"column": 12,"meta": {}}, +{"line": 2278,"column": 12,"meta": {}}, +{"line": 2279,"column": 12,"meta": {}}, +{"line": 2280,"column": 12,"meta": {}}, +{"line": 2281,"column": 12,"meta": {}}, +{"line": 2282,"column": 12,"meta": {}}, +{"line": 2283,"column": 12,"meta": {}}, +{"line": 2284,"column": 12,"meta": {}}, +{"line": 2285,"column": 12,"meta": {}}, +{"line": 2286,"column": 12,"meta": {}}, +{"line": 2287,"column": 12,"meta": {}}, +{"line": 2288,"column": 12,"meta": {}}, +{"line": 2290,"column": 16,"meta": {}}, +{"line": 2292,"column": 5,"meta": {}}, +{"line": 2296,"column": 3,"meta": {}}, +{"line": 2298,"column": 1,"meta": {}}, +{"line": 2299,"column": 16,"meta": {}}, +{"line": 2301,"column": 15,"meta": {}}, +{"line": 2303,"column": 14,"meta": {}}, +{"line": 2304,"column": 13,"meta": {}}, +{"line": 2306,"column": 17,"meta": {}}, +{"line": 2309,"column": 19,"meta": {}}, +{"line": 2312,"column": 18,"meta": {}}, +{"line": 2314,"column": 18,"meta": {}}, +{"line": 2315,"column": 14,"meta": {}}, +{"line": 2317,"column": 21,"meta": {}}, +{"line": 2319,"column": 16,"meta": {}}, +{"line": 2321,"column": 16,"meta": {}}, +{"line": 2323,"column": 14,"meta": {}}, +{"line": 2326,"column": 20,"meta": {}}, +{"line": 2329,"column": 5,"meta": {}}, +{"line": 2337,"column": 8,"meta": {}}, +{"line": 2338,"column": 36,"meta": {}}, +{"line": 2339,"column": 36,"meta": {}}, +{"line": 2340,"column": 5,"meta": {}}, +{"line": 2344,"column": 9,"meta": {}}, +{"line": 2413,"column": 36,"meta": {}}, +{"line": 2420,"column": 13,"meta": {}}, +{"line": 2452,"column": 13,"meta": {}}, +{"line": 2467,"column": 9,"meta": {}}, +{"line": 2468,"column": 21,"meta": {}}, +{"line": 2471,"column": 8,"meta": {}}, +{"line": 2472,"column": 5,"meta": {}}, +{"line": 2492,"column": 5,"meta": {}}, +{"line": 2496,"column": 12,"meta": {}}, +{"line": 2510,"column": 12,"meta": {}}, +{"line": 2527,"column": 12,"meta": {}}, +{"line": 2529,"column": 19,"meta": {}}, +{"line": 2535,"column": 12,"meta": {}}, +{"line": 2536,"column": 42,"meta": {}}, +{"line": 2539,"column": 19,"meta": {}}, +{"line": 2549,"column": 23,"meta": {}}, +{"line": 2564,"column": 12,"meta": {}}, +{"line": 2596,"column": 18,"meta": {}}, +{"line": 2603,"column": 13,"meta": {}}, +{"line": 2604,"column": 46,"meta": {}}, +{"line": 2617,"column": 8,"meta": {}}, +{"line": 2619,"column": 5,"meta": {}}, +{"line": 2627,"column": 9,"meta": {}}, +{"line": 2637,"column": 9,"meta": {}}, +{"line": 2641,"column": 8,"meta": {}}, +{"line": 2644,"column": 5,"meta": {}}, +{"line": 2652,"column": 9,"meta": {}}, +{"line": 2663,"column": 13,"meta": {}}, +{"line": 2669,"column": 20,"meta": {}}, +{"line": 2686,"column": 12,"meta": {}}, +{"line": 2687,"column": 24,"meta": {}}, +{"line": 2696,"column": 12,"meta": {}}, +{"line": 2697,"column": 24,"meta": {}}, +{"line": 2707,"column": 10,"meta": {}}, +{"line": 2740,"column": 40,"meta": {}}, +{"line": 2747,"column": 12,"meta": {}}, +{"line": 2748,"column": 19,"meta": {}}, +{"line": 2752,"column": 5,"meta": {}}, +{"line": 2754,"column": 48,"meta": {}}, +{"line": 2761,"column": 9,"meta": {}}, +{"line": 2762,"column": 37,"meta": {}}, +{"line": 2765,"column": 13,"meta": {}}, +{"line": 2798,"column": 17,"meta": {}}, +{"line": 2814,"column": 13,"meta": {}}, +{"line": 2817,"column": 5,"meta": {}}, +{"line": 2818,"column": 17,"meta": {}}, +{"line": 2821,"column": 5,"meta": {}}, +{"line": 2832,"column": 17,"meta": {}}, +{"line": 2841,"column": 9,"meta": {}}, +{"line": 2843,"column": 9,"meta": {}}, +{"line": 2850,"column": 13,"meta": {}}, +{"line": 2864,"column": 25,"meta": {}}, +{"line": 2877,"column": 13,"meta": {}}, +{"line": 2887,"column": 5,"meta": {}}, +{"line": 2893,"column": 12,"meta": {}}, +{"line": 2911,"column": 12,"meta": {}}, +{"line": 2940,"column": 12,"meta": {}}, +{"line": 2949,"column": 17,"meta": {}}, +{"line": 2950,"column": 17,"meta": {}}, +{"line": 3025,"column": 21,"meta": {}}, +{"line": 3047,"column": 12,"meta": {}}, +{"line": 3059,"column": 17,"meta": {}}, +{"line": 3060,"column": 21,"meta": {}}, +{"line": 3078,"column": 13,"meta": {}}, +{"line": 3083,"column": 9,"meta": {}}, +{"line": 3084,"column": 20,"meta": {}}, +{"line": 3090,"column": 13,"meta": {}}, +{"line": 3097,"column": 9,"meta": {}}, +{"line": 3109,"column": 17,"meta": {}}, +{"line": 3134,"column": 5,"meta": {}}, +{"line": 3140,"column": 12,"meta": {}}, +{"line": 3173,"column": 15,"meta": {}}, +{"line": 3188,"column": 8,"meta": {}}, +{"line": 3192,"column": 5,"meta": {}}, +{"line": 3194,"column": 9,"meta": {}}, +{"line": 3210,"column": 25,"meta": {}}, +{"line": 3219,"column": 21,"meta": {}}, +{"line": 3234,"column": 12,"meta": {}}, +{"line": 3235,"column": 34,"meta": {}}, +{"line": 3257,"column": 12,"meta": {}}, +{"line": 3260,"column": 19,"meta": {}}, +{"line": 3265,"column": 12,"meta": {}}, +{"line": 3271,"column": 19,"meta": {}}, +{"line": 3276,"column": 9,"meta": {}}, +{"line": 3277,"column": 13,"meta": {}}, +{"line": 3294,"column": 12,"meta": {}}, +{"line": 3297,"column": 19,"meta": {}}, +{"line": 3302,"column": 19,"meta": {}}, +{"line": 3308,"column": 19,"meta": {}}, +{"line": 3314,"column": 12,"meta": {}}, +{"line": 3316,"column": 19,"meta": {}}, +{"line": 3321,"column": 21,"meta": {}}, +{"line": 3324,"column": 12,"meta": {}}, +{"line": 3325,"column": 5,"meta": {}}, +{"line": 3333,"column": 12,"meta": {}}, +{"line": 3337,"column": 19,"meta": {}}, +{"line": 3340,"column": 5,"meta": {}}, +{"line": 3342,"column": 5,"meta": {}}, +{"line": 3343,"column": 19,"meta": {}}, +{"line": 3344,"column": 5,"meta": {}}, +{"line": 3345,"column": 15,"meta": {}}, +{"line": 3354,"column": 12,"meta": {}}, +{"line": 3355,"column": 43,"meta": {}}, +{"line": 3416,"column": 20,"meta": {}}, +{"line": 3417,"column": 53,"meta": {}}, +{"line": 3499,"column": 12,"meta": {}}, +{"line": 3500,"column": 44,"meta": {}}, +{"line": 3535,"column": 25,"meta": {}}, +{"line": 3546,"column": 17,"meta": {}}, +{"line": 3547,"column": 21,"meta": {}}, +{"line": 3562,"column": 21,"meta": {}}, +{"line": 3565,"column": 21,"meta": {}}, +{"line": 3577,"column": 21,"meta": {}}, +{"line": 3579,"column": 25,"meta": {}}, +{"line": 3582,"column": 35,"meta": {}}, +{"line": 3585,"column": 29,"meta": {}}, +{"line": 3591,"column": 29,"meta": {}}, +{"line": 3605,"column": 33,"meta": {}}, +{"line": 3607,"column": 29,"meta": {}}, +{"line": 3618,"column": 21,"meta": {}}, +{"line": 3621,"column": 33,"meta": {}}, +{"line": 3665,"column": 12,"meta": {}}, +{"line": 3666,"column": 35,"meta": {}}, +{"line": 3681,"column": 19,"meta": {}}, +{"line": 3684,"column": 19,"meta": {}}, +{"line": 3688,"column": 15,"meta": {}}, +{"line": 3698,"column": 13,"meta": {}}, +{"line": 3728,"column": 12,"meta": {}}, +{"line": 3749,"column": 21,"meta": {}}, +{"line": 3759,"column": 13,"meta": {}}, +{"line": 3764,"column": 12,"meta": {}}, +{"line": 3769,"column": 28,"meta": {}}, +{"line": 3773,"column": 17,"meta": {}}, +{"line": 3784,"column": 25,"meta": {}}, +{"line": 3788,"column": 25,"meta": {}}, +{"line": 3796,"column": 25,"meta": {}}, +{"line": 3799,"column": 21,"meta": {}}, +{"line": 3819,"column": 12,"meta": {}}, +{"line": 3825,"column": 10,"meta": {}}, +{"line": 3861,"column": 9,"meta": {}}, +{"line": 3865,"column": 13,"meta": {}}, +{"line": 3945,"column": 27,"meta": {}}, +{"line": 3999,"column": 12,"meta": {}}, +{"line": 4000,"column": 35,"meta": {}}, +{"line": 4006,"column": 10,"meta": {}}, +{"line": 4007,"column": 9,"meta": {}}, +{"line": 4013,"column": 10,"meta": {}}, +{"line": 4026,"column": 37,"meta": {}}, +{"line": 4034,"column": 13,"meta": {}}, +{"line": 4036,"column": 38,"meta": {}}, +{"line": 4039,"column": 17,"meta": {}}, +{"line": 4048,"column": 17,"meta": {}}, +{"line": 4065,"column": 9,"meta": {}}, +{"line": 4067,"column": 13,"meta": {}}, +{"line": 4069,"column": 17,"meta": {}}, +{"line": 4079,"column": 5,"meta": {}}, +{"line": 4085,"column": 5,"meta": {}}, +{"line": 4086,"column": 5,"meta": {}}, +{"line": 4087,"column": 5,"meta": {}}, +{"line": 4091,"column": 5,"meta": {}}, +{"line": 4092,"column": 5,"meta": {}}, +{"line": 4093,"column": 5,"meta": {}}, +{"line": 4097,"column": 12,"meta": {}}, +{"line": 4149,"column": 49,"meta": {}}, +{"line": 4173,"column": 19,"meta": {}}, +{"line": 4190,"column": 12,"meta": {}}, +{"line": 4200,"column": 9,"meta": {}}, +{"line": 4201,"column": 19,"meta": {}}, +{"line": 4217,"column": 14,"meta": {}}, +{"line": 4220,"column": 10,"meta": {}}, +{"line": 4248,"column": 13,"meta": {}}, +{"line": 4264,"column": 14,"meta": {}}, +{"line": 4266,"column": 32,"meta": {}}, +{"line": 4271,"column": 9,"meta": {}}, +{"line": 4272,"column": 23,"meta": {}}, +{"line": 4278,"column": 17,"meta": {}}, +{"line": 4300,"column": 13,"meta": {}}, +{"line": 4304,"column": 5,"meta": {}}, +{"line": 4310,"column": 12,"meta": {}}, +{"line": 4317,"column": 9,"meta": {}}, +{"line": 4328,"column": 13,"meta": {}}, +{"line": 4329,"column": 5,"meta": {}}, +{"line": 4338,"column": 21,"meta": {}}, +{"line": 4345,"column": 8,"meta": {}}, +{"line": 4349,"column": 5,"meta": {}}, +{"line": 4356,"column": 9,"meta": {}}, +{"line": 4361,"column": 23,"meta": {}}, +{"line": 4384,"column": 8,"meta": {}}, +{"line": 4385,"column": 5,"meta": {}}, +{"line": 4391,"column": 9,"meta": {}}, +{"line": 4403,"column": 8,"meta": {}}, +{"line": 4410,"column": 9,"meta": {}}, +{"line": 4419,"column": 9,"meta": {}}, +{"line": 4429,"column": 12,"meta": {}}, +{"line": 4434,"column": 9,"meta": {}}, +{"line": 4440,"column": 5,"meta": {}}, +{"line": 4451,"column": 17,"meta": {}}, +{"line": 4456,"column": 22,"meta": {}}, +{"line": 4472,"column": 21,"meta": {}}, +{"line": 4483,"column": 42,"meta": {}}, +{"line": 4503,"column": 9,"meta": {}}, +{"line": 4512,"column": 17,"meta": {}}, +{"line": 4513,"column": 17,"meta": {}}, +{"line": 4515,"column": 22,"meta": {}}, +{"line": 4530,"column": 9,"meta": {}}, +{"line": 4539,"column": 45,"meta": {}}, +{"line": 4544,"column": 17,"meta": {}}, +{"line": 4545,"column": 17,"meta": {}}, +{"line": 4547,"column": 22,"meta": {}}, +{"line": 4562,"column": 9,"meta": {}}, +{"line": 4570,"column": 45,"meta": {}}, +{"line": 4574,"column": 17,"meta": {}}, +{"line": 4575,"column": 21,"meta": {}}, +{"line": 4580,"column": 17,"meta": {}}, +{"line": 4583,"column": 22,"meta": {}}, +{"line": 4594,"column": 21,"meta": {}}, +{"line": 4597,"column": 26,"meta": {}}, +{"line": 4604,"column": 26,"meta": {}}, +{"line": 4609,"column": 26,"meta": {}}, +{"line": 4613,"column": 26,"meta": {}}, +{"line": 4631,"column": 12,"meta": {}}, +{"line": 4636,"column": 9,"meta": {}}, +{"line": 4640,"column": 5,"meta": {}}, +{"line": 4652,"column": 5,"meta": {}}, +{"line": 4659,"column": 9,"meta": {}}, +{"line": 4666,"column": 23,"meta": {}}, +{"line": 4668,"column": 17,"meta": {}}, +{"line": 4687,"column": 9,"meta": {}}, +{"line": 4723,"column": 23,"meta": {}}, +{"line": 4725,"column": 17,"meta": {}}, +{"line": 4745,"column": 9,"meta": {}}, +{"line": 4747,"column": 17,"meta": {}}, +{"line": 4751,"column": 13,"meta": {}}, +{"line": 4758,"column": 9,"meta": {}}, +{"line": 4760,"column": 19,"meta": {}}, +{"line": 4762,"column": 19,"meta": {}}, +{"line": 4770,"column": 19,"meta": {}}, +{"line": 4774,"column": 9,"meta": {}}, +{"line": 4775,"column": 9,"meta": {}}, +{"line": 4792,"column": 13,"meta": {}}, +{"line": 4794,"column": 23,"meta": {}}, +{"line": 4798,"column": 23,"meta": {}}, +{"line": 4800,"column": 23,"meta": {}}, +{"line": 4803,"column": 13,"meta": {}}, +{"line": 4806,"column": 13,"meta": {}}, +{"line": 4814,"column": 9,"meta": {}}, +{"line": 4815,"column": 9,"meta": {}}, +{"line": 4816,"column": 9,"meta": {}}, +{"line": 4820,"column": 19,"meta": {}}, +{"line": 4828,"column": 9,"meta": {}}, +{"line": 4833,"column": 13,"meta": {}}, +{"line": 4835,"column": 23,"meta": {}}, +{"line": 4837,"column": 13,"meta": {}}, +{"line": 4839,"column": 23,"meta": {}}, +{"line": 4846,"column": 13,"meta": {}}, +{"line": 4849,"column": 23,"meta": {}}, +{"line": 4865,"column": 9,"meta": {}}, +{"line": 4866,"column": 9,"meta": {}}, +{"line": 4880,"column": 13,"meta": {}}, +{"line": 4881,"column": 25,"meta": {}}, +{"line": 4890,"column": 13,"meta": {}}, +{"line": 4896,"column": 23,"meta": {}}, +{"line": 4901,"column": 17,"meta": {}}, +{"line": 4903,"column": 27,"meta": {}}, +{"line": 4907,"column": 13,"meta": {}}, +{"line": 4911,"column": 23,"meta": {}}, +{"line": 4915,"column": 17,"meta": {}}, +{"line": 4916,"column": 27,"meta": {}}, +{"line": 4924,"column": 13,"meta": {}}, +{"line": 4928,"column": 27,"meta": {}}, +{"line": 4941,"column": 13,"meta": {}}, +{"line": 4942,"column": 13,"meta": {}}, +{"line": 4946,"column": 23,"meta": {}}, +{"line": 4952,"column": 13,"meta": {}}, +{"line": 4968,"column": 12,"meta": {}}, +{"line": 4969,"column": 5,"meta": {}}, +{"line": 4972,"column": 5,"meta": {}}, +{"line": 4976,"column": 5,"meta": {}}, +{"line": 4979,"column": 10,"meta": {}}, +{"line": 4987,"column": 9,"meta": {}}, +{"line": 4990,"column": 21,"meta": {}}, +{"line": 4993,"column": 9,"meta": {}}, +{"line": 4994,"column": 14,"meta": {}}, +{"line": 4998,"column": 23,"meta": {}}, +{"line": 5005,"column": 12,"meta": {}}, +{"line": 5008,"column": 5,"meta": {}}, +{"line": 5009,"column": 5,"meta": {}}, +{"line": 5014,"column": 17,"meta": {}}, +{"line": 5015,"column": 18,"meta": {}}, +{"line": 5018,"column": 9,"meta": {}}, +{"line": 5021,"column": 9,"meta": {}}, +{"line": 5025,"column": 5,"meta": {}}, +{"line": 5031,"column": 9,"meta": {}}, +{"line": 5034,"column": 42,"meta": {}}, +{"line": 5048,"column": 13,"meta": {}}, +{"line": 5052,"column": 42,"meta": {}}, +{"line": 5066,"column": 13,"meta": {}}, +{"line": 5080,"column": 9,"meta": {}}, +{"line": 5088,"column": 26,"meta": {}}, +{"line": 5095,"column": 5,"meta": {}}, +{"line": 5098,"column": 20,"meta": {}}, +{"line": 5100,"column": 9,"meta": {}}, +{"line": 5107,"column": 9,"meta": {}}, +{"line": 5110,"column": 30,"meta": {}}, +{"line": 5113,"column": 13,"meta": {}}, +{"line": 5114,"column": 25,"meta": {}}, +{"line": 5123,"column": 9,"meta": {}}, +{"line": 5131,"column": 17,"meta": {}}, +{"line": 5137,"column": 33,"meta": {}}, +{"line": 5143,"column": 17,"meta": {}}, +{"line": 5147,"column": 21,"meta": {}}, +{"line": 5148,"column": 21,"meta": {}}, +{"line": 5152,"column": 30,"meta": {}}, +{"line": 5154,"column": 25,"meta": {}}, +{"line": 5164,"column": 13,"meta": {}}, +{"line": 5169,"column": 8,"meta": {}}, +{"line": 5170,"column": 53,"meta": {}}, +{"line": 5173,"column": 5,"meta": {}}, +{"line": 5176,"column": 12,"meta": {}}, +{"line": 5179,"column": 9,"meta": {}}, +{"line": 5184,"column": 13,"meta": {}}, +{"line": 5193,"column": 14,"meta": {}}, +{"line": 5196,"column": 5,"meta": {}}, +{"line": 5201,"column": 9,"meta": {}}, +{"line": 5205,"column": 37,"meta": {}}, +{"line": 5206,"column": 11,"meta": {}}, +{"line": 5208,"column": 9,"meta": {}}, +{"line": 5217,"column": 13,"meta": {}}, +{"line": 5228,"column": 13,"meta": {}}, +{"line": 5233,"column": 9,"meta": {}}, +{"line": 5234,"column": 9,"meta": {}}, +{"line": 5239,"column": 13,"meta": {}}, +{"line": 5245,"column": 13,"meta": {}}, +{"line": 5252,"column": 13,"meta": {}}, +{"line": 5272,"column": 13,"meta": {}}, +{"line": 5275,"column": 47,"meta": {}}, +{"line": 5283,"column": 13,"meta": {}}, +{"line": 5296,"column": 13,"meta": {}}, +{"line": 5297,"column": 42,"meta": {}}, +{"line": 5309,"column": 13,"meta": {}}, +{"line": 5310,"column": 40,"meta": {}}, +{"line": 5318,"column": 13,"meta": {}}, +{"line": 5328,"column": 5,"meta": {}}, +{"line": 5331,"column": 13,"meta": {}}, +{"line": 5335,"column": 5,"meta": {}}, +{"line": 5339,"column": 13,"meta": {}}, +{"line": 5355,"column": 12,"meta": {}}, +{"line": 5370,"column": 9,"meta": {}}, +{"line": 5371,"column": 14,"meta": {}}, +{"line": 5376,"column": 14,"meta": {}}, +{"line": 5377,"column": 13,"meta": {}}, +{"line": 5383,"column": 14,"meta": {}}, +{"line": 5392,"column": 14,"meta": {}}, +{"line": 5393,"column": 13,"meta": {}}, +{"line": 5404,"column": 9,"meta": {}}, +{"line": 5409,"column": 9,"meta": {}}, +{"line": 5413,"column": 5,"meta": {}}, +{"line": 5416,"column": 5,"meta": {}}, +{"line": 5418,"column": 5,"meta": {}}, +{"line": 5423,"column": 9,"meta": {}}, +{"line": 5435,"column": 9,"meta": {}}, +{"line": 5437,"column": 13,"meta": {}}, +{"line": 5438,"column": 9,"meta": {}}, +{"line": 5442,"column": 13,"meta": {}}, +{"line": 5444,"column": 17,"meta": {}}, +{"line": 5445,"column": 17,"meta": {}}, +{"line": 5450,"column": 5,"meta": {}}, +{"line": 5457,"column": 9,"meta": {}}, +{"line": 5475,"column": 5,"meta": {}}, +{"line": 5482,"column": 9,"meta": {}}, +{"line": 5486,"column": 13,"meta": {}}, +{"line": 5489,"column": 17,"meta": {}}, +{"line": 5522,"column": 9,"meta": {}}, +{"line": 5523,"column": 9,"meta": {}}, +{"line": 5525,"column": 5,"meta": {}}, +{"line": 5526,"column": 5,"meta": {}}, +{"line": 5531,"column": 13,"meta": {}}, +{"line": 5533,"column": 27,"meta": {}}, +{"line": 5543,"column": 9,"meta": {}}, +{"line": 5544,"column": 9,"meta": {}}, +{"line": 5549,"column": 13,"meta": {}}, +{"line": 5556,"column": 9,"meta": {}}, +{"line": 5558,"column": 9,"meta": {}}, +{"line": 5561,"column": 13,"meta": {}}, +{"line": 5587,"column": 9,"meta": {}}, +{"line": 5591,"column": 13,"meta": {}}, +{"line": 5594,"column": 27,"meta": {}}, +{"line": 5606,"column": 9,"meta": {}}, +{"line": 5608,"column": 13,"meta": {}}, +{"line": 5613,"column": 14,"meta": {}}, +{"line": 5617,"column": 9,"meta": {}}, +{"line": 5624,"column": 9,"meta": {}}, +{"line": 5631,"column": 12,"meta": {}}, +{"line": 5640,"column": 5,"meta": {}}, +{"line": 5643,"column": 5,"meta": {}}, +{"line": 5644,"column": 10,"meta": {}}, +{"line": 5645,"column": 10,"meta": {}}, +{"line": 5649,"column": 5,"meta": {}}, +{"line": 5653,"column": 27,"meta": {}}, +{"line": 5655,"column": 17,"meta": {}}, +{"line": 5659,"column": 27,"meta": {}}, +{"line": 5667,"column": 5,"meta": {}}, +{"line": 5669,"column": 10,"meta": {}}, +{"line": 5670,"column": 9,"meta": {}}, +{"line": 5676,"column": 21,"meta": {}}, +{"line": 5677,"column": 9,"meta": {}}, +{"line": 5681,"column": 10,"meta": {}}, +{"line": 5689,"column": 21,"meta": {}}, +{"line": 5690,"column": 9,"meta": {}}, +{"line": 5694,"column": 5,"meta": {}}, +{"line": 5699,"column": 5,"meta": {}}, +{"line": 5703,"column": 21,"meta": {}}, +{"line": 5709,"column": 9,"meta": {}}, +{"line": 5710,"column": 9,"meta": {}}, +{"line": 5715,"column": 25,"meta": {}}, +{"line": 5718,"column": 5,"meta": {}}, +{"line": 5728,"column": 12,"meta": {}}, +{"line": 5735,"column": 5,"meta": {}}, +{"line": 5737,"column": 5,"meta": {}}, +{"line": 5738,"column": 5,"meta": {}}, +{"line": 5741,"column": 10,"meta": {}}, +{"line": 5744,"column": 12,"meta": {}}, +{"line": 5746,"column": 9,"meta": {}}, +{"line": 5750,"column": 9,"meta": {}}, +{"line": 5756,"column": 5,"meta": {}}, +{"line": 5762,"column": 9,"meta": {}}, +{"line": 5766,"column": 13,"meta": {}}, +{"line": 5768,"column": 13,"meta": {}}, +{"line": 5772,"column": 23,"meta": {}}, +{"line": 5778,"column": 19,"meta": {}}, +{"line": 5784,"column": 5,"meta": {}}, +{"line": 5787,"column": 15,"meta": {}}, +{"line": 5795,"column": 12,"meta": {}}, +{"line": 5799,"column": 5,"meta": {}}, +{"line": 5800,"column": 10,"meta": {}}, +{"line": 5801,"column": 5,"meta": {}}, +{"line": 5808,"column": 12,"meta": {}}, +{"line": 5812,"column": 5,"meta": {}}, +{"line": 5813,"column": 10,"meta": {}}, +{"line": 5814,"column": 5,"meta": {}}, +{"line": 5815,"column": 12,"meta": {}}, +{"line": 5821,"column": 12,"meta": {}}, +{"line": 5823,"column": 12,"meta": {}}, +{"line": 5826,"column": 12,"meta": {}}, +{"line": 5830,"column": 5,"meta": {}}, +{"line": 5831,"column": 10,"meta": {}}, +{"line": 5832,"column": 5,"meta": {}}, +{"line": 5874,"column": 5,"meta": {}}, +{"line": 5900,"column": 17,"meta": {}}, +{"line": 5917,"column": 17,"meta": {}}, +{"line": 5931,"column": 17,"meta": {}}, +{"line": 5947,"column": 13,"meta": {}}, +{"line": 5963,"column": 9,"meta": {}}, +{"line": 5964,"column": 20,"meta": {}}, +{"line": 5969,"column": 16,"meta": {}}, +{"line": 5972,"column": 13,"meta": {}}, +{"line": 5974,"column": 5,"meta": {}}, +{"line": 5992,"column": 9,"meta": {}}, +{"line": 5994,"column": 18,"meta": {}}, +{"line": 5998,"column": 19,"meta": {}}, +{"line": 6006,"column": 5,"meta": {}}, +{"line": 6013,"column": 12,"meta": {}}, +{"line": 6016,"column": 5,"meta": {}}, +{"line": 6019,"column": 5,"meta": {}}, +{"line": 6020,"column": 10,"meta": {}}, +{"line": 6032,"column": 13,"meta": {}}, +{"line": 6034,"column": 17,"meta": {}}, +{"line": 6051,"column": 9,"meta": {}}, +{"line": 6062,"column": 53,"meta": {}}, +{"line": 6065,"column": 5,"meta": {}}, +{"line": 6067,"column": 9,"meta": {}}, +{"line": 6080,"column": 9,"meta": {}}, +{"line": 6101,"column": 9,"meta": {}}, +{"line": 6112,"column": 13,"meta": {}}, +{"line": 6120,"column": 49,"meta": {}}, +{"line": 6121,"column": 11,"meta": {}}, +{"line": 6122,"column": 5,"meta": {}}, +{"line": 6127,"column": 13,"meta": {}}, +{"line": 6141,"column": 9,"meta": {}}, +{"line": 6142,"column": 9,"meta": {}}, +{"line": 6155,"column": 21,"meta": {}}, +{"line": 6159,"column": 17,"meta": {}}, +{"line": 6171,"column": 21,"meta": {}}, +{"line": 6172,"column": 30,"meta": {}}, +{"line": 6184,"column": 13,"meta": {}}, +{"line": 6202,"column": 12,"meta": {}}, +{"line": 6214,"column": 5,"meta": {}}, +{"line": 6215,"column": 10,"meta": {}}, +{"line": 6218,"column": 5,"meta": {}}, +{"line": 6224,"column": 9,"meta": {}}, +{"line": 6231,"column": 18,"meta": {}}, +{"line": 6236,"column": 14,"meta": {}}, +{"line": 6239,"column": 9,"meta": {}}, +{"line": 6247,"column": 9,"meta": {}}, +{"line": 6252,"column": 5,"meta": {}}, +{"line": 6260,"column": 12,"meta": {}}, +{"line": 6280,"column": 5,"meta": {}}, +{"line": 6283,"column": 5,"meta": {}}, +{"line": 6284,"column": 10,"meta": {}}, +{"line": 6285,"column": 10,"meta": {}}, +{"line": 6303,"column": 9,"meta": {}}, +{"line": 6316,"column": 5,"meta": {}}, +{"line": 6319,"column": 5,"meta": {}}, +{"line": 6326,"column": 13,"meta": {}}, +{"line": 6367,"column": 29,"meta": {}}, +{"line": 6368,"column": 13,"meta": {}}, +{"line": 6376,"column": 21,"meta": {}}, +{"line": 6384,"column": 13,"meta": {}}, +{"line": 6389,"column": 9,"meta": {}}, +{"line": 6399,"column": 12,"meta": {}}, +{"line": 6403,"column": 5,"meta": {}}, +{"line": 6404,"column": 10,"meta": {}}, +{"line": 6408,"column": 5,"meta": {}}, +{"line": 6418,"column": 9,"meta": {}}, +{"line": 6419,"column": 29,"meta": {}}, +{"line": 6439,"column": 12,"meta": {}}, +{"line": 6444,"column": 5,"meta": {}}, +{"line": 6445,"column": 10,"meta": {}}, +{"line": 6446,"column": 21,"meta": {}}, +{"line": 6459,"column": 9,"meta": {}}, +{"line": 6460,"column": 25,"meta": {}}, +{"line": 6465,"column": 9,"meta": {}}, +{"line": 6476,"column": 5,"meta": {}}, +{"line": 6479,"column": 9,"meta": {}}, +{"line": 6490,"column": 13,"meta": {}}, +{"line": 6494,"column": 9,"meta": {}}, +{"line": 6496,"column": 12,"meta": {}}, +{"line": 6503,"column": 12,"meta": {}}, +{"line": 6506,"column": 33,"meta": {}}, +{"line": 6507,"column": 33,"meta": {}}, +{"line": 6512,"column": 9,"meta": {}}, +{"line": 6937,"column": 20,"meta": {}}, +{"line": 6944,"column": 20,"meta": {}}, +{"line": 8086,"column": 9,"meta": {}}, +{"line": 8092,"column": 9,"meta": {}}]}] + diff --git a/targets/locations_silver_searcher_ignore.json b/targets/locations_silver_searcher_ignore.json new file mode 100644 index 0000000000..b54d249b54 --- /dev/null +++ b/targets/locations_silver_searcher_ignore.json @@ -0,0 +1,288 @@ +[ + { + "term": "ignore", + "file": "src/ignore.c", + "locations": [ + { + "line": 9, + "column": 11, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 23, + "column": 1, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 25, + "column": 52, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 27, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 33, + "column": 64, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 34, + "column": 13, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 35, + "column": 7, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 36, + "column": 10, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 38, + "column": 9, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 42, + "column": 14, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 46, + "column": 1, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 47, + "column": 5, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 83, + "column": 14, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 99, + "column": 10, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 116, + "column": 53, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 168, + "column": 22, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 169, + "column": 26, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 172, + "column": 23, + "meta": { + "Kind": "Comment" + } + }, + { + "line": 173, + "column": 11, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 177, + "column": 29, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 180, + "column": 24, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 193, + "column": 13, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 209, + "column": 17, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 217, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 233, + "column": 32, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 240, + "column": 32, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 250, + "column": 40, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 260, + "column": 36, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 270, + "column": 36, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 279, + "column": 32, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 299, + "column": 32, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 300, + "column": 45, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 306, + "column": 28, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 311, + "column": 23, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 315, + "column": 48, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 347, + "column": 11, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 353, + "column": 36, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 358, + "column": 18, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 371, + "column": 31, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 381, + "column": 23, + "meta": { + "Kind": "Identifier" + } + } + ] + } +] \ No newline at end of file diff --git a/targets/min_ex.c b/targets/min_ex.c new file mode 100644 index 0000000000..77872ac37e --- /dev/null +++ b/targets/min_ex.c @@ -0,0 +1,12 @@ +int foo(int i,int k,int j){ + int a = i *k; + int b = i *j; + int c = k *j; + return a * b *c; +} +int main() { + int A = foo(0, 1, 2); + int B = foo(5, 3, 4); + printf("%d\n", A); + printf("%d\n", 8); +} \ No newline at end of file diff --git a/targets/min_ex.json b/targets/min_ex.json new file mode 100644 index 0000000000..0afe9ffdb2 --- /dev/null +++ b/targets/min_ex.json @@ -0,0 +1,22 @@ +[ + { + "term": "foo", + "file": "min_ex.c", + "locations": [ + { + "line": 8, + "column": 13, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 9, + "column": 13, + "meta": { + "Kind": "Identifier" + } + } + ] + } +] \ No newline at end of file diff --git a/targets/mini/Makefile b/targets/mini/Makefile new file mode 100644 index 0000000000..10a110a5ef --- /dev/null +++ b/targets/mini/Makefile @@ -0,0 +1,26 @@ +CC = clang +CFLAGS = -O0 -g -Wall -Wextra -std=c99 -pedantic-errors -isystem /usr/local/llvm-10/lib/clang/10.0.1/include/ + +all: test + +.PHONY: test +test: mini.c + $(CC) $(CFLAGS) -o $@ mini.c + +clean: + rm -f mini *.o *.ll + + +BITCODE_C = /usr/local/llvm-10/bin/clang -emit-llvm -S -g -DHAVE_CONFIG_H +llvm_link = /usr/local/llvm-10/bin/llvm-link + + +BITCODES=mini.ll + +%.ll: %.c + $(BITCODE_C) $(DEFAULT_INCLUDES) $< -o $@ + +bitcode: $(BITCODES) + $(llvm_link) $(BITCODES) -o mini_linked.ll -S + sed 's/\ optnone\>//g' mini_linked.ll > mini_opt.ll + opt -mem2reg -S -o opt.ll mini_opt.ll diff --git a/targets/mini/mini.c b/targets/mini/mini.c new file mode 100644 index 0000000000..f8b35d58d5 --- /dev/null +++ b/targets/mini/mini.c @@ -0,0 +1,16 @@ + + + + +int calc(int pp) // { +{ + pp++; + return (pp + 1) /**/; + + +} + +int main(void) { + calc(3); + return 0; +} diff --git a/targets/mini/mini.json b/targets/mini/mini.json new file mode 100644 index 0000000000..24cbc9a89b --- /dev/null +++ b/targets/mini/mini.json @@ -0,0 +1,13 @@ +[ + { + "term": "calc", + "file": "mini.c", + "locations": [ + { + "line": 5, + "column": 5, + "meta": {} + } + ] + } +] \ No newline at end of file diff --git a/targets/mini/test b/targets/mini/test new file mode 100755 index 0000000000..7a36094578 Binary files /dev/null and b/targets/mini/test differ diff --git a/targets/parson b/targets/parson new file mode 160000 index 0000000000..41038d18c9 --- /dev/null +++ b/targets/parson @@ -0,0 +1 @@ +Subproject commit 41038d18c98959831ab07a0839e02b2bfbc3b467 diff --git a/targets/parson_parse.json b/targets/parson_parse.json new file mode 100644 index 0000000000..38b0dc0b3d --- /dev/null +++ b/targets/parson_parse.json @@ -0,0 +1,203 @@ +[ + { + "term": "parse", + "file": "parson.c", + "locations": [ + { + "line": 113, + "column": 15, + "meta": {} + }, + { + "line": 141, + "column": 21, + "meta": {} + }, + { + "line": 144, + "column": 21, + "meta": {} + }, + { + "line": 145, + "column": 21, + "meta": {} + }, + { + "line": 146, + "column": 21, + "meta": {} + }, + { + "line": 147, + "column": 21, + "meta": {} + }, + { + "line": 148, + "column": 21, + "meta": {} + }, + { + "line": 149, + "column": 21, + "meta": {} + }, + { + "line": 150, + "column": 21, + "meta": {} + }, + { + "line": 185, + "column": 12, + "meta": {} + }, + { + "line": 579, + "column": 12, + "meta": {} + }, + { + "line": 581, + "column": 9, + "meta": {} + }, + { + "line": 585, + "column": 5, + "meta": {} + }, + { + "line": 586, + "column": 10, + "meta": {} + }, + { + "line": 606, + "column": 9, + "meta": {} + }, + { + "line": 607, + "column": 14, + "meta": {} + }, + { + "line": 651, + "column": 25, + "meta": {} + }, + { + "line": 696, + "column": 21, + "meta": {} + }, + { + "line": 703, + "column": 20, + "meta": {} + }, + { + "line": 705, + "column": 20, + "meta": {} + }, + { + "line": 707, + "column": 20, + "meta": {} + }, + { + "line": 713, + "column": 20, + "meta": {} + }, + { + "line": 715, + "column": 20, + "meta": {} + }, + { + "line": 721, + "column": 21, + "meta": {} + }, + { + "line": 755, + "column": 21, + "meta": {} + }, + { + "line": 785, + "column": 21, + "meta": {} + }, + { + "line": 804, + "column": 27, + "meta": {} + }, + { + "line": 831, + "column": 21, + "meta": {} + }, + { + "line": 846, + "column": 21, + "meta": {} + }, + { + "line": 859, + "column": 21, + "meta": {} + }, + { + "line": 871, + "column": 21, + "meta": {} + }, + { + "line": 1117, + "column": 19, + "meta": {} + }, + { + "line": 1123, + "column": 25, + "meta": {} + }, + { + "line": 1128, + "column": 19, + "meta": {} + }, + { + "line": 1134, + "column": 25, + "meta": {} + }, + { + "line": 1139, + "column": 19, + "meta": {} + }, + { + "line": 1146, + "column": 12, + "meta": {} + }, + { + "line": 1149, + "column": 19, + "meta": {} + }, + { + "line": 1159, + "column": 14, + "meta": {} + } + ] + } +] diff --git a/targets/parson_serialize.json b/targets/parson_serialize.json new file mode 100644 index 0000000000..507bbb30e7 --- /dev/null +++ b/targets/parson_serialize.json @@ -0,0 +1,173 @@ +[ + { + "term": "serialize", + "file": "parson.c", + "locations": [ + { + "line": 153, + "column": 20, + "meta": {} + }, + { + "line": 154, + "column": 20, + "meta": {} + }, + { + "line": 891, + "column": 17, + "meta": {} + }, + { + "line": 915, + "column": 32, + "meta": {} + }, + { + "line": 951, + "column": 32, + "meta": {} + }, + { + "line": 964, + "column": 32, + "meta": {} + }, + { + "line": 990, + "column": 28, + "meta": {} + }, + { + "line": 1030, + "column": 17, + "meta": {} + }, + { + "line": 1541, + "column": 20, + "meta": {} + }, + { + "line": 1545, + "column": 18, + "meta": {} + }, + { + "line": 1551, + "column": 20, + "meta": {} + }, + { + "line": 1558, + "column": 18, + "meta": {} + }, + { + "line": 1561, + "column": 11, + "meta": {} + }, + { + "line": 1562, + "column": 9, + "meta": {} + }, + { + "line": 1567, + "column": 19, + "meta": {} + }, + { + "line": 1570, + "column": 15, + "meta": {} + }, + { + "line": 1576, + "column": 15, + "meta": {} + }, + { + "line": 1580, + "column": 13, + "meta": {} + }, + { + "line": 1591, + "column": 33, + "meta": {} + }, + { + "line": 1593, + "column": 19, + "meta": {} + }, + { + "line": 1601, + "column": 20, + "meta": {} + }, + { + "line": 1605, + "column": 18, + "meta": {} + }, + { + "line": 1611, + "column": 20, + "meta": {} + }, + { + "line": 1618, + "column": 18, + "meta": {} + }, + { + "line": 1621, + "column": 11, + "meta": {} + }, + { + "line": 1622, + "column": 9, + "meta": {} + }, + { + "line": 1627, + "column": 19, + "meta": {} + }, + { + "line": 1630, + "column": 15, + "meta": {} + }, + { + "line": 1636, + "column": 15, + "meta": {} + }, + { + "line": 1640, + "column": 13, + "meta": {} + }, + { + "line": 1651, + "column": 33, + "meta": {} + }, + { + "line": 1653, + "column": 19, + "meta": {} + }, + { + "line": 1659, + "column": 16, + "meta": {} + } + ] + } +] \ No newline at end of file diff --git a/targets/preparation.c b/targets/preparation.c new file mode 100644 index 0000000000..c5d8abdc93 --- /dev/null +++ b/targets/preparation.c @@ -0,0 +1,43 @@ +#include "stdlib.h" +#include + +/* +WARNING: Comments are just examples of dependencies and are not exhaustive + +Suggestion: Compile without compiler optimizations (-O0) +The expected output of your preparation should be a machine-readable list of dependencies, as produced or used by your tool. +*/ + + +int main(int argc, char **argv) { + // RAW dependence in declaration + int n = 20; + double A[n]; + + A[0] = n; + for (int i = 1; i < n; i++) { + if(i % 2 == 0) { + // Loop-carried data dependence on array elements + A[i] = A[i-1] / n; + } else { + A[i] = ((double) i) / n; + } + } + + double sum = 0; + // Loop-carried data dependence + for (int i = 0; i < n; i++) { + // WAW dependence with previous declaration of sum + sum = sum + A[i]; + } + + // RAW dependence with previous statements + // Control dependence on next two statements + if(sum > 10) { + printf("Sum is greater than 10"); + } else { + printf("Sum is smaller or equal 10"); + } + + return 0; +} diff --git a/targets/slicingEx.c b/targets/slicingEx.c new file mode 100644 index 0000000000..4d67f50347 --- /dev/null +++ b/targets/slicingEx.c @@ -0,0 +1,77 @@ +#include +#include + +#include "slicingEx2.h" +int global = 0; + +int bar(int k); +struct point *getSomePoint(struct point* p, struct point* p2); +int foo(int i,int k,int j); + +struct point { + int x; + int y; +}; + + +struct point *getSomePoint(struct point* p, struct point* p2) { + if (rand() < (RAND_MAX/2)) { + return p; + } else { + return p2; + } +} + +static int int_add(int i, int j){ + return i + j; +} + +static int int_mod(int i, int j){ + return i % j; +} + + +int foo3(struct point* p) { + return p->x + p->y; +} + +int (*getFunction ()) (int,int){ + if (rand() < (RAND_MAX/2)) { + return &int_add; + } else { + return &int_mod; + } +} + +int bar(int k) { + int i = 0; + struct point p = { k,2}; + struct point p2 = { 1, k + 5}; + p.x = 5; + p.y = k; + global = 42; + i += foo2(7,8); + i += foo3(&p2); + i += foo3(&p); + i += foo3(getSomePoint(&p,&p2)); + i += fp(2,4,getFunction()); + return i; +} + +int foo(int i,int k,int j){ + i += bar(k); + if (i == 0){ + return k; + } else { + return j; + } +} + +int main() { + int A = foo(0,1,2); + int B = foo(5,3,4); + printf("%d\n", A); + printf("%d\n", B); + printf("%d\n", global); + printf("%d\n", global2); +} \ No newline at end of file diff --git a/targets/slicingEx2.c b/targets/slicingEx2.c new file mode 100644 index 0000000000..551fffe9a1 --- /dev/null +++ b/targets/slicingEx2.c @@ -0,0 +1,30 @@ + +#include + +#include "slicingEx2.h" + +int foo_impl(int i, int j) { + return i * j; +} + +int foo2(int i, int j) { + return fp(i,j,&foo_impl); +} + +int fp(int i, int j, int (*f)(int,int)) { + return f(i,j); + +} + +int intra() { + jmp_buf env; + int i = setjmp(env); + int k = 0; + if (i == 0) { + k = 2; + longjmp(env,2); + } else { + k = 1; + } + return k; +} \ No newline at end of file diff --git a/targets/slicingEx2.h b/targets/slicingEx2.h new file mode 100644 index 0000000000..accd598106 --- /dev/null +++ b/targets/slicingEx2.h @@ -0,0 +1,12 @@ + +#if !defined(SLICING_EX_2_H) +#define SLICING_EX_2_H + +int global2; +int foo2(int, int); +int fp(int , int , int (*)(int,int)); +int intra(); + + +#endif // SLICING_EX_2_H + diff --git a/targets/switch-ex.o.json b/targets/switch-ex.o.json new file mode 100644 index 0000000000..030b2ba4ba --- /dev/null +++ b/targets/switch-ex.o.json @@ -0,0 +1 @@ +{ "directory": "/media/Volume/Arbeit/Arbeit/code/phasar/targets", "file": "../targets/switch_ex.c", "output": "../targets/switch_ex.ll", "arguments": ["/home/torun/code/llvm-project/install/bin/clang-10", "-xc", "../targets/switch_ex.c", "-o", "../targets/switch_ex.ll", "-S", "-emit-llvm", "-g", "--target=x86_64-unknown-linux-gnu"]}, diff --git a/targets/switch.json b/targets/switch.json new file mode 100644 index 0000000000..eac2a2afd9 --- /dev/null +++ b/targets/switch.json @@ -0,0 +1,22 @@ +[ + { + "term": "foo", + "file": "switch_ex.c", + "locations": [ + { + "line": 10, + "column": 5, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 16, + "column": 5, + "meta": { + "Kind": "Identifier" + } + } + ] + } +] \ No newline at end of file diff --git a/targets/switch_ex.c b/targets/switch_ex.c new file mode 100644 index 0000000000..7914531691 --- /dev/null +++ b/targets/switch_ex.c @@ -0,0 +1,18 @@ + +void foo() {} +void foo2() {} +void foo3() {} + +int main(int argc, char **argv) { + switch (argc) { + case 0: + case 1: + foo(); + break; + case 2: + foo2(); + case 3: + default: + foo3(); + } +} \ No newline at end of file diff --git a/targets/test.cpp b/targets/test.cpp new file mode 100644 index 0000000000..39ce0c855d --- /dev/null +++ b/targets/test.cpp @@ -0,0 +1,24 @@ + + + +#include + +int throws_something(){ + int r = rand(); + if (r < (RAND_MAX/2)) { + throw r; + } else { + throw r + 5; + } +} + +int main(int, char*[]) { + try { + throws_something(); + } catch (int x) { + + } +} + + + diff --git a/targets/toSlice.json b/targets/toSlice.json new file mode 100644 index 0000000000..cf3c06723e --- /dev/null +++ b/targets/toSlice.json @@ -0,0 +1,22 @@ +[ + { + "term": "foo", + "file": "slicingEx.c", + "locations": [ + { + "line": 71, + "column": 13, + "meta": { + "Kind": "Identifier" + } + }, + { + "line": 72, + "column": 13, + "meta": { + "Kind": "Identifier" + } + } + ] + } +] \ No newline at end of file diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index b493441acd..77c3ad2428 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -2,3 +2,4 @@ add_subdirectory(boomerang) add_subdirectory(example-tool) add_subdirectory(phasar-clang) add_subdirectory(phasar-llvm) +add_subdirectory(module-extractor) \ No newline at end of file diff --git a/tools/boomerang/CMakeLists.txt b/tools/boomerang/CMakeLists.txt index a185b6f2e9..bc85bf3815 100644 --- a/tools/boomerang/CMakeLists.txt +++ b/tools/boomerang/CMakeLists.txt @@ -1,42 +1,40 @@ # Build a stand-alone executable -if(PHASAR_IN_TREE) - add_phasar_executable(boomerang - boomerang.cpp - ) -else() - add_executable(boomerang - boomerang.cpp - ) -endif() +if (PHASAR_IN_TREE) + add_phasar_executable(boomerang + boomerang.cpp + ) +else () + add_executable(boomerang + boomerang.cpp + ) +endif () find_package(Boost COMPONENTS log filesystem program_options graph ${BOOST_THREAD} REQUIRED) target_link_libraries(boomerang - LINK_PUBLIC - phasar_config - phasar_controller - phasar_db - phasar_controlflow - phasar_ifdside - phasar_mono - phasar_wpds - phasar_syncpds - ${PHASAR_PLUGINS_LIB} - wali - phasar_passes - phasar_pointer - phasar_typehierarchy - phasar_phasarllvm_utils - phasar_utils - ${Boost_LIBRARIES} - ${CMAKE_DL_LIBS} - ${CMAKE_THREAD_LIBS_INIT} -) + LINK_PUBLIC + phasar_config + phasar_controller + phasar_db + phasar_controlflow + phasar_ifdside + phasar_mono + phasar_wpds + phasar_syncpds + ${PHASAR_PLUGINS_LIB} + wali + phasar_passes + phasar_pointer + phasar_typehierarchy + phasar_phasarllvm_utils + phasar_utils + ${Boost_LIBRARIES} + ${CMAKE_DL_LIBS} + ${CMAKE_THREAD_LIBS_INIT} + ) -if(USE_LLVM_FAT_LIB) - llvm_config(boomerang USE_SHARED ${LLVM_LINK_COMPONENTS}) -else() - llvm_config(boomerang ${LLVM_LINK_COMPONENTS}) -endif() - -set(LLVM_LINK_COMPONENTS -) +if (USE_LLVM_FAT_LIB) + llvm_config(boomerang USE_SHARED ${LLVM_LINK_COMPONENTS}) +else () + llvm_config(boomerang ${LLVM_LINK_COMPONENTS}) +endif () +set(LLVM_LINK_COMPONENTS) diff --git a/tools/module-extractor/CMakeLists.txt b/tools/module-extractor/CMakeLists.txt new file mode 100644 index 0000000000..fcbb95f0cf --- /dev/null +++ b/tools/module-extractor/CMakeLists.txt @@ -0,0 +1,109 @@ +# Build a stand-alone executable +if (PHASAR_IN_TREE) + add_phasar_executable(slicer + tools/module-extractor/slicer.cpp + tools/module-extractor/back_mapper.cpp + tools/module-extractor/back_mapper.h + tools/module-extractor/printer.cpp + tools/module-extractor/printer.h + tools/module-extractor/source_utils.h + tools/module-extractor/source_utils.cpp + tools/module-extractor/printer.cpp + tools/module-extractor/printer.h + tools/module-extractor/include_handling.cpp + tools/module-extractor/include_handling.h + ) +else () + add_executable(slicer + ../module-extractor/slicer.cpp + ../module-extractor/back_mapper.cpp + ../module-extractor/back_mapper.h + # ../module-extractor/StmtPrinter.cpp + ../module-extractor/source_utils.h + ../module-extractor/source_utils.cpp + ../module-extractor/printer.cpp + ../module-extractor/printer.h + ../module-extractor/printer.cpp + ../module-extractor/printer.h + ../module-extractor/include_handling.cpp + ../module-extractor/include_handling.h + ) +endif () + +if (PHASAR_IN_TREE) + add_phasar_executable(result_comparator + tools/module-extractor/result_comparator.cpp + ) +else () + add_executable(result_comparator + ../module-extractor/result_comparator.cpp + ) +endif () + + +find_package(Boost COMPONENTS log filesystem program_options graph ${BOOST_THREAD} REQUIRED) + +target_link_libraries(slicer + LINK_PUBLIC + phasar_config + phasar_controller + phasar_db + phasar_controlflow + phasar_ifdside + phasar_mono + phasar_wpds + phasar_syncpds + ${PHASAR_PLUGINS_LIB} + wali + phasar_passes + phasar_pointer + phasar_typehierarchy + phasar_phasarllvm_utils + phasar_utils + ${Boost_LIBRARIES} + ${CMAKE_DL_LIBS} + ${CMAKE_THREAD_LIBS_INIT} + ${CLANG_LIBRARY} + LLVMFrontendOpenMP + ) + + +if (USE_LLVM_FAT_LIB) + llvm_config(slicer USE_SHARED ${LLVM_LINK_COMPONENTS}) +else () + llvm_config(slicer ${LLVM_LINK_COMPONENTS}) +endif () + +target_link_libraries(result_comparator + LINK_PUBLIC + phasar_config + phasar_controller + phasar_db + phasar_controlflow + phasar_ifdside + phasar_mono + phasar_wpds + phasar_syncpds + ${PHASAR_PLUGINS_LIB} + wali + phasar_passes + phasar_pointer + phasar_typehierarchy + phasar_phasarllvm_utils + phasar_utils + ${Boost_LIBRARIES} + ${CMAKE_DL_LIBS} + ${CMAKE_THREAD_LIBS_INIT} + ${CLANG_LIBRARY} + ) + + +if (USE_LLVM_FAT_LIB) + llvm_config(slicer USE_SHARED ${LLVM_LINK_COMPONENTS}) + llvm_config(result_comparator USE_SHARED ${LLVM_LINK_COMPONENTS}) +else () + llvm_config(slicer ${LLVM_LINK_COMPONENTS}) + llvm_config(result_comparator ${LLVM_LINK_COMPONENTS}) +endif () + +set(LLVM_LINK_COMPONENTS) diff --git a/tools/module-extractor/back_mapper.cpp b/tools/module-extractor/back_mapper.cpp new file mode 100644 index 0000000000..a03be6cb94 --- /dev/null +++ b/tools/module-extractor/back_mapper.cpp @@ -0,0 +1,87 @@ +#include "back_mapper.h" +#include "printer.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace { + +class RewriteSourceConsumer : public clang::ASTConsumer { +public: + RewriteSourceConsumer(const std::set *target_lines, + std::pair, + std::vector> &output) + : target_lines(target_lines), output(output) {} + void HandleTranslationUnit(clang::ASTContext &Context) override { + // Traversing the translation unit decl via a RecursiveASTVisitor + // will visit all nodes in the AST. + // llvm::dbgs << Context.getTranslationUnitDecl(); + output = printer::DeclPrinterFiltering::GetFileSlices( + Context.getTranslationUnitDecl(), *target_lines, Context); + } + +private: + const std::set *target_lines; + std::pair, std::vector> + &output; +}; + +class RewriteSourceAction { +public: + RewriteSourceAction(const std::set *target_lines, + std::pair, + std::vector> &output) + : target_lines(target_lines), output(output) {} + + std::unique_ptr newASTConsumer() { + return std::unique_ptr( + new RewriteSourceConsumer(target_lines, output)); + } + +private: + const std::set *target_lines; + std::pair, std::vector> + &output; +}; + +} // namespace + +std::pair, std::vector> +add_block(std::string file, const std::set *target_lines) { + std::string err; + auto db = clang::tooling::CompilationDatabase::autoDetectFromDirectory( + boost::filesystem::path(file).parent_path().string(), err); + if (!db) { + throw std::runtime_error(err); + } + std::vector Sources; + Sources.push_back(file); + clang::tooling::ClangTool Tool(*db, Sources); + // Add an include that clang tooling seems to have trouble finding in some + // cases + const auto Adjuster = clang::tooling::getInsertArgumentAdjuster( + "-isystem/usr/local/llvm-10/lib/clang/10.0.1/include", + clang::tooling::ArgumentInsertPosition::BEGIN); + Tool.appendArgumentsAdjuster(Adjuster); + std::pair, std::vector> + buffer; + + std::cerr << file << std::endl; + + Tool.run(clang::tooling::newFrontendActionFactory( + new RewriteSourceAction(target_lines, buffer)) + .get()); + printer::mergeAndSplitSlices(buffer.first); + if (!buffer.second.empty()) { + printer::mergeSlices(buffer.second); + } + return buffer; +} diff --git a/tools/module-extractor/back_mapper.h b/tools/module-extractor/back_mapper.h new file mode 100644 index 0000000000..68a2061d0a --- /dev/null +++ b/tools/module-extractor/back_mapper.h @@ -0,0 +1,19 @@ +#ifndef PHASAR_BACK_MAPPER_H +#define PHASAR_BACK_MAPPER_H + +#include "printer.h" +#include +#include +#include + +/** + * Get the slices for the file 'file' and the given target_lines + * @param file + * @param target_lines + * @return The first vector are the file slices, the second the slices for the + * creation of a header + */ +std::pair, std::vector> +add_block(std::string file, const std::set *target_lines); + +#endif // PHASAR_BACK_MAPPER_H diff --git a/tools/module-extractor/include_handling.cpp b/tools/module-extractor/include_handling.cpp new file mode 100644 index 0000000000..95fe0413e7 --- /dev/null +++ b/tools/module-extractor/include_handling.cpp @@ -0,0 +1,155 @@ +#include "include_handling.h" + +#include +#include +#include +#include + +std::vector +get_includes_to_extract(const std::string &filename, + const std::unordered_set &blacklist) { + // inspired by + // https://stackoverflow.com/questions/26492513/write-c-regular-expression-to-match-a-include-preprocessing-directive + // This does not match weird includes containing macros and may get some + // things in comments + const std::string include_regex_str = + R"reg(\s*#\s*include\s*[<"]([^>"]+)[>"])reg"; + std::regex include_regex(include_regex_str); + std::string original_file_contents; + { + std::ifstream original_file(filename); + std::stringstream buffer; + buffer << original_file.rdbuf(); + original_file_contents = buffer.str(); + } + auto trim = [](std::string str) { + str.erase(str.begin(), + std::find_if(str.begin(), str.end(), + [](unsigned char c) { return !std::isspace(c); })); + str.erase(std::find_if(str.rbegin(), str.rend(), + [](unsigned char c) { return !std::isspace(c); }) + .base(), + str.end()); + return str; + }; + std::vector includes; + auto begin = + std::sregex_iterator(original_file_contents.begin(), + original_file_contents.end(), include_regex); + auto end = std::sregex_iterator(); + for (auto It = begin; It != end; ++It) { + const auto &match = *It; + if (blacklist.find(trim(match[1].str())) == blacklist.end()) { + includes.push_back(trim(match.str())); + } + } + return includes; +} + +boost::filesystem::path get_tmp_filename() { + const auto path = boost::filesystem::temp_directory_path(); + return path / boost::filesystem::unique_path("slice-%%%%-%%%%-%%%%-%%%%"); +} +bool is_iwyu_available() { + static bool is_available = []() { + const bool available = + (WEXITSTATUS(std::system("iwyu_tool.py --help")) == 0) && + (WEXITSTATUS(std::system("fix_includes.py --help")) == 0); + if (!available) { + std::cerr << "iwyu_tool.py or fix_includes.py tool not found. Skipping " + "header cleanup" + << std::endl; + } + return available; + }; + return is_available; +} +void cleanup_includes(const std::string &original_file, + const std::string &header, + const std::string &compile_commands_path) { + if (!is_iwyu_available()) { + return; + } + if (compile_commands_path == "none") { + return; + } + /** + * iwyu expects a compile_commands.json and paths to match, so we use the + * following approach: + * + * 1: Rename the original source file to source file.slicerback + * + * 2: Copy the extracted header to the original source file + * + * 3: Run iwyu + * + * 4: Run fix_include (for some reason iwyu does not include absolute paths, + * so this is actually a multi step process.) + * + * + * 4.a: copy the file from 2 to the tmp dir. (we cant move here as it could be + * between filessystems) + * + * 4.b: run fix_include + * + * 4.c copy the modified source file to the extracted header location + * + * 5: Cleanup temporary files + * + * 6: Undo 1 + */ + + boost::filesystem::path original_path(original_file); + boost::filesystem::path original_backup(original_file + ".slicerback"); + boost::filesystem::path header_path(header); + const std::string iwyu_output_file = get_tmp_filename().native(); + + // 1: (this should not fail) + boost::filesystem::rename(original_path, original_backup); + // 2: (this should not fail) + boost::filesystem::copy_file( + header_path, original_path, + boost::filesystem::copy_options::overwrite_existing); + // 3: (this can fail, for example if we have weird headers) + const std::string iwyu_command = "iwyu_tool.py -p " + compile_commands_path + + " " + original_path.native() + + " -- -Xiwyu --no_fwd_decls 1> " + + iwyu_output_file; + // std::cerr << iwyu_command << std::endl; + const auto iwyu_return = WEXITSTATUS(std::system(iwyu_command.c_str())); + // iwyu has strange exit codes + // https://github.com/include-what-you-use/include-what-you-use/issues/440 + // https://github.com/include-what-you-use/include-what-you-use/blob/master/iwyu_globals.h#L33 + // https://github.com/include-what-you-use/include-what-you-use/blob/master/iwyu.cc#L3648 + if (iwyu_return != 0) { + std::cerr << "An error occurred running the following command: " + << iwyu_command << std::endl; + // Just cleanup but leave the output behind + } else { + // 4 a + const auto tmpdir = boost::filesystem::temp_directory_path(); + const auto name = original_path.filename(); + const auto tmpname = tmpdir / name; + boost::filesystem::copy_file( + original_path, tmpname, + boost::filesystem::copy_options::overwrite_existing); + + // 4 b (this should not fail, but we have no way to check it anyway) + const std::string fix_command = "fix_includes.py -p " + tmpdir.native() + + " --nosafe_headers " + tmpname.native() + + " < " + iwyu_output_file; + + std::system(fix_command.c_str()); + // 4.c (this should not fail) + boost::filesystem::copy_file( + tmpname, header_path, + boost::filesystem::copy_options::overwrite_existing); + // 5 (this should not fail) + boost::filesystem::remove(tmpname); + // 5 (this should not fail) + boost::filesystem::remove(iwyu_output_file); + } + + // 6: (this should not fail) + boost::filesystem::rename(original_backup, original_path); +} diff --git a/tools/module-extractor/include_handling.h b/tools/module-extractor/include_handling.h new file mode 100644 index 0000000000..f7db3dbae6 --- /dev/null +++ b/tools/module-extractor/include_handling.h @@ -0,0 +1,36 @@ +#ifndef PHASAR_INCLUDE_HANDLING_H +#define PHASAR_INCLUDE_HANDLING_H + +#include +#include +#include +#include + +/** + * Returns all includes found in a file, which are not blacklisted + * Based on a regex search + * @param filename The file to search for includes + * @param blacklist set containing includes not to extract + * @return Found includes + */ +std::vector +get_includes_to_extract(const std::string &filename, + const std::unordered_set &blacklist); + +/** + * + * @return Returns the path to a file suitable for temporary files + */ +boost::filesystem::path get_tmp_filename(); + +/** + * + * @return rue if iwyu_tool.py and fix_includes.py can be successfully called + */ +bool is_iwyu_available(); + +void cleanup_includes(const std::string &original_file, + const std::string &header, + const std::string &compile_commands_path); + +#endif // PHASAR_INCLUDE_HANDLING_H diff --git a/tools/module-extractor/printer.cpp b/tools/module-extractor/printer.cpp new file mode 100644 index 0000000000..137f7daca8 --- /dev/null +++ b/tools/module-extractor/printer.cpp @@ -0,0 +1,896 @@ +// +// Created by jr on 12.11.21. +// + +#include "printer.h" +#include "source_utils.h" + +#include +#include + +#include +#include +#include +#include +#include + +// Config +// Should types get sliced +#define EXTRACT_TYPES (true) +// Should functions decls get sliced +#define EXTRACT_FUNCTION_DECLS (true) +// How many slices should be removed from a function, before a copy of the +// function gets generated that only contains the code to keep +#define MIN_FILTERED_FOR_EXTRA_FUNCTION (3) +// Should types get sliced into headers +#define EXTRACT_TYPES_INTO_HEADER (true) + +namespace printer { +void DeclPrinterFiltering::VisitFunctionDecl(const clang::FunctionDecl *decl) { + if (!decl->doesThisDeclarationHaveABody()) { + if (isInSourceFile(decl, SM)) { + const auto Semicolon = + utils::getSemicolonAfterStmtEndLoc(decl->getEndLoc(), SM, LO); + Slice S; + if (Semicolon.isValid()) { + S = Slice(SM.getExpansionRange(decl->getBeginLoc()).getBegin(), + utils::getEndOfToken(Semicolon, SM, LO)); + } else { + S = Slice( + SM.getExpansionRange(decl->getBeginLoc()).getBegin(), + utils::getEndOfToken( + SM.getExpansionRange(decl->getEndLoc()).getBegin(), SM, LO)); + } + if (!isAnyInWhitelist(decl, TargetLines, SM) && !EXTRACT_FUNCTION_DECLS) { + S.NeedsDefine = true; + } + Slices.push_back(S); + } + + } else { + if (isInSourceFile(decl, SM)) { + if (printer::isAnyInWhitelist(decl, TargetLines, SM)) { + unsigned filtered; + const auto Body = StmtPrinterFiltering::GetSlices( + decl->getBody(), TargetLines, CTX, SM, LO, &filtered); + std::vector TmpSlices; + TmpSlices.emplace_back( + SM.getExpansionRange(decl->getBeginLoc()).getBegin(), + utils::getEndOfToken( + SM.getExpansionRange(decl->getBody()->getBeginLoc()).getBegin(), + SM, LO)); + TmpSlices.emplace_back( + SM.getExpansionRange(decl->getBody()->getEndLoc()).getEnd(), + utils::getEndOfToken( + SM.getExpansionRange(decl->getEndLoc()).getEnd(), SM, LO)); + TmpSlices.insert(TmpSlices.end(), Body.begin(), Body.end()); + if (filtered >= MIN_FILTERED_FOR_EXTRA_FUNCTION) { + Slices.emplace_back( + SM.getExpansionRange(decl->getBeginLoc()).getBegin(), + utils::getEndOfToken( + SM.getExpansionRange(decl->getEndLoc()).getEnd(), SM, LO), + TmpSlices); + } else { + Slices.insert(Slices.end(), TmpSlices.begin(), TmpSlices.end()); + } + + auto FirstDecl = decl->getFirstDecl(); + assert(FirstDecl); + if (!isInSourceFile(FirstDecl, SM)) { + FirstDecl = decl; + } + if (FirstDecl->doesThisDeclarationHaveABody()) { + auto S = Slice::generateFromStartAndNext( + FirstDecl->getBeginLoc(), FirstDecl->getBody()->getBeginLoc(), SM, + LO); + S.NeedsDefine = true; + HeaderSlices.push_back(S); + } else { + const auto Semicolon = utils::getSemicolonAfterStmtEndLoc( + FirstDecl->getEndLoc(), SM, LO); + Slice S; + if (Semicolon.isValid()) { + S = Slice(SM.getExpansionRange(FirstDecl->getBeginLoc()).getBegin(), + utils::getEndOfToken(Semicolon, SM, LO)); + } else { + S = Slice(SM.getExpansionRange(FirstDecl->getBeginLoc()).getBegin(), + utils::getEndOfToken( + SM.getExpansionRange(FirstDecl->getEndLoc()).getEnd(), + SM, LO)); + } + S.NeedsDefine = false; + HeaderSlices.push_back(S); + } + + } else { + Slices.emplace_back( + SM.getExpansionRange(decl->getBeginLoc()).getBegin(), + utils::getEndOfToken( + SM.getExpansionRange(decl->getEndLoc()).getEnd(), SM, LO), + true); + } + } + } +} +void DeclPrinterFiltering::VisitDecl(const clang::Decl *decl) { + // decl->dump(); +} + +void DeclPrinterFiltering::VisitTranslationUnitDecl( + const clang::TranslationUnitDecl *decl) { + for (const auto &D : decl->decls()) { + Visit(D); + } +} + +DeclPrinterFiltering::DeclPrinterFiltering(const std::set &Target, + const clang::ASTContext &CTX, + const clang::SourceManager &SM, + const clang::LangOptions &LO) + : TargetLines(Target), CTX(CTX), SM(SM), LO(LO) {} +std::pair, std::vector> +DeclPrinterFiltering::GetSlices(const clang::Decl *Decl, + const std::set &TargetLines, + const clang::ASTContext &CTX, + const clang::SourceManager &SM, + const clang::LangOptions &LO) { + DeclPrinterFiltering Visitor(TargetLines, CTX, SM, LO); + Visitor.Visit(Decl); + return {Visitor.Slices, Visitor.HeaderSlices}; +} +std::pair, std::vector> +DeclPrinterFiltering::GetFileSlices(const clang::Decl *Decl, + const std::set &TargetLines, + const clang::ASTContext &CTX) { + const auto &SM = CTX.getSourceManager(); + const auto Slices = DeclPrinterFiltering::GetSlices(Decl, TargetLines, CTX, + SM, CTX.getLangOpts()); + std::pair, std::vector> + Result; + Result.first.reserve(Slices.first.size()); + for (const auto &S : Slices.first) { + Result.first.emplace_back(S, SM); + } + Result.second.reserve(Slices.second.size()); + for (const auto &S : Slices.second) { + Result.second.emplace_back(S, SM); + } + return Result; +} +void DeclPrinterFiltering::VisitVarDecl(const clang::VarDecl *Decl) { + if (isInSourceFile(Decl, SM)) { + const auto Semicolon = utils::getSemicolonAfterStmtEndLoc( + Decl->getSourceRange().getEnd(), SM, LO); + Slice S; + if (Semicolon.isValid()) { + S = Slice(SM.getExpansionRange(Decl->getBeginLoc()).getBegin(), + utils::getEndOfToken(Semicolon, SM, LO)); + } else { + S = Slice(SM.getExpansionRange(Decl->getBeginLoc()).getBegin(), + utils::getEndOfToken( + SM.getExpansionRange(Decl->getEndLoc()).getEnd(), SM, LO)); + } + + if (!isAnyInWhitelist(Decl, TargetLines, SM)) { + S.NeedsDefine = true; + } + Slices.push_back(S); + } +} +void DeclPrinterFiltering::VisitTypeDecl(const clang::TypeDecl *Decl) { + if (isInSourceFile(Decl, SM)) { + const auto Semicolon = + utils::getSemicolonAfterStmtEndLoc(Decl->getEndLoc(), SM, LO); + Slice S; + if (Semicolon.isValid()) { + S = Slice(SM.getExpansionRange(Decl->getBeginLoc()).getBegin(), + utils::getEndOfToken(Semicolon, SM, LO)); + } else { + S = Slice(SM.getExpansionRange(Decl->getBeginLoc()).getBegin(), + utils::getEndOfToken( + SM.getExpansionRange(Decl->getEndLoc()).getEnd(), SM, LO)); + } + + if (!isAnyInWhitelist(Decl, TargetLines, SM) && !EXTRACT_TYPES) { + S.NeedsDefine = true; + } + Slices.push_back(S); +#ifdef EXTRACT_TYPES_INTO_HEADER + S.NeedsDefine = false; + HeaderSlices.push_back(S); +#endif + } +} + +bool StmtPrinterFiltering::VisitStmt(const clang::Stmt *Stmt) { + if (isAnyInWhitelist(Stmt, TargetLines, SM)) { + Slices.emplace_back( + SM.getExpansionRange(Stmt->getBeginLoc()).getBegin(), + utils::getEndOfToken(SM.getExpansionRange(Stmt->getEndLoc()).getEnd(), + SM, LO)); + return true; + } + Filtered++; + Slices.emplace_back( + SM.getExpansionRange(Stmt->getBeginLoc()).getBegin(), + utils::getEndOfToken(SM.getExpansionRange(Stmt->getEndLoc()).getEnd(), SM, + LO), + true); + // llvm_unreachable("Hit unsupported stmt"); + return false; +} +bool StmtPrinterFiltering::VisitCompoundStmt(const clang::CompoundStmt *Stmt) { + Slices.emplace_back( + SM.getExpansionRange(Stmt->getBeginLoc()).getBegin(), + utils::getEndOfToken(SM.getExpansionRange(Stmt->getLBracLoc()).getBegin(), + SM, LO)); + Slices.emplace_back( + SM.getExpansionRange(Stmt->getRBracLoc()).getEnd(), + utils::getEndOfToken(SM.getExpansionRange(Stmt->getEndLoc()).getEnd(), SM, + LO)); + for (const auto *I : Stmt->body()) { + PrintStmt(I); + } + return true; +} +StmtPrinterFiltering::StmtPrinterFiltering( + const std::set &TargetLines, const clang::SourceManager &SM, + const clang::LangOptions &LO) + : TargetLines(TargetLines), SM(SM), LO(LO) {} +bool StmtPrinterFiltering::VisitWhileStmt(const clang::WhileStmt *Stmt) { + if (isAnyInWhitelist(Stmt, TargetLines, SM)) { + Slices.emplace_back(Slice::generateFromStartAndNext( + Stmt->getBeginLoc(), Stmt->getBody()->getBeginLoc(), SM, LO)); + PrintStmt(Stmt->getBody(), true); + return true; + } + Filtered++; + Slices.emplace_back( + SM.getExpansionRange(Stmt->getBeginLoc()).getBegin(), + utils::getEndOfToken(SM.getExpansionRange(Stmt->getEndLoc()).getEnd(), SM, + LO), + true); + return false; +} +bool StmtPrinterFiltering::VisitForStmt(const clang::ForStmt *Stmt) { + if (isAnyInWhitelist(Stmt, TargetLines, SM)) { + Slices.emplace_back(Slice::generateFromStartAndNext( + Stmt->getBeginLoc(), Stmt->getBody()->getBeginLoc(), SM, LO)); + PrintStmt(Stmt->getBody(), true); + return true; + } + Filtered++; + Slices.emplace_back( + SM.getExpansionRange(Stmt->getBeginLoc()).getBegin(), + utils::getEndOfToken(SM.getExpansionRange(Stmt->getEndLoc()).getEnd(), SM, + LO), + true); + return false; +} +bool StmtPrinterFiltering::VisitDoStmt(const clang::DoStmt *Stmt) { + if (isAnyInWhitelist(Stmt, TargetLines, SM)) { + Slices.emplace_back(Slice::generateFromStartAndNext( + Stmt->getBeginLoc(), Stmt->getBody()->getBeginLoc(), SM, LO)); + PrintStmt(Stmt->getBody(), true); + Slices.emplace_back( + SM.getExpansionRange(Stmt->getWhileLoc()).getBegin(), + utils::getEndOfToken(SM.getExpansionRange(Stmt->getEndLoc()).getEnd(), + SM, LO)); + return true; + } + Filtered++; + Slices.emplace_back( + SM.getExpansionRange(Stmt->getBeginLoc()).getBegin(), + utils::getEndOfToken(SM.getExpansionRange(Stmt->getEndLoc()).getEnd(), SM, + LO), + true); + return false; +} +bool StmtPrinterFiltering::VisitSwitchStmt(const clang::SwitchStmt *Stmt) { + if (isAnyInWhitelist(Stmt, TargetLines, SM)) { + Slices.emplace_back(Slice::generateFromStartAndNext( + Stmt->getBeginLoc(), Stmt->getBody()->getBeginLoc(), SM, LO)); + // Stmt->getBody()->dump(); + PrintStmt(Stmt->getBody(), true); + return true; + } + Filtered++; + Slices.emplace_back( + SM.getExpansionRange(Stmt->getBeginLoc()).getBegin(), + utils::getEndOfToken(SM.getExpansionRange(Stmt->getEndLoc()).getEnd(), SM, + LO), + true); + return false; +} + +std::vector StmtPrinterFiltering::GetSlices( + const clang::Stmt *Stmt, const std::set &TargetLines, + const clang::ASTContext &CTX, const clang::SourceManager &SM, + const clang::LangOptions &LO, unsigned *filtered) { + StmtPrinterFiltering Visitor(TargetLines, SM, LO); + Visitor.Visit(Stmt); + if (filtered != nullptr) { + *filtered = Visitor.Filtered; + } + return Visitor.Slices; +} +void StmtPrinterFiltering::PrintStmt(const clang::Stmt *Stmt, bool required) { + if (Stmt && + (llvm::isa(Stmt) || llvm::isa(Stmt) || + llvm::isa(Stmt) || + llvm::isa(Stmt) || + llvm::isa(Stmt))) { + bool visited = Visit(Stmt); + auto Semicolon = + utils::getSemicolonAfterStmtEndLoc(Stmt->getEndLoc(), SM, LO); + if (!Semicolon.isValid()) { + Semicolon = SM.getExpansionRange(Stmt->getEndLoc()).getEnd(); + } + if (visited || required) { + + if (visited) { + Slices.emplace_back(SM.getExpansionRange(Stmt->getEndLoc()).getEnd(), + utils::getEndOfToken(Semicolon, SM, LO)); + } else { + Slices.emplace_back(Semicolon, utils::getEndOfToken(Semicolon, SM, LO)); + } + } else { + Filtered++; + Slices.emplace_back(Semicolon, utils::getEndOfToken(Semicolon, SM, LO), + true); + } + } else if (Stmt) { + // Stmt->dump(); + Visit(Stmt); + } else { + llvm_unreachable("Null Stmt"); + } +} +bool StmtPrinterFiltering::VisitIfStmt(const clang::IfStmt *Stmt) { + if (isAnyInWhitelist(Stmt, TargetLines, SM)) { + // Stmt->getBeginLoc().dump(SM); + // Stmt->getEndLoc().dump(SM); + // Stmt->dump(); + Slices.emplace_back(Slice::generateFromStartAndNext( + Stmt->getBeginLoc(), Stmt->getThen()->getBeginLoc(), SM, LO)); + PrintStmt(Stmt->getThen(), true); + if (Stmt->getElse() && isAnyInWhitelist(Stmt->getElse(), TargetLines, SM)) { + // Stmt->getElseLoc().dump(SM); + // Stmt->getEndLoc().dump(SM); + // SM.getImmediateExpansionRange(Stmt->getEndLoc()).getEnd().dump(SM); + // SM.getExpansionRange(Stmt->getEndLoc()).getEnd().dump(SM); + Slices.emplace_back(Slice::generateFromStartAndNext( + Stmt->getElseLoc(), Stmt->getElse()->getBeginLoc(), SM, LO)); + PrintStmt(Stmt->getElse(), true); + } else if (Stmt->getElse()) { + Filtered++; + Slices.emplace_back( + SM.getExpansionRange(Stmt->getElse()->getBeginLoc()).getBegin(), + utils::getEndOfToken( + SM.getExpansionRange(Stmt->getElse()->getEndLoc()).getEnd(), SM, + LO), + true); + } + return true; + } + Filtered++; + Slices.emplace_back( + SM.getExpansionRange(Stmt->getBeginLoc()).getBegin(), + utils::getEndOfToken(SM.getExpansionRange(Stmt->getEndLoc()).getEnd(), SM, + LO), + true); + return false; +} +bool StmtPrinterFiltering::VisitCaseStmt(const clang::CaseStmt *Stmt) { + if (isAnyInWhitelist(Stmt, TargetLines, SM)) { + Slices.emplace_back(Slice::generateFromStartAndNext( + Stmt->getBeginLoc(), Stmt->getSubStmt()->getBeginLoc(), SM, LO)); + PrintStmt(Stmt->getSubStmt()); + return true; + } + Filtered++; + Slices.emplace_back( + SM.getExpansionRange(Stmt->getBeginLoc()).getBegin(), + utils::getEndOfToken(SM.getExpansionRange(Stmt->getEndLoc()).getEnd(), SM, + LO), + true); + + return false; +} +bool StmtPrinterFiltering::VisitDefaultStmt(const clang::DefaultStmt *Stmt) { + if (isAnyInWhitelist(Stmt, TargetLines, SM)) { + Slices.emplace_back(Slice::generateFromStartAndNext( + Stmt->getBeginLoc(), Stmt->getSubStmt()->getBeginLoc(), SM, LO)); + PrintStmt(Stmt->getSubStmt()); + return true; + } + Filtered++; + Slices.emplace_back( + SM.getExpansionRange(Stmt->getBeginLoc()).getBegin(), + utils::getEndOfToken(SM.getExpansionRange(Stmt->getEndLoc()).getEnd(), SM, + LO), + true); + return false; +} + + +printer::Slice::Slice(clang::SourceLocation Begin, clang::SourceLocation End, + bool NeedsDefine) + : Begin(Begin), End(End), NeedsDefine(NeedsDefine) { + assert(Begin.isValid()); + assert(End.isValid()); +} +Slice Slice::generateFromStartAndNext(clang::SourceLocation Start, + clang::SourceLocation Next, + const clang::SourceManager &SM, + const clang::LangOptions &LO) { + const auto TmpEnd = SM.getExpansionRange(Next).getEnd(); + const auto TmpStart = SM.getExpansionRange(Start).getBegin(); + if (TmpEnd == TmpStart) { + return {TmpStart, utils::getEndOfToken(TmpStart, SM, LO)}; + } + return {TmpStart, utils::getEndOfToken( + utils::findPreviousTokenStart(TmpEnd, SM, LO), SM, LO)}; +} +Slice::Slice(clang::SourceLocation Begin, clang::SourceLocation End, + std::vector Keep) + : Begin(Begin), End(End), NeedsDefine(true), Keep(std::move(Keep)) { + assert(Begin.isValid()); + assert(End.isValid()); +} +Slice::Slice() {} + +std::ostream &operator<<(std::ostream &os, const FileOffset &offset) { + os << "[" << offset.Line << ":" << offset.Column << "]"; + return os; +} +FileOffset::FileOffset(const clang::PresumedLoc &Loc) + : Line(Loc.getLine()), Column(Loc.getColumn()) { + assert(Loc.isValid()); + assert(Line > 0 && Column > 0); +} +unsigned int FileOffset::GetSliceColumn() const { + assert(Column >= 1); + return Column - 1; +} +unsigned int FileOffset::GetSliceLine() const { + assert(Line >= 1); + return Line - 1; +} +bool FileOffset::operator==(const FileOffset &rhs) const { + return std::tie(Line, Column) == std::tie(rhs.Line, rhs.Column); +} +bool FileOffset::operator!=(const FileOffset &rhs) const { + return !(rhs == *this); +} +bool FileOffset::operator<(const FileOffset &rhs) const { + return std::tie(Line, Column) < std::tie(rhs.Line, rhs.Column); +} +bool FileOffset::operator>(const FileOffset &rhs) const { return rhs < *this; } +bool FileOffset::operator<=(const FileOffset &rhs) const { + return !(rhs < *this); +} +bool FileOffset::operator>=(const FileOffset &rhs) const { + return !(*this < rhs); +} +// FileSlice::FileSlice(FileOffset Begin, FileOffset End) +// : Begin(Begin), End(End) { +// assert(Begin < End); +// } +std::ostream &operator<<(std::ostream &os, const FileSlice &slice) { + os << slice.Begin << " - " << slice.End; + return os; +} +FileSlice::FileSlice(const Slice &Slice, const clang::SourceManager &SM) + : Begin(utils::getLocationAsWritten(Slice.Begin, SM)), + End(utils::getLocationAsWritten(Slice.End, SM)), + NeedsDefine(Slice.NeedsDefine) { + for (const auto &S : Slice.Keep) { + Keep.emplace_back(S, SM); + } +} +bool FileSlice::operator==(const FileSlice &rhs) const { + return std::tie(Begin, End, NeedsDefine, Keep) == + std::tie(rhs.Begin, rhs.End, rhs.NeedsDefine, rhs.Keep); +} +bool FileSlice::operator!=(const FileSlice &rhs) const { + return !(rhs == *this); +} +void mergeSlices(std::vector &Slices) { + assert(!Slices.empty()); + std::sort( + Slices.begin(), Slices.end(), + [](const FileSlice &a, const FileSlice &b) { return a.Begin < b.Begin; }); + auto OutputIndex = Slices.begin(); + for (std::size_t I = 1; I < Slices.size(); I++) { + if (OutputIndex->End >= Slices[I].Begin && + OutputIndex->Keep == Slices[I].Keep) { + OutputIndex->End = std::max(OutputIndex->End, Slices[I].End); + } else { + OutputIndex++; + *OutputIndex = Slices[I]; + } + } + OutputIndex++; + Slices.erase(OutputIndex, Slices.end()); +} + +void mergeAndSplitSlices(std::vector &Slices) { + assert(!Slices.empty()); + + std::vector Tmp; + std::copy_if(Slices.begin(), Slices.end(), std::back_inserter(Tmp), + [](const auto &Slice) { return Slice.NeedsDefine; }); + Slices.clear(); + std::copy(Tmp.begin(), Tmp.end(), std::back_inserter(Slices)); + + if (!Slices.empty()) { + mergeSlices(Slices); + } +} + + +bool notOnlyWhitespace(const std::string &Str) { + return std::any_of(Str.begin(), Str.end(), + [](unsigned char c) { return !isspace(c); }); +} + +void extractHeaderSlices(const std::string &FileIn, const std::string &FileOut, + const std::vector &Slices, + const std::string &FileName, + const std::vector &includes) { + std::ifstream Input(FileIn); + if (!Input.is_open()) { + throw std::runtime_error("Could not open input file " + FileIn); + } + std::ofstream Output(FileOut); + if (!Output.is_open()) { + throw std::runtime_error("Could not open output file " + FileOut); + } + std::string HeaderName = FileName.substr(0, FileName.find('.')); + std::transform(HeaderName.begin(), HeaderName.end(), HeaderName.begin(), + [](unsigned char c) { return std::toupper(c); }); + HeaderName += "_H"; + Output << "#ifndef " << HeaderName << '\n'; + Output << "#define " << HeaderName << '\n'; + + Output << "\n// Includes\n"; + for (const auto &Include : includes) { + Output << Include << '\n'; + } + Output << "// End Includes\n"; + + std::string Line; + unsigned int LineNumber = 0; + auto PreviousSlice = Slices.end(); + auto CurrentSlice = Slices.begin(); + while (std::getline(Input, Line)) { + while (true) { + // Case: We are in text before the slice + if (CurrentSlice == Slices.end() || + CurrentSlice->Begin.GetSliceLine() > LineNumber) { + break; + } + // Handle the following cases: + // We are in a completely sliced line, excluding the end or begin: Copy + // the complete line + // We are in the first line: Pad from the previous slice with spaces + // and add the text + // We are in the last line: Add text, check if + // others slices are needed in the same line + if (CurrentSlice->Begin.GetSliceLine() < LineNumber && + CurrentSlice->End.GetSliceLine() > LineNumber) { + Output << Line << '\n'; + break; + } + if (CurrentSlice->Begin.GetSliceLine() == LineNumber) { + if (PreviousSlice != Slices.end() && + PreviousSlice->End.GetSliceLine() == LineNumber) { + // We need to pad only after the last slice + for (unsigned int I = 0; I < CurrentSlice->Begin.GetSliceColumn() - + PreviousSlice->End.GetSliceColumn(); + I++) { + Output << ' '; + } + } else { + for (unsigned int I = 0; I < CurrentSlice->Begin.GetSliceColumn(); + I++) { + Output << ' '; + } + } + // Copy our slice + if (CurrentSlice->End.GetSliceLine() == LineNumber) { + Output << Line.substr(CurrentSlice->Begin.GetSliceColumn(), + CurrentSlice->End.GetSliceColumn() - + CurrentSlice->Begin.GetSliceColumn()); + if (CurrentSlice->NeedsDefine) { + Output << ';'; + } + Output << '\n'; + } else { + Output << Line.substr(CurrentSlice->Begin.GetSliceColumn()) << '\n'; + break; + } + } else { + // Handle end case + Output << Line.substr(0, CurrentSlice->End.GetSliceColumn()); + if (CurrentSlice->NeedsDefine) { + Output << ';'; + } + Output << '\n'; + } + + PreviousSlice = CurrentSlice; + CurrentSlice++; + if (CurrentSlice == Slices.end()) { + Output << '\n'; + break; + } + } + LineNumber++; + } + + Output << "#endif //" << HeaderName << '\n'; +} + +void extractSlicesDefine(const std::string &FileIn, std::ofstream &Output, + const std::vector &Slices) { + assert(std::is_sorted(Slices.begin(), Slices.end(), + [](const FileSlice &a, const FileSlice &b) { + return a.Begin < b.Begin; + })); + std::ifstream Input(FileIn); + if (!Input.is_open()) { + throw std::runtime_error("Could not open input file " + FileIn); + } + + if (!Output.is_open()) { + throw std::runtime_error("Could not write to output file "); + } + + std::vector Lines; + { + std::string Line; + while (std::getline(Input, Line)) { + Lines.push_back(Line); + } + } + + std::string Line; + unsigned int LineNumber = 0; + bool InSliceGroup = false; + + auto CurrentSlice = Slices.begin(); + auto NextSlice = CurrentSlice + 1; + for (unsigned I = 0; I < Lines.size(); I++) { + Line = Lines[I]; + while (true) { + // Case: We are in text before the slice + if (CurrentSlice == Slices.end() || + CurrentSlice->Begin.GetSliceLine() > LineNumber) { + Output << Line << '\n'; + break; + } + + // Case: We are in the middle of a slice + if (CurrentSlice->Begin.GetSliceLine() < LineNumber && + CurrentSlice->End.GetSliceLine() > LineNumber) { + Output << Line << '\n'; + break; + } + + // Case Slice is starting in this line + if (CurrentSlice->Begin.GetSliceLine() == LineNumber) { + if (!CurrentSlice->Keep.empty()) { + extractRewrittenFunction(Lines, CurrentSlice->Keep, Output); + } + if (CurrentSlice->Begin.GetSliceColumn() != 0) { + const auto Sub = Line.substr(0, CurrentSlice->Begin.GetSliceColumn()); + if (notOnlyWhitespace(Sub)) { + Output << Sub; + if (!InSliceGroup) { + Output << '\n'; + } + } + } + if (!InSliceGroup) { + Output << "#ifndef SLICE\n"; + } else { + Output << '\n'; + } + InSliceGroup = false; + for (unsigned int I = 0; I < CurrentSlice->Begin.GetSliceColumn(); + I++) { + Output << ' '; + } + // Copy our slice + if (CurrentSlice->End.GetSliceLine() == LineNumber) { + // This slice is ending in the same line it is starting in + Output << Line.substr(CurrentSlice->Begin.GetSliceColumn(), + CurrentSlice->End.GetSliceColumn() - + CurrentSlice->Begin.GetSliceColumn()); + + if (NextSlice == Slices.end() || + NextSlice->Begin.GetSliceLine() > LineNumber) { + // The next slice does not start in the same line + auto Sub = Line.substr(CurrentSlice->End.GetSliceColumn()); + if (notOnlyWhitespace(Sub)) { + Output << "\n#endif //Slice\n"; + Output << Sub << '\n'; + } else { + if (NextSlice != Slices.end() && NextSlice->Keep.empty()) { + bool FoundText = false; + unsigned TmpLine = I + 1; + while (!FoundText && + NextSlice->Begin.GetSliceLine() > TmpLine) { + FoundText |= notOnlyWhitespace(Lines[TmpLine]); + TmpLine++; + } + const auto TmpSub = + Lines[NextSlice->Begin.GetSliceLine()].substr( + 0, NextSlice->Begin.GetSliceColumn()); + FoundText |= notOnlyWhitespace(TmpSub); + if (!FoundText) { + InSliceGroup = true; + } else { + Output << "\n#endif //Slice\n"; + } + } else { + Output << "\n#endif //Slice\n"; + } + } + + } else { + + // Next slice to define is in the same column + const auto TmpSub = + Line.substr(CurrentSlice->End.GetSliceColumn(), + NextSlice->Begin.GetSliceColumn() - + CurrentSlice->End.GetSliceColumn()); + const bool FoundText = notOnlyWhitespace(TmpSub); + if (FoundText || !NextSlice->Keep.empty()) { + Output << "\n#endif //Slice\n"; + } else { + InSliceGroup = true; + } + Output << TmpSub; + } + } else { + // The current slice is spanning multiple lines + Output << Line.substr(CurrentSlice->Begin.GetSliceColumn()) << '\n'; + break; + } + } else { + // Handle end case + Output << Line.substr(0, CurrentSlice->End.GetSliceColumn()); + if (NextSlice == Slices.end() || + NextSlice->Begin.GetSliceLine() > LineNumber) { + auto Sub = Line.substr(CurrentSlice->End.GetSliceColumn()); + if (notOnlyWhitespace(Sub)) { + Output << "\n#endif //Slice\n"; + Output << Sub << '\n'; + } else { + if (NextSlice != Slices.end() && NextSlice->Keep.empty()) { + bool FoundText = false; + unsigned TmpLine = I + 1; + while (!FoundText && NextSlice->Begin.GetSliceLine() > TmpLine) { + FoundText |= notOnlyWhitespace(Lines[TmpLine]); + TmpLine++; + } + const auto TmpSub = Lines[NextSlice->Begin.GetSliceLine()].substr( + 0, NextSlice->Begin.GetSliceColumn()); + FoundText |= notOnlyWhitespace(TmpSub); + if (!FoundText) { + InSliceGroup = true; + } else { + Output << "\n#endif //Slice\n"; + } + } else { + Output << "\n#endif //Slice\n"; + } + } + } else { + // Next slice to define is in the same column + const auto TmpSub = + Line.substr(CurrentSlice->End.GetSliceColumn(), + NextSlice->Begin.GetSliceColumn() - + CurrentSlice->End.GetSliceColumn()); + const bool FoundText = notOnlyWhitespace(TmpSub); + if (FoundText || !NextSlice->Keep.empty()) { + Output << "\n#endif //Slice\n"; + } else { + InSliceGroup = true; + } + Output << TmpSub; + } + } + + CurrentSlice++; + NextSlice = CurrentSlice + 1; + if (CurrentSlice == Slices.end() || + CurrentSlice->Begin.GetSliceLine() > LineNumber) { + break; + } + } + LineNumber++; + } +} +void extractRewrittenFunction(const std::vector &Lines, + const std::vector &SlicesIn, + std::ofstream &Output) { + Output << "#ifdef SLICE\n"; + + std::vector Slices; + std::copy_if(SlicesIn.begin(), SlicesIn.end(), std::back_inserter(Slices), + [](const FileSlice &Slice) { return !Slice.NeedsDefine; }); + + mergeSlices(Slices); + + auto PreviousSlice = Slices.end(); + auto CurrentSlice = Slices.begin(); + auto LineNumber = CurrentSlice->Begin.GetSliceLine(); + while (LineNumber < Lines.size()) { + const std::string Line = Lines[LineNumber]; + while (true) { + // Case: We are in text befor the slice + if (CurrentSlice == Slices.end() || + CurrentSlice->Begin.GetSliceLine() > LineNumber) { + if (CurrentSlice != Slices.end() && + CurrentSlice->Begin.GetSliceLine() == (LineNumber + 1)) { + Output << '\n'; + } + break; + } + // Handle the following cases: + // We are in a completely sliced line, excluding the end or begin: Copy + // the complete line + // We are in the first line: Pad from the previous slice with spaces + // and add the text + // We are in the last line: Add text, check if + // others slices are needed in the same line + if (CurrentSlice->Begin.GetSliceLine() < LineNumber && + CurrentSlice->End.GetSliceLine() > LineNumber) { + Output << Line << '\n'; + break; + } + if (CurrentSlice->Begin.GetSliceLine() == LineNumber) { + if (PreviousSlice != Slices.end() && + PreviousSlice->End.GetSliceLine() == LineNumber) { + // We need to pad only after the last slice + for (unsigned int I = 0; I < CurrentSlice->Begin.GetSliceColumn() - + PreviousSlice->End.GetSliceColumn(); + I++) { + Output << ' '; + } + } else { + for (unsigned int I = 0; I < CurrentSlice->Begin.GetSliceColumn(); + I++) { + Output << ' '; + } + } + // Copy our slice + if (CurrentSlice->End.GetSliceLine() == LineNumber) { + Output << Line.substr(CurrentSlice->Begin.GetSliceColumn(), + CurrentSlice->End.GetSliceColumn() - + CurrentSlice->Begin.GetSliceColumn()); + } else { + Output << Line.substr(CurrentSlice->Begin.GetSliceColumn()) << '\n'; + break; + } + } else { + // Handle end case + Output << Line.substr(0, CurrentSlice->End.GetSliceColumn()); + } + + PreviousSlice = CurrentSlice; + CurrentSlice++; + if (CurrentSlice == Slices.end()) { + Output << '\n'; + break; + } + } + LineNumber++; + } + Output << "#endif //SLICE\n"; +} +} // namespace printer \ No newline at end of file diff --git a/tools/module-extractor/printer.h b/tools/module-extractor/printer.h new file mode 100644 index 0000000000..6160bba21d --- /dev/null +++ b/tools/module-extractor/printer.h @@ -0,0 +1,255 @@ +#ifndef PHASAR_PRINTER_H +#define PHASAR_PRINTER_H + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace printer { + +/** + * Checks if any of the lines contained in Lines is between the Begin and End + * Location of Decl (inclusive) + * @tparam T + * @param Decl + * @param Lines + * @param SM + * @return + */ +template +bool isAnyInWhitelist(const T *Decl, const std::set &Lines, + const clang::SourceManager &SM) { + unsigned int Begin = SM.getPresumedLineNumber(Decl->getBeginLoc()); + unsigned int End = SM.getPresumedLineNumber(Decl->getEndLoc()); + assert(Begin <= End); + return Lines.lower_bound(Begin) != Lines.upper_bound(End); +} + +/** + * Check if Decl is in the main source file + * @tparam T + * @param Decl + * @param SM + * @return + */ +template +bool isInSourceFile(const T *Decl, const clang::SourceManager &SM) { + return SM.getFileID(SM.getSpellingLoc(Decl->getBeginLoc())) == + SM.getMainFileID(); +} + +/** + * A generated slice, based on clang SourceLocations + */ +struct Slice { + Slice(); + Slice(clang::SourceLocation Begin, clang::SourceLocation End, + bool NeedsDefine = false); + Slice(clang::SourceLocation Begin, clang::SourceLocation End, + std::vector Keep); + static Slice generateFromStartAndNext(clang::SourceLocation Start, + clang::SourceLocation Next, + const clang::SourceManager &SM, + const clang::LangOptions &LO); + clang::SourceLocation Begin; + clang::SourceLocation End; + bool NeedsDefine = + false; // True if the Slice should be commented out. If it is a header + // slice, true means that it is a function definition where we need + // to cut away the body. + std::vector Keep; // Slices that we need to extract a function if we + // rewrite it completely +}; + +/** + * An offset into a file (line and column based) + */ +struct FileOffset { + FileOffset(const clang::PresumedLoc &Loc); + + friend std::ostream &operator<<(std::ostream &os, const FileOffset &offset); + + /** + * + * @return Zero based column offset + */ + unsigned int GetSliceColumn() const; + + /** + * + * @return Zero based line offset + */ + unsigned int GetSliceLine() const; + bool operator==(const FileOffset &rhs) const; + bool operator!=(const FileOffset &rhs) const; + bool operator<(const FileOffset &rhs) const; + bool operator>(const FileOffset &rhs) const; + bool operator<=(const FileOffset &rhs) const; + bool operator>=(const FileOffset &rhs) const; + +private: + unsigned int Line; + unsigned int Column; +}; + +/** + * A File based slice + * End is just one character after the target slice + */ +struct FileSlice { + // FileSlice(FileOffset Begin, FileOffset End); + FileSlice(const Slice &Slice, const clang::SourceManager &SM); + friend std::ostream &operator<<(std::ostream &os, const FileSlice &slice); + bool operator==(const FileSlice &rhs) const; + bool operator!=(const FileSlice &rhs) const; + FileOffset Begin; + FileOffset End; + bool NeedsDefine = false; + std::vector Keep; +}; + +/** + * Merge adjacent slices together (inplace) + * @param Slices + */ +void mergeSlices(std::vector &Slices); + +/** + * Merge adjacent slices together if they need a define (inplace) + * @param Slices + */ +void mergeAndSplitSlices(std::vector &Slices); + +/** Extract code from FileIn bases on Slices and write it to Output + * + * @param FileIn + * @param Output + * @param Slices Slices to put into define code + */ +void extractSlicesDefine(const std::string &FileIn, std::ofstream &Output, + const std::vector &Slices); + +/** Extract a function that got rewritten by the slicer + * + * @param Lines Lines of the file to slice + * @param Slices Slices of the rewritten function + * @param Output + */ +void extractRewrittenFunction(const std::vector &Lines, + const std::vector &Slices, + std::ofstream &Output); + +/** + * Create a header for a a sliced file + * @param FileIn The original source file + * @param FileOut The header file to write to + * @param Slices Slices containing information about types that may need to be + * copied + * @param FileName Name of the original source file (used for creating include + * guards) + * @param includes Includes that need to be copied + */ +void extractHeaderSlices(const std::string &FileIn, const std::string &FileOut, + const std::vector &Slices, + const std::string &FileName, + const std::vector &includes); + +/** + * StmtVisitor, walking over the AST and collecting the source locations of + * slices to extract + */ +class StmtPrinterFiltering + : public clang::ConstStmtVisitor { +public: + bool VisitCompoundStmt(const clang::CompoundStmt *Stmt); + bool VisitStmt(const clang::Stmt *stmt); + bool VisitWhileStmt(const clang::WhileStmt *Stmt); + bool VisitForStmt(const clang::ForStmt *Stmt); + bool VisitDoStmt(const clang::DoStmt *Stmt); + bool VisitSwitchStmt(const clang::SwitchStmt *Stmt); + bool VisitIfStmt(const clang::IfStmt *Stmt); + bool VisitCaseStmt(const clang::CaseStmt *Stmt); + bool VisitDefaultStmt(const clang::DefaultStmt *Stmt); + static std::vector + GetSlices(const clang::Stmt *Stmt, const std::set &TargetLines, + const clang::ASTContext &CTX, const clang::SourceManager &SM, + const clang::LangOptions &LO, unsigned *filtered = nullptr); + +private: + StmtPrinterFiltering(const std::set &TargetLines, + const clang::SourceManager &SM, + const clang::LangOptions &LO); + + void PrintStmt(const clang::Stmt *Stmt, bool required = false); + + unsigned int Filtered = 0; + std::vector Slices; + const std::set &TargetLines; + const clang::SourceManager &SM; + const clang::LangOptions &LO; +}; + +/** + * DeclVisitor, walking over the AST and collecting the source locations of + * Slices to extract + */ +class DeclPrinterFiltering + : public clang::ConstDeclVisitor { +public: + void VisitFunctionDecl(const clang::FunctionDecl *decl); + void VisitVarDecl(const clang::VarDecl *decl); + void VisitDecl(const clang::Decl *decl); + void VisitTypeDecl(const clang::TypeDecl *Decl); + void VisitTranslationUnitDecl(const clang::TranslationUnitDecl *decl); + + /** + * + * @param Decl + * @param TargetLines + * @param CTX + * @param SM + * @param LO + * @return First are the file slices, then the ones required for the header + */ + static std::pair, std::vector> + GetSlices(const clang::Decl *Decl, const std::set &TargetLines, + const clang::ASTContext &CTX, const clang::SourceManager &SM, + const clang::LangOptions &LO); + + /** + * + * @param Decl + * @param TargetLines + * @param CTX + * @return * @return First are the file slices, then the ones required for + * the header + */ + static std::pair, + std::vector> + GetFileSlices(const clang::Decl *Decl, + const std::set &TargetLines, + const clang::ASTContext &CTX); + +private: + DeclPrinterFiltering(const std::set &Target, + const clang::ASTContext &CTX, + const clang::SourceManager &SM, + const clang::LangOptions &LO); + std::vector Slices; + std::vector HeaderSlices; + const std::set &TargetLines; + const clang::ASTContext &CTX; + const clang::SourceManager &SM; + const clang::LangOptions &LO; +}; +} // namespace printer + +#endif // PHASAR_PRINTER_H diff --git a/tools/module-extractor/result_comparator.cpp b/tools/module-extractor/result_comparator.cpp new file mode 100644 index 0000000000..96aa616775 --- /dev/null +++ b/tools/module-extractor/result_comparator.cpp @@ -0,0 +1,17 @@ +#include + +#include "slicer.h" + +int main(int argc, const char **argv) { + if (argc != 3) { + std::cout << "Usage:" << std::endl; + std::cout << "result_comparator path_to_ground_truth path_to_extracted_version" + << std::endl; + return -1; + } else { + string original = argv[1]; + string module = argv[2]; + compare_slice(original, module); + return 0; + } +} \ No newline at end of file diff --git a/tools/module-extractor/slicer.cpp b/tools/module-extractor/slicer.cpp new file mode 100644 index 0000000000..796ef63859 --- /dev/null +++ b/tools/module-extractor/slicer.cpp @@ -0,0 +1,738 @@ +#include "slicer.h" +#include "back_mapper.h" +#include "include_handling.h" + +#include +#include + +struct SliceComparator { + template + bool operator()(const tuple &l, + const tuple &r) const { + return std::get<1>(l) < std::get<1>(r) || std::get<0>(l) < std::get<0>(r); + } +}; + +template +class IFDSSlicer : public IFDSTabulationProblem> { +public: + IFDSSlicer(ICFG_T *icfg, const LLVMTypeHierarchy *th, const ProjectIRDB *irdb, + LLVMPointsToInfo *PT, map> sc, + const std::vector *terms, + const std::set &entrypoints) + : IFDSTabulationProblem>(irdb, th, icfg, PT), + terms(terms), slicingCriteria(std::move(sc)), entrypoints(entrypoints) { + + } + +private: + [[nodiscard]] SlicerFact createZeroValue() const override { + return SlicerFact(); + } + shared_ptr> + getNormalFlowFunction(const Instruction *curr, + const Instruction *succ) override { + return make_shared(curr, succ); + } + shared_ptr> + getCallFlowFunction(const Instruction *callStmt, + const Function *destMthd) override { + return make_shared>(callStmt, destMthd, + this->getICFG()); + } + shared_ptr> + getRetFlowFunction(const Instruction *callSite, const Function *calleeMthd, + const Instruction *exitStmt, + const Instruction *retSite) override { + return make_shared>(callSite, calleeMthd, exitStmt, + retSite); + } + shared_ptr> + getCallToRetFlowFunction(const Instruction *callSite, + const Instruction *retSite, + set callees) override { + return make_shared(callSite, retSite, callees); + } + map> initialSeeds() override { + for (const auto &entrypoint : entrypoints) { + const Instruction *i; + if (std::is_same::value) { + i = &this->ICF->getFunction(entrypoint)->back().back(); + } else if (std::is_same::value) { + i = &this->ICF->getFunction(entrypoint)->front().front(); + } else { + assert(false && "Only defined for LLVMBASED ICFGs"); + } + SlicerFact sf = SlicerFact(); + if (slicingCriteria.find(i) == slicingCriteria.end()) { + set facts; + facts.insert(sf); + slicingCriteria[i] = facts; + } else { + slicingCriteria[i].insert(sf); + } + } + return slicingCriteria; + } + + [[nodiscard]] bool isZeroValue(SlicerFact d) const override { + return d.isZero(); + } + void printNode(std::ostream &os, const Instruction *n) const override { + std::string temp; + llvm::raw_string_ostream rso(temp); + n->print(rso, true); + os << temp; + } + void printDataFlowFact(std::ostream &os, SlicerFact d) const override { + os << d; + } + void printFunction(std::ostream &os, const Function *m) const override { + os << psr::llvmIRToString(m) << endl; + } + + shared_ptr> + getSummaryFlowFunction([[maybe_unused]] const Instruction *curr, + [[maybe_unused]] const Function *destFun) override { + return nullptr; + } + + const std::vector *terms; + map> slicingCriteria; + const std::set &entrypoints; +}; + +void copy_files( + map> &file_lines, + map> &file_slices, + map> &header_slices, + const string &outPath, const unordered_set &blacklist, + const string &compile_commands_path) { + + /** + * Slicing based on lines + */ + for (const auto &file : file_lines) { + std::ifstream in(file.first); + std::ofstream out( + "out/" + file.first.substr(file.first.find_last_of("/"), string::npos)); + std::string line; + int line_nr = 1; + while (std::getline(in, line)) { + if (file.second.find(line_nr) != file.second.end()) { + out << line << endl; + } else { + out << endl; + } + line_nr++; + } + out.close(); + } + + /** + * Slicing based on source information + */ + for (const auto &file : file_slices) { + std::string outname = + "out" + file.first.substr(file.first.find_last_of("/"), string::npos) + + ".slice"; + std::ofstream Output(outname, std::ios_base::trunc | std::ios_base::out); + printer::extractSlicesDefine(file.first, Output, file.second); + } + + /** + * Slicing of headers based on source information + */ + for (const auto &file : header_slices) { + const std::string filename = + file.first.substr(file.first.find_last_of("/") + 1, string::npos); + const std::string outname = "out/" + filename + ".h"; + const auto includes = get_includes_to_extract(file.first, blacklist); + printer::extractHeaderSlices(file.first, outname, file.second, filename, + includes); + cleanup_includes(file.first, outname, compile_commands_path); + } + + /** + * Slicing into one file based on source information + */ + { + const std::string outname = "out/" + outPath + ".c.slice"; + std::ofstream Output(outname, std::ios_base::ate | std::ios_base::out); + for (const auto &file : file_slices) { + printer::extractSlicesDefine(file.first, Output, file.second); + } + } + + /** + * Slicing into one file based on lines + */ + if (true) { + std::ofstream out("out/" + outPath + ".c"); + for (const auto &file : file_lines) { + std::ifstream in("out/" + file.first.substr(file.first.find_last_of("/"), + string::npos)); + std::string line; + bool last_empty = false; + while (std::getline(in, line)) { + if (line.empty()) { + if (!last_empty) { + out << endl; + } + last_empty = true; + } else { + out << line << endl; + last_empty = false; + } + } + } + out.close(); + } +} + +template +void process_results(ProjectIRDB &DB, IFDSSolver &solver, + LLVMBasedBackwardsICFG &cg, string outPath, + const unordered_set &blacklist, + const string &compile_commands_dir) { + map> file_slices; + map> header_slices; + map> slice_instruction; + llvm::dbgs() << "SOLVING DONE\n"; + for (auto *const module : DB.getAllModules()) { + for (auto &function : module->functions()) { + auto fun_name = function.getName(); + // llvm::dbgs() << "\n\n\n" << fun_name << "\n\n\n"; + bool isUsed = false; + for (auto &bb : function) { + for (const auto &i : bb) { + // llvm::dbgs() + // << + // "========================================================\n"; + auto res = solver.ifdsResultsAt(&i); + // llvm::dbgs() << "INS: " << llvmIRToString(&i) + // << " FACTS:" << res.size() << "\n"; + // llvm::dbgs() << "SRC: " << psr::getSrcCodeFromIR(&i) << + // "\n" + // << res.size() << "\n"; + for (auto fact : res) { + if (!fact.isZero()) { + auto extractedInstruction = fact.getInstruction(); + // llvm::dbgs() << "FACT INS: " + // << + // llvmIRToString(fact.getInstruction()) + // << "\n"; + // llvm::dbgs() << "SRC: " << *fact.getLocation() << + // " " + // << + // psr::getSrcCodeFromIR(extractedInstruction) + // << "\n" + // << "\n"; + // if (extractedInstruction-> == function && + // extractedInstruction == &i || true) { + + const auto ins = dyn_cast(fact.getInstruction()); + + if (ins && ins->getFunction() == &function) { + slice_instruction[&function].insert(extractedInstruction); + const auto *blockExit = ins->getParent()->getTerminator(); + slice_instruction[&function].insert(blockExit); + isUsed = true; + } + // else { + // if (auto arg = + // dyn_cast(fact.getInstruction())) { + // slice_instruction[&function].insert(arg); + // } + // } + } else { + } + } + } + } + if (isUsed) { + // Check whether this works everywhere + const auto *entry = &function.getEntryBlock().front(); + const auto source = psr::getSrcCodeFromIR(&function); + for (auto &bb : function) { + for (auto &ins : bb) { + if (auto *dl = ins.getDebugLoc().get()) { + // slice.insert(std::make_tuple( + // source, *createLocation(dl->getLine(), + // dl->getColumn()), entry)); + goto added; // we found the first instruction with debug info + } + } + } + // slices[&function].insert( + // std::make_tuple(source, *createLocation(0, 0), entry)); + added: + const auto exits = cg.getStartPointsOf(&function); + for (const auto *exit : exits) { + if (auto *dl = exit->getDebugLoc().get()) { + // slices[&function].insert(std::make_tuple( + // psr::getSrcCodeFromIR(exit), + // *createLocation(dl->getLine(), dl->getColumn()), + // exit)); + } else { + // slices[&function].insert( + // std::make_tuple(psr::getSrcCodeFromIR(exit), + // *createLocation(INT_MAX, INT_MAX), + // exit)); + // llvm::dbgs() << "GOT NO DEBUG LOG" + // << "\n"; + } + } + } + } + } + // cout << "\n"; + // llvm::dbgs() << "\n" + // << "\n" + // << "\n" + // << "\n"; + map> file_lines; + for (auto &p : slice_instruction) { + llvm::dbgs() << "F:\t" << p.first->getName() << "\t" << p.second.size() + << "\n"; + auto file = psr::getFilePathFromIR(p.first); + auto first = true; + + std::set block_lines; + for (const auto &s : p.second) { + if (first) { + auto line = psr::getLineFromIR(p.first); + auto end_line = psr::getFunctionHeaderLines(p.first); + for (unsigned int l = line; l <= end_line; ++l) { + file_lines[file].insert(l); + } + first = false; + } + + if (auto *phi = dyn_cast(s)) { + llvm::dbgs() << "GOT PHI\t" << *s << "\n"; + } else if (auto *debug_call = dyn_cast(s)) { + if (auto *debug_info = + dyn_cast(debug_call->getOperand(1))) { + if (auto *localVariable = + dyn_cast(debug_info->getMetadata())) { + file_lines[file].insert(localVariable->getLine()); + } + } + } else { + auto line = psr::getLineFromIR(s); + auto src = psr::getSrcCodeFromIR(s); + + // llvm::dbgs() << *s << "\t" << src << "\t" << line << "\n"; + file_lines[file].insert(line); + if (auto *inst = dyn_cast(s)) { + for (unsigned int i = 0; i < inst->getNumOperands(); ++i) { + if (auto *global = dyn_cast(inst->getOperand(i))) { + auto g_line = psr::getLineFromIR(global); + auto g_src = psr::getSrcCodeFromIR(global); + file_lines[file].insert(g_line); + } + } + if (inst->getDebugLoc()) { + if (auto *scope = + dyn_cast(inst->getDebugLoc().getScope())) { + block_lines.insert(line); + file_lines[file].insert(line); + file_lines[file].insert(scope->getLine()); + } + } + if (auto *br = dyn_cast(inst)) { + if (br->isUnconditional() && src.find('}') == src.npos && + line != 0) { + file_lines[file].insert(line + 1); + } + } + if (auto *ret = dyn_cast(inst)) { + if (src.find('}') == src.npos && line != 0) { + file_lines[file].insert(line + 1); + } + } + } + } + } + } + for (const auto &f : file_lines) { + const auto slices = add_block(f.first, &f.second); + file_slices.emplace(f.first, slices.first); + header_slices.emplace(f.first, slices.second); + } + + copy_files(file_lines, file_slices, header_slices, outPath, blacklist, + compile_commands_dir); +} + +std::string createSlice(string target, const set &entrypoints, + const vector &terms, string outPath, + string compileCommandsPath, + const unordered_set &blacklist) { + ProjectIRDB DB({target}, IRDBOptions::WPA); + initializeLogger(false); + // initializeLogger(true); + LLVMTypeHierarchy th(DB); + LLVMBasedBackwardsICFG cg(DB, CallGraphAnalysisType::DTA, set(entrypoints), + &th); + LLVMBasedICFG fcg(DB, CallGraphAnalysisType::DTA, set(entrypoints), &th); + LLVMPointsToGraph PT(DB); + map> sc; + for (auto *module : DB.getAllModules()) { + for (auto &function : module->functions()) { + for (auto &bb : function) { + auto sub = function.getSubprogram(); + for (const auto &i : bb) { + set facts; + if (auto *debuglog = i.getDebugLoc().get()) { + auto line = debuglog->getLine(); + auto column = debuglog->getColumn(); + auto file = debuglog->getFilename(); + if (const auto *store = dyn_cast(&i)) { + if (const auto *global = + dyn_cast(store->getPointerOperand())) { + auto name = global->getValueName()->first(); + for (const auto &t : terms) { + if (name.find(t.term) != StringRef::npos) { + for (const auto &l : t.locations) { + if (l.line == line && false) { + facts.insert(SlicerFact(&l, &i)); + } + } + } + } + } + } + for (const auto &t : terms) { + const size_t last_slash_idx = t.file.find_last_of("\\/"); + std::string term_file_name(t.file); + if (std::string::npos != last_slash_idx) { + term_file_name.erase(0, last_slash_idx + 1); + } + for (const auto &l : t.locations) { + // check same statement + if (file.endswith(term_file_name) && + (l.line == line || l.line == sub->getLine())) { + facts.insert(SlicerFact(&l, &i)); + if (const auto *branch = dyn_cast(&i)) { + if (branch->isConditional()) { + const auto *constbranch = branch->getSuccessor(0); + // Assume first branch is true branch -- we're pretty sure + // that is always the case + for (const auto &inst : *constbranch) { + if (auto *debuglog2 = inst.getDebugLoc().get()) { + const auto *loc = createLocation( + debuglog2->getLine(), debuglog2->getColumn()); + facts.insert(SlicerFact(loc, &inst)); + } + } + } + } + } + } + } + } + if (!facts.empty()) { + sc[&i] = facts; + } + } + } + } + } + IFDSSlicer slicer(&cg, &th, &DB, &PT, sc, &terms, + entrypoints); + IFDSSlicer slicer2(&fcg, &th, &DB, &PT, sc, &terms, + entrypoints); + IFDSSolver solver(slicer); + solver.solve(); + // ofstream out; + // out.open("out/graph.dot"); + // solver.emitESGAsDot(out); + // out.close(); + // out.open("out/results.txt"); + // solver.dumpResults(out); + // out.close(); + cout << "\n"; + process_results(DB, solver, cg, outPath, blacklist, compileCommandsPath); + return ""; +} + +/** + * Reads a blacklist of headers not to slice from the file 'path'. This file + * needs to have one blacklisted header in each line + * @param path Path to the file to read or 'none' if no blacklist is used + * @return A set containing headers not to slice + */ +unordered_set read_blacklist(const string &path) { + if (path == "none") { + return {}; + } + unordered_set blacklist; + + auto trim = [](string str) { + str.erase(str.begin(), + std::find_if(str.begin(), str.end(), + [](unsigned char c) { return !std::isspace(c); })); + str.erase(std::find_if(str.rbegin(), str.rend(), + [](unsigned char c) { return !std::isspace(c); }) + .base(), + str.end()); + return str; + }; + ifstream ifs(path); + string line; + while (getline(ifs, line)) { + line = trim(line); + if (!line.empty()) { + blacklist.insert(line); + } + } + return blacklist; +} +int main(int argc, const char **argv) { + const rlim_t kStackSize = 512 * 1024 * 1024; // min stack size = 128 MB + struct rlimit rl; + int result; + result = getrlimit(RLIMIT_STACK, &rl); + if (result == 0) { + if (rl.rlim_cur < kStackSize) { + rl.rlim_cur = kStackSize; + result = setrlimit(RLIMIT_STACK, &rl); + if (result != 0) { + fprintf(stderr, "setrlimit returned result = %d\n", result); + } + } + } + if (argc < 7) { + cout << "Please provide the correct params" << endl; + cout << "Target(.ll); Json config; Output Path; Path to " + "compile_commands.json or 'none'; Blacklist file for headers " + "to extract or 'none'; entry points ..." + << endl; + // TODO USAGE + return -1; + } + // std::cout << "Current path is " << bofs::current_path() << '\n'; + const auto target = argv[1]; + std::ifstream in(argv[2]); + json j; + in >> j; + auto terms = j.get>(); + string outPath = argv[3]; + set entrypoints; + const string compile_commands_path = argv[4]; + const string blacklist_path = argv[5]; + + const auto blacklist = read_blacklist(blacklist_path); + + for (int i = 6; i < argc; ++i) { + entrypoints.insert(argv[i]); + cout << argv[i] << endl; + } + + std::chrono::steady_clock::time_point begin = + std::chrono::steady_clock::now(); + createSlice(target, entrypoints, terms, outPath, compile_commands_path, + blacklist); + std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now(); + std::cout << "Time difference = " + << std::chrono::duration_cast(end - + begin) + .count() + << "[µs]" << std::endl; + std::cout << "Time difference = " + << std::chrono::duration_cast(end - begin) + .count() + << "[ns]" << std::endl; + std::cout + << "Time difference = " + << std::chrono::duration_cast(end - begin).count() + << "[s]" << std::endl; + std::cout + << "Time difference = " + << std::chrono::duration_cast(end - begin).count() + << "[m]" << std::endl; + std::cout << "Extracted code is in out/" + outPath + ".c" << std::endl; + return 0; +} + +std::set NormalFlowFunction::computeTargets(SlicerFact source) { + set facts; + + // check logic for conditions + + if (!source.isZero() && source.is_within_limits()) { + if (auto branch = dyn_cast(source.getInstruction())) { + if (!branch->isUnconditional()) { + facts.insert(source); + } + } else if (auto call = + dyn_cast(source.getInstruction())) { + // Don't propagate further + } else { + facts.insert(source); + } + // llvm::dbgs() << "===================\n"; + // llvm::dbgs() << "curr: " << *curr << "\n"; + // llvm::dbgs() << "Source: " << *source.getInstruction() << + // "\n"; llvm::dbgs() << "src: " << psr::getSrcCodeFromIR(curr) + // << "\n"; llvm::dbgs() << curr->getFunction()->getName() << + // "\n"; + auto fun = curr->getFunction()->getName(); + + for (const auto &user : curr->users()) { + if (user == source.getInstruction()) { + facts.insert( + SlicerFact(source.getLocation(), curr, source.getInterDistance())); + } + } +#ifdef OPERAND_PROP + if (auto load = dyn_cast(curr)) { + if (auto ins = dyn_cast(source.getInstruction())) { + for (unsigned int i = 0; i < load->getNumOperands(); ++i) { + for (unsigned int j = 0; j < ins->getNumOperands(); ++j) { + if (load->getOperand(i) == ins->getOperand(j)) { + facts.insert(SlicerFact(source.getLocation(), load, + source.getInterDistance())); + } + } + } + } + } +#endif + if (auto gep = dyn_cast(curr)) { + if (auto ins = dyn_cast(source.getInstruction())) { + for (unsigned int i = 0; i < gep->getNumOperands(); ++i) { + for (unsigned int j = 0; j < ins->getNumOperands(); ++j) { + if (gep->getOperand(i) == ins->getOperand(j)) { + facts.insert(SlicerFact(source.getLocation(), gep, + source.getInterDistance())); + } + } + } + } + } + if (const auto *br = dyn_cast(curr)) { + for (unsigned int i = 0; i < br->getNumOperands(); ++i) { + if (auto *target = dyn_cast(br->getOperand(i))) { + if (source.getInstruction() == &target->front()) { + facts.insert(SlicerFact(source.getLocation(), curr, + source.getInterDistance())); + // This is the phi instruction after the branch if we are the target + // we are relevant + } + } + } + } + } + return facts; +} +std::set CallToRetFlowFunction::computeTargets(SlicerFact source) { + set facts; + if (!source.isZero() && source.getInstruction() != callSite && + source.is_within_limits()) { + // llvm::dbgs() << "===================\n"; + // llvm::dbgs() << "curr: " << *callSite << "\n"; + // llvm::dbgs() << "Source: " << *source.getInstruction() << "\n"; + // llvm::dbgs() << callSite->getFunction()->getName() << "\n"; + // auto fun = callSite->getFunction()->getName(); + // if (fun == "process_string") { + // llvm::dbgs() << ""; + // } + if (auto ins = dyn_cast(source.getInstruction())) { + for (unsigned int j = 0; j < ins->getNumOperands(); ++j) { + for (unsigned int i = 0; i < callSite->getNumOperands(); ++i) { + auto op1 = callSite->getOperand(i); + if (auto metadata = dyn_cast(op1)) { + if (auto local = + dyn_cast(metadata->getMetadata())) { + if (local->getValue() == ins->getOperand(j)) { + facts.insert(SlicerFact(source.getLocation(), callSite)); + } + } + } + if (callSite->getOperand(i) == ins->getOperand(j)) { + facts.insert(SlicerFact(source.getLocation(), callSite)); + } + } + } + } + for (const auto &user : callSite->users()) { + if (user == source.getInstruction()) { + facts.insert(SlicerFact(source.getLocation(), callSite)); + } + } + facts.insert(source); + } + return facts; +} +template +std::set +CallFlowFunction::computeTargets(SlicerFact source) { + set facts; +// facts.insert(source); +#ifdef __INTERPROCEDURAL__ + if (!source.isZero() && source.is_within_limits()) { + // llvm::dbgs() << "===================\n"; + // llvm::dbgs() << "Curr:" <<*callStmt << "\n"; + // llvm::dbgs() << "Source: " << *source.getInstruction() << "\n"; + // llvm::dbgs() << callStmt->getFunction()->getName() << "\n"; + + // if (callStmt->getFunction()->getName() == + // "inotifytools_get_stat_by_filename") { + // llvm::dbgs() << ""; + // } + auto targets = ICF->getStartPointsOf(destMthd); + bool isRelevant = false; + // source is global or uses the return value +#ifdef OPERAND_PROP + if (auto inst = dyn_cast(source.getInstruction())) { + for (unsigned int i = 0; i < inst->getNumOperands(); ++i) { + auto op = inst->getOperand(i); + isRelevant |= isa(op); + } + for (const auto &use : callStmt->uses()) { + isRelevant |= (use.getUser() == inst); + } + } + if (isRelevant) { +#endif + for (auto target : targets) { + facts.insert(SlicerFact(source.getLocation(), target, + source.getInterDistance() + 1)); + } +#ifdef OPERAND_PROP + } +#endif // OPERAND_PROP + } +#endif // INTERPROCEDURAL + return facts; +} +template +std::set +RetFlowFunction::computeTargets(SlicerFact source) { + // llvm::dbgs() << "\n"; + // callSite->dump(); + // calleeMthd->dump(); + // exitStmt->dump(); + // retSite->dump(); + // llvm::dbgs() << "\n"; + set facts; +// facts.insert(source); +#ifdef __INTERPROCEDURAL__ + for (unsigned int i = 0; i < callSite->getNumOperands(); ++i) { + const auto op = callSite->getOperand(i); + if (source.getInstruction() == op) { + facts.insert(SlicerFact(source.getLocation(), + getNthFunctionArgument(calleeMthd, i), + source.getInterDistance() + 1)); + } + } + if (!source.isZero() && source.is_within_limits()) { + facts.insert(SlicerFact(source.getLocation(), exitStmt, + source.getInterDistance() + 1)); + } +#endif + return facts; +} diff --git a/tools/module-extractor/slicer.h b/tools/module-extractor/slicer.h new file mode 100644 index 0000000000..1add9c7b2e --- /dev/null +++ b/tools/module-extractor/slicer.h @@ -0,0 +1,305 @@ +#ifndef PHASAR_SLICER_H +#define PHASAR_SLICER_H + +#include +#include + + + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#define __INTERPROCEDURAL__ +#define OPERAND_PROP +//#define _DISTANCE_LIMITS_ +namespace bofs = boost::filesystem; +using namespace llvm; +using namespace std; +using namespace psr; +using json = nlohmann::json; + +struct Term; +struct Location { + unsigned int line; + unsigned int column; + map meta; + Location() {} + Location(unsigned int line, unsigned int column) + : line(line), column(column) {} +}; +// TODO Memory Leak here +Location *createLocation(unsigned int line, unsigned int column) { + return new Location(line, column); +} + +bool operator<(const Location &l1, const Location &l2) { + return l1.line < l2.line || (l1.line == l2.line && l1.column < l2.column); +} + +bool operator==(const Location &l1, const Location &l2) { + return l1.line == l2.line || l1.column == l2.column; +} + +void to_json(json &j, const Location &l) { + j = json{{"line", l.line}, {"column", l.column}, {"meta", l.meta}}; +} +void from_json(const json &j, Location &l) { + j.at("line").get_to(l.line); + j.at("column").get_to(l.column); + j.at("meta").get_to(l.meta); +} +ostream &operator<<(ostream &os, const Location &l) { + os << "(" << l.line << "," << l.column << ")"; + return os; +} + +raw_ostream &operator<<(raw_ostream &os, const Location &l) { + os << "(" << l.line << "," << l.column << ")"; + return os; +} + +struct Term { + std::string file; + std::string term; + vector locations; +}; +void to_json(json &j, const Term &t) { + j = json{{"file", t.file}, {"term", t.term}, {"locations", t.locations}}; +} +void from_json(const json &j, Term &t) { + j.at("file").get_to(t.file); + j.at("term").get_to(t.term); + j.at("locations").get_to(t.locations); +} + +ostream &operator<<(ostream &os, const Term &t) { + os << '\'' << t.term << "' in " << t.file << " at ["; + for (auto const &l : t.locations) { + os << l << ","; + } + os << "]"; + return os; +} +class SlicerFact; +namespace std { +template <> struct hash { + size_t operator()(const SlicerFact &x) const; +}; +} // namespace std +class SlicerFact { +public: + SlicerFact() = default; + SlicerFact(const Location *l, const Value *i) + : l(l), i(i) {} + SlicerFact(const Location *l, const Value *i, + int8_t inter_distance) + : l(l), i(i) +#ifdef _DISTANCE_LIMITS_ + ,inter_distance(inter_distance) +#endif + {} + bool operator<(const SlicerFact &rhs) const { return i < rhs.i; } + bool operator==(const SlicerFact &rhs) const { + return i == rhs.i && l == rhs.l; + } + + friend std::ostream &operator<<(std::ostream &os, const SlicerFact &rhs); + friend raw_ostream &operator<<(raw_ostream &os, const SlicerFact &rhs); + [[nodiscard]] bool isZero() const { return i == nullptr; } + const llvm::Value *getInstruction() { return i; } + const Location *getLocation() { return l; } + int8_t getInterDistance() const; + + friend size_t std::hash::operator()(const SlicerFact &x) const; + + bool is_within_limits() { +#ifdef _DISTANCE_LIMITS_ + return inter_distance < INTER_LIMIT; +#else + return true; +#endif + } +#ifdef _DISTANCE_LIMITS_ + static constexpr int8_t INTER_LIMIT = 3; +#endif +private: + const Location *l = nullptr; + const Value *i = nullptr; +#ifdef _DISTANCE_LIMITS_ + int8_t inter_distance =0; +#endif +}; + +std::ostream &operator<<(std::ostream &os, const SlicerFact &rhs) { + std::string temp; + llvm::raw_string_ostream rso(temp); + if (!rhs.isZero()) { + rhs.i->print(rso, true); + os << temp << " " << *rhs.l; + } else { + os << "Zero"; + } + return os; +} + +raw_ostream &operator<<(raw_ostream &os, const SlicerFact &rhs) { + std::string temp; + llvm::raw_string_ostream rso(temp); + if (!rhs.isZero()) { + rhs.i->print(rso, true); + os << temp << " " << *rhs.l; + } else { + os << "Zero"; + } + return os; +} +#ifdef _DISTANCE_LIMITS_ +int8_t SlicerFact::getInterDistance() const { return inter_distance; } +#else +int8_t SlicerFact::getInterDistance() const { return 0; } +#endif + +namespace std { +size_t hash::operator()(const SlicerFact &x) const { + return llvm::hash_value(x.i); +} +} // namespace std +template struct SlicerAnalysisDomain : public AnalysisDomain { + using d_t = SlicerFact; + using n_t = const llvm::Instruction *; + using f_t = const llvm::Function *; + using t_t = const llvm::StructType *; + using v_t = const llvm::Value *; + using c_t = ICFG_T; + using i_t = ICFG_T; +}; + +class NormalFlowFunction : public FlowFunction { +public: + NormalFlowFunction(const Instruction *curr, const Instruction *succ) + : curr(curr), succ(succ) {} + + std::set computeTargets(SlicerFact source) override; + +private: + [[maybe_unused]] const Instruction *curr; + [[maybe_unused]] const Instruction *succ; +}; + +template +class CallFlowFunction : public FlowFunction { +public: + CallFlowFunction(const Instruction *callStmt, const Function *destMthd, + const ICFG_T *ICF) + : callStmt(callStmt), destMthd(destMthd), ICF(ICF) {} + + std::set computeTargets(SlicerFact source) override; + +private: + [[maybe_unused]] const Instruction *callStmt; + [[maybe_unused]] const Function *destMthd; + [[maybe_unused]] const ICFG_T *ICF; +}; + +template +class RetFlowFunction : public FlowFunction { +public: + RetFlowFunction(const Instruction *callSite, const Function *calleeMthd, + const Instruction *exitStmt, const Instruction *retSite) + : callSite(callSite), calleeMthd(calleeMthd), exitStmt(exitStmt), + retSite(retSite) {} + std::set computeTargets(SlicerFact source) override; + +private: + [[maybe_unused]] const Instruction *callSite; + [[maybe_unused]] const Function *calleeMthd; + [[maybe_unused]] const Instruction *exitStmt; + + [[maybe_unused]] const Instruction *retSite; +}; + +class CallToRetFlowFunction : public FlowFunction { +public: + CallToRetFlowFunction(const Instruction *callSite, const Instruction *retSite, + set callees) + : callSite(callSite), retSite(retSite), callees(std::move(callees)) {} + + std::set computeTargets(SlicerFact source) override; + +private: + [[maybe_unused]] const Instruction *callSite; + [[maybe_unused]] const Instruction *retSite; + [[maybe_unused]] set callees; +}; + +void compare_slice(string original, string module) + { + set original_lines; + set module_lines; + vector intersection; + vector missing; + vector additional; + { + std::ifstream in(original); + std::string line; + int line_nr = 1; + while (std::getline(in, line)) { + original_lines.insert(line); + } + } + { + std::ifstream in(module); + std::string line; + while (std::getline(in, line)) { + module_lines.insert(line); + } + } + set_intersection(original_lines.begin(), original_lines.end(), + module_lines.begin(), module_lines.end(), + std::inserter(intersection, intersection.begin())); + set_difference(original_lines.begin(), original_lines.end(), + module_lines.begin(), module_lines.end(), + std::inserter(missing, missing.begin())); + set_difference(module_lines.begin(), module_lines.end(), + original_lines.begin(), original_lines.end(), + + std::inserter(additional, additional.begin())); + + for (auto m : missing) { + cout << m << "\n"; + } + cout << "====================================\n"; + for (auto a : additional) { + cout << a << "\n"; + } + cout << "Original Size is:\t" << original_lines.size() << endl; + cout << "Intersection Size is:\t" << intersection.size() << endl; + cout << "Additional Size is:\t" << additional.size() << endl; + cout << "Missing Size is:\t" << missing.size() << endl; + cout << "\n\n\n"; + +} +#endif // PHASAR_SLICER_H diff --git a/tools/module-extractor/source_utils.cpp b/tools/module-extractor/source_utils.cpp new file mode 100644 index 0000000000..05e64e490a --- /dev/null +++ b/tools/module-extractor/source_utils.cpp @@ -0,0 +1,87 @@ +#include "source_utils.h" + +namespace utils { +// The functions here are taken and modified from clang tidy +llvm::Optional +findNextTokenSkippingComments(clang::SourceLocation Start, + const clang::SourceManager &SM, + const clang::LangOptions &LangOpts) { + llvm::Optional CurrentToken; + do { + CurrentToken = clang::Lexer::findNextToken(Start, SM, LangOpts); + } while (CurrentToken && CurrentToken->is(clang::tok::comment)); + return CurrentToken; +} + +llvm::Optional findNextToken(clang::SourceLocation Start, + clang::tok::TokenKind Tok, + const clang::SourceManager &SM, + const clang::LangOptions &LangOpts) { + llvm::Optional CurrentToken; + do { + CurrentToken = clang::Lexer::findNextToken(Start, SM, LangOpts); + if (CurrentToken) { + Start = CurrentToken->getLocation(); + } + } while (CurrentToken && !CurrentToken->is(Tok)); + return CurrentToken; +} + +// Given a Stmt which does not include it's semicolon this method returns the +// SourceLocation of the semicolon. +// Taken from clang tidy +// The handling of macros may still not handle all edge cases correctly +clang::SourceLocation getSemicolonAfterStmtEndLoc( + const clang::SourceLocation &EndLoc, const clang::SourceManager &SM, + const clang::LangOptions &LangOpts, clang::tok::TokenKind Kind) { + + if (EndLoc.isMacroID()) { + // Assuming EndLoc points to a function call foo within macro F. + // This method is supposed to return location of the semicolon within + // those macro arguments: + // F ( foo() ; ) + // ^ EndLoc ^ SpellingLoc ^ next token of SpellingLoc + const clang::SourceLocation SpellingLoc = SM.getSpellingLoc(EndLoc); + llvm::Optional NextTok = + findNextTokenSkippingComments(SpellingLoc, SM, LangOpts); + + // Was the next token found successfully? + // All macro issues are simply resolved by ensuring it's a semicolon. + if (NextTok && NextTok->is(Kind)) { + // Ideally this would return `F` with spelling location `;` (NextTok) + // following the example above. For now simply return NextTok location. + return NextTok->getLocation(); + } + + // Fallthrough to 'normal handling'. + // F ( foo() ) ; + // ^ EndLoc ^ SpellingLoc ) ^ next token of EndLoc + } + + llvm::Optional NextTok = + findNextToken(EndLoc, Kind, SM, LangOpts); + + // Testing for semicolon again avoids some issues with macros. + if (NextTok && NextTok->is(Kind)) { + return NextTok->getLocation(); + } + + return {}; +} + +clang::SourceLocation +findPreviousTokenStart(clang::SourceLocation Start, + const clang::SourceManager &SM, + const clang::LangOptions &LangOpts) { + if (Start.isInvalid() || Start.isMacroID()) { + return {}; + } + + clang::SourceLocation BeforeStart = Start.getLocWithOffset(-1); + if (BeforeStart.isInvalid() || BeforeStart.isMacroID()) { + return {}; + } + + return clang::Lexer::GetBeginningOfToken(BeforeStart, SM, LangOpts); +} +} // namespace utils \ No newline at end of file diff --git a/tools/module-extractor/source_utils.h b/tools/module-extractor/source_utils.h new file mode 100644 index 0000000000..637931bbad --- /dev/null +++ b/tools/module-extractor/source_utils.h @@ -0,0 +1,71 @@ +#ifndef PHASAR_SOURCE_UTILS_H +#define PHASAR_SOURCE_UTILS_H + +#include +#include +#include +#include +#include +#include + +#include + +#include + +namespace utils { + +/** + * Return the location direct AFTER the end of the token + * @param Loc + * @param SM + * @param LangOpts + * @return + */ +inline clang::SourceLocation getEndOfToken(clang::SourceLocation Loc, + const clang::SourceManager &SM, + const clang::LangOptions &LangOpts) { + return clang::Lexer::getLocForEndOfToken(Loc, 0, SM, LangOpts); +} + +/** + * Returns the Location of Loc as it is written in the Source code. For example + * this returns the expansion location of a macro and not the location where it + * is defined + * @param Loc + * @param SM + * @return + */ +inline clang::PresumedLoc getLocationAsWritten(clang::SourceLocation Loc, + const clang::SourceManager &SM) { + return SM.getPresumedLoc(Loc); +} + +/** + * Returns the first semicolon after the given end location + * @param EndLoc The location after which to begin searching + * @param SM + * @param LangOpts + * @param Kind The token to search. Defaults to a semicolon + * @return The location of the found semicolon or an invalid location if none + * could be found + */ +clang::SourceLocation getSemicolonAfterStmtEndLoc( + const clang::SourceLocation &EndLoc, const clang::SourceManager &SM, + const clang::LangOptions &LangOpts, + clang::tok::TokenKind Kind = clang::tok::TokenKind::semi); + +/** + * Returns the location of the beginning of the previous token + * @param Start Location of the current token + * @param SM + * @param LangOpts + * @return + */ +clang::SourceLocation +findPreviousTokenStart(clang::SourceLocation Start, + const clang::SourceManager &SM, + const clang::LangOptions &LangOpts); + +} // namespace utils + +#endif // PHASAR_SOURCE_UTILS_H diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 56a32a8ba4..e0073a1bbd 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -30,3 +30,4 @@ add_subdirectory(Flex) add_subdirectory(PhasarClang) add_subdirectory(PhasarLLVM) add_subdirectory(Utils) +add_subdirectory(Slicer) \ No newline at end of file diff --git a/unittests/Slicer/CMakeLists.txt b/unittests/Slicer/CMakeLists.txt new file mode 100644 index 0000000000..fdf337858f --- /dev/null +++ b/unittests/Slicer/CMakeLists.txt @@ -0,0 +1,7 @@ +set(SlicerTestSources + SliceITCW_defectsTest.cpp + Parson_test.cpp) + +foreach(TEST_SRC ${SlicerTestSources}) + add_phasar_unittest(${TEST_SRC}) +endforeach(TEST_SRC) diff --git a/unittests/Slicer/Parson_test.cpp b/unittests/Slicer/Parson_test.cpp new file mode 100644 index 0000000000..3996a190d7 --- /dev/null +++ b/unittests/Slicer/Parson_test.cpp @@ -0,0 +1,9 @@ +#include "gtest/gtest.h" +TEST( parson_parse, parson_parse_001 ){ + +} + +int main(int Argc, char **Argv) { + ::testing::InitGoogleTest(&Argc, Argv); + return RUN_ALL_TESTS(); +} diff --git a/unittests/Slicer/SliceComparator.cpp b/unittests/Slicer/SliceComparator.cpp new file mode 100644 index 0000000000..110c9a141c --- /dev/null +++ b/unittests/Slicer/SliceComparator.cpp @@ -0,0 +1,11 @@ + + + + + + + + +void compareFiles(string original_file,string sliced) { + +} \ No newline at end of file diff --git a/unittests/Slicer/SliceITCW_defectsTest.cpp b/unittests/Slicer/SliceITCW_defectsTest.cpp new file mode 100644 index 0000000000..b00f44cd33 --- /dev/null +++ b/unittests/Slicer/SliceITCW_defectsTest.cpp @@ -0,0 +1,26 @@ +#include "gtest/gtest.h" + +TEST( bit_shift_test, bit_shift_001 ){ +// For all bitshift tests term ==> sink +} +TEST(dynamic_buffer_overrun_test, dynamic_buffer_overrun_001) { + +} +//void bit_shift_001 () +//{ +// int a = 1; +// int ret; +// ret = a << 32;/*Tool should detect this line as error*/ /*ERROR:Bit shift error*/ +// sink = ret; +//} + + + + + + + +int main(int Argc, char **Argv) { + ::testing::InitGoogleTest(&Argc, Argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file diff --git a/utils/install-llvm.sh b/utils/install-llvm.sh index 9d6af1d60f..088d9a5f41 100755 --- a/utils/install-llvm.sh +++ b/utils/install-llvm.sh @@ -46,9 +46,13 @@ fi echo "Building LLVM..." cd ${build_dir}/llvm-project/ git checkout ${llvm_release} +# https://github.com/llvm/llvm-project/commit/68d5235cb58f988c71b403334cd9482d663841ab Fixes build for new linux kernels +git cherry-pick -n 68d5235cb58f988c71b403334cd9482d663841ab +# https://reviews.llvm.org/D89450 Fixes build with gcc 11 +git cherry-pick -n b498303066a63a203d24f739b2d2e0e56dca70d1 mkdir -p build cd build -cmake -G "Ninja" -DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra;libcxx;libcxxabi;libunwind;lld;compiler-rt;debuginfo-tests' -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_CXX1Y=ON -DLLVM_ENABLE_EH=ON -DLLVM_ENABLE_RTTI=ON -DBUILD_SHARED_LIBS=ON -DLLVM_BUILD_EXAMPLES=Off -DLLVM_INCLUDE_EXAMPLES=Off -DLLVM_BUILD_TESTS=Off -DLLVM_INCLUDE_TESTS=Off -DPYTHON_EXECUTABLE=`which python3` ../llvm +cmake -G "Ninja" -DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra;libcxx;libcxxabi;libunwind;lld;compiler-rt;debuginfo-tests' -DCMAKE_BUILD_TYPE=Release -DLLVM_PARALLEL_LINK_JOBS=1 -DLLVM_ENABLE_CXX1Y=ON -DLLVM_ENABLE_EH=ON -DLLVM_ENABLE_RTTI=ON -DBUILD_SHARED_LIBS=ON -DLLVM_BUILD_EXAMPLES=Off -DLLVM_INCLUDE_EXAMPLES=Off -DLLVM_BUILD_TESTS=Off -DLLVM_INCLUDE_TESTS=Off -DPYTHON_EXECUTABLE=`which python3` ../llvm cmake --build . -j${num_cores} echo "Installing LLVM to ${dest_dir}"