PointerVision is a static analysis tool designed to help developers analyze C++ code for pointer and reference usage, specifically focusing on pointer arithmetic, dereferencing, references, memory allocations, and bitwise operations. It utilizes Clang's tooling to provide a detailed analysis of C++ code and detect various operations related to pointers (*
), references (&
), memory management (new
, delete
), and bitwise operations (&
).
- Pointer Arithmetic Detection: Detects pointer arithmetic (e.g.,
ptr + offset
). - Dereference Detection: Identifies pointer dereferencing (e.g.,
*ptr
). - Reference Detection: Detects references and their usage.
- Memory Management: Detects the usage of
new
anddelete
for memory allocation/deallocation. - Bitwise AND Detection: Identifies the usage of the bitwise AND operator (
&
). - Goto Usage: Tracks the use of
goto
in code.
git clone https://github.com/mendax0110/ptrVision.git
cd ptrVision
mkdir build
cd build
cmake ..
make
./ptrVision <path-to-source-file> or ./ptrVision <path-to-source-directory>
ptrVision.exe <path-to-source-file> <marker>
ptrVision.exe ..\..\test\snippet_code_test.cpp CODE
ptrVision.exe ..\..\test\snippet_code_test.cpp
ptrVision.exe ..\..\test