{"id":13418136,"url":"https://github.com/inspector-repl/inspector","last_synced_at":"2025-04-13T05:06:10.213Z","repository":{"id":39261222,"uuid":"98167007","full_name":"inspector-repl/inspector","owner":"inspector-repl","description":"A drop-anywhere C++ REPL ","archived":false,"fork":false,"pushed_at":"2023-06-12T03:36:03.000Z","size":88,"stargazers_count":839,"open_issues_count":1,"forks_count":30,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-04-13T05:06:06.912Z","etag":null,"topics":["cpp17","gdb","inspector","lldb","repl"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inspector-repl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.TXT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-07-24T08:22:15.000Z","updated_at":"2025-04-09T09:05:26.000Z","dependencies_parsed_at":"2022-09-20T00:23:08.617Z","dependency_job_id":"f2bfc5f6-27b9-4060-a256-b01910a82716","html_url":"https://github.com/inspector-repl/inspector","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inspector-repl%2Finspector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inspector-repl%2Finspector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inspector-repl%2Finspector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inspector-repl%2Finspector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inspector-repl","download_url":"https://codeload.github.com/inspector-repl/inspector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665748,"owners_count":21142123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp17","gdb","inspector","lldb","repl"],"created_at":"2024-07-30T22:00:58.864Z","updated_at":"2025-04-13T05:06:10.190Z","avatar_url":"https://github.com/inspector-repl.png","language":"C++","readme":"# Inspector - A drop-anywhere C++ REPL\n\n[![Build Status](https://travis-ci.org/inspector-repl/inspector.svg?branch=master)](https://travis-ci.org/inspector-repl/inspector)\n\nAllows to inject a fully-functional C++17 REPL into running, compiled programs\nthat can access your program state and offers features like code-completion and\nsyntax highlighting.\n\nThe API is similar to tools like [Pry](http://pryrepl.org/) in Ruby or\n[Pdb](https://docs.python.org/3/library/pdb.html) in Python:\n\nExample program:\n\n```c++\n// save as main.cpp\n#include \u003ciostream\u003e\n#include \u003cstring\u003e\n\nint main(int argc, char** argv) {\n    int a = 1;\n    std::string b = \"hello world\";\n#include INSPECTOR\n    std::cout \u003c\u003c \"second break.\" \u003c\u003c std::endl;\n#include INSPECTOR\n}\n```\n\n```console\n$ ./inspector prebuild main.cpp \n$ clang++ $(./inspector print-cflags) main.cpp -o main \n$ ./inspector repl\n$ ./main\n```\n\n![Inspector example session](https://i.imgur.com/D7MQrDU.png \"Inspector\")\n\n[Presentation slides on Inspector](https://hackmd.shackspace.de/p/rypPYkqUM#/)\n\n[10 min video presentation on Inspector](https://www.youtube.com/watch?v=Cl5RSlW6xAc)\n\n[Cppcast about Inspector](http://cppcast.com/2018/02/mathieu-ropert/)\n\n## Build\n\n### Requirements\n\n- a c++ compiler (gcc or clang++)\n- libcling (see installation instructions below)\n- jsoncpp\n- python3\n- python-prompt-toolkit (for python3)\n- python-setuptools (for python3)\n- pkg-config\n\n### Build Cling\n\nNote that for some linux distributions the cling project also provide pre-build [binaries](https://root.cern.ch/download/cling/).\n\n```\ngit clone http://root.cern.ch/git/llvm.git src\ncd src\ngit checkout cling-patches\ncd tools\ngit clone http://root.cern.ch/git/cling.git\ngit clone http://root.cern.ch/git/clang.git\ncd clang\ngit checkout cling-patches\ncd ../..\nmkdir build inst\ncd build\ncmake -DCMAKE_INSTALL_PREFIX=../inst ..\ncmake --build .\ncmake --build . --target install\n```\n\n### Build Inspector\n\n```\ngit clone git@github.com:inspector-repl/inspector.git\ncd inspector\nmkdir build\ncd build\ncmake -DCMAKE_PREFIX_PATH=\"../inst\" ..\ncmake --build .\n```\n\n## Usage\n\n```\n# bring python bindings\n# (requires clang 5/trunk for python3 support, the clang branch from cling is new enough)\n# and libclang into path\nexport PYTHONPATH=$(readlink -f \u003cllvm-root\u003e/src/tools/clang/bindings/python/)\nexport LD_LIBRARY_PATH=$(readlink -f \u003cllvm-repo\u003e/inst/lib)\ncd build\n./inspector prebuild ../test/test.cpp\ngcc -o test-proc $(./inspector print-cflags) ../test/test.cpp\n# start repl cli\n./inspector repl\n# let program connect to repl\n./test-proc\n```\n\n## TODO\n\n- [ ] buildsystem integration:\n  - [ ] cmake\n  - [ ] autotools\n  - [ ] make\n  - [ ] meson\n- [ ] include type declaration into the repl\n- [ ] search for '#include INSPECTOR' before parsing (speed)\n- [ ] use verbose mode of compiler to get additional include paths for cling /\n      libclang parsing\n- [ ] multiprocessing scanning\n- [ ] GDB/LLDB plugin: link/preload libinspector.so and invoke inspector with debug information from gdb/lldb. \n- Support for more languages:\n   - [ ] C\n","funding_links":[],"categories":["TODO scan for Android support in followings","C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finspector-repl%2Finspector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finspector-repl%2Finspector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finspector-repl%2Finspector/lists"}