Spread the love

Permits to inject a in reality-purposeful C++17 REPL into working, compiled programs
that may maybe maybe access your program insist and gives aspects adore code-completion and
syntax highlighting.

The API is much like tools adore Pry in Ruby or
Pdb in Python:

Instance program:

// put as foremost.cpp
#embody <iostream>
#embody <string>

int foremost(int argc, char** argv) {
    int a = 1;
    std::string b = "hi there world";
    std::cout << "2nd crash." << std::endl;
$ ./inspector prebuild foremost.cpp 
$ clang++ $(./inspector print-cflags) foremost.cpp -o foremost 
$ ./inspector repl
$ ./foremost

Inspector instance session

Presentation slides on Inspector

10 min presentation on Inspector



  • a c++ compiler (gcc or clang++)
  • libcling (gawk set up directions underneath)
  • jsoncpp
  • python3
  • python-truly helpful-toolkit (for python3)
  • python-setuptools (for python3)
  • pkg-config

Create Hang

git clone src
cd src
git checkout hold-patches
cd tools
git clone
git clone
cd clang
git checkout hold-patches
cd ../..
mkdir possess inst
cd possess
cmake -DCMAKE_INSTALL_PREFIX=../inst ../src
cmake --possess .
cmake --possess . --aim set up

Create Inspector

git clone
cd inspector
mkdir possess
cd possess
cmake -DCMAKE_PREFIX_PATH="../inst" ..
cmake --possess .


# ship python bindings
# (requires clang 5/trunk for python3 strengthen, the clang division from hold is recent ample)
# and libclang into course
export PYTHONPATH=$(readlink -f /src/tools/clang/bindings/python/)
export LD_LIBRARY_PATH=$(readlink -f /inst/lib)
cd possess
./inspector prebuild ../test/test.cpp
gcc -o test-proc $(./inspector print-cflags) ../test/test.cpp
# birth repl cli
./inspector repl
# let program connect to repl


news image
Read Extra

Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *