{"id":13831346,"url":"https://github.com/google/lldb-eval","last_synced_at":"2025-07-09T13:33:31.778Z","repository":{"id":39970025,"uuid":"296277315","full_name":"google/lldb-eval","owner":"google","description":"lldb-eval is a library for evaluating expressions in the debugger context","archived":false,"fork":false,"pushed_at":"2025-03-26T22:27:09.000Z","size":741,"stargazers_count":80,"open_issues_count":10,"forks_count":19,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-19T22:27:27.865Z","etag":null,"topics":["clang","debugging-tool","expression-evaluator","lldb"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-17T09:16:16.000Z","updated_at":"2025-02-05T23:05:38.000Z","dependencies_parsed_at":"2024-05-29T16:12:28.438Z","dependency_job_id":"86c3b7ef-c3d7-45f2-9815-e55074aa68b6","html_url":"https://github.com/google/lldb-eval","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/google/lldb-eval","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Flldb-eval","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Flldb-eval/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Flldb-eval/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Flldb-eval/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/lldb-eval/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Flldb-eval/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264468206,"owners_count":23613058,"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":["clang","debugging-tool","expression-evaluator","lldb"],"created_at":"2024-08-04T10:01:25.291Z","updated_at":"2025-07-09T13:33:31.451Z","avatar_url":"https://github.com/google.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"# lldb-eval - blazing fast debug expression evaluation\n\n[![Build Status](https://github.com/google/lldb-eval/workflows/Build%20\u0026%20Test/badge.svg?branch=master)](https://github.com/google/lldb-eval/actions?query=workflow%3A%22Build+%26+Test%22+branch%3Amaster)\n\n## What\n\n`lldb-eval` is an [LLDB](https://lldb.llvm.org/)-based library for evaluating\ndebug expressions in the context of the debugged process. All modern debuggers\nsupport evaluating expressions to inspect the target process state: print out\nvariables, access member fields, etc. `lldb-eval` is basically a REPL-like\nlibrary, that allows to inspect the process state using the familiar C++ syntax.\nThe primary use-case is IDE integration (for example, \n[Stadia for Visual Studio](https://github.com/googlestadia/vsi-lldb)).\n\n## Why\n\nLLDB has a very powerful built-in expression evaluator (available via `expr`\ncommand). It can handle almost any valid C++ as well as perform function calls.\nBut the downside of this power is poor performance, especially for large\nprograms with lots of debug information. This is not as critical for interactive\nuse, but doesn't work well for implementing IDE integrations. For example,\nStadia debugger for Visual Studio evaluates dozens and hundreds of expressions\nfor every \"step\", so it has to be fast.\n\n`lldb-eval` makes a trade-off between performance and completeness, focusing on\nperformance. It features a custom expression parser and relies purely on the\ndebug information, aiming at sub-millisecond evaluation speed.\n\n## Build \u0026 Test\n\n### Dependencies\n\n#### Linux\n\nInstall the dependencies:\n\n```bash\nsudo apt install lld-11 clang-11 lldb-11 llvm-11-dev libclang-11-dev liblldb-11-dev libc++-11-dev libc++abi-11-dev\n```\n\nOr build them from source, see the instructions in the [LLDB documentation](https://lldb.llvm.org/resources/build.html#id9).\n\n```bash\ncmake \\\n    -GNinja \\\n    -DCMAKE_INSTALL_PREFIX=\"~/src/llvm-project/build_optdebug/install\" \\\n    -DCMAKE_BUILD_TYPE=RelWithDebInfo \\\n    -DLLVM_ENABLE_PROJECTS=\"lldb;clang;lld\" \\\n    -DLLVM_ENABLE_RUNTIMES=\"libcxx;libcxxabi;libunwind\" \\\n    -DLLVM_TARGETS_TO_BUILD=\"X86\" \\\n    ../llvm\n```\n\n#### Windows\n\nOn Windows we need to build LLDB (and other parts) from source. The steps are\nbasically the same as for Linux. You will need: `CMake`, `Ninja` and\n`Visual Studio` (tested with Visual Studio 2019 16.6.5).\n\n\u003e **Hint:** You can install the dependencies via [Chocolatey](https://chocolatey.org/).\n\nRun the `x64 Native Tools Command Prompt for VS 2019`:\n\n```bash\ngit clone https://github.com/llvm/llvm-project.git\ncd llvm-project\nmkdir build_x64_optdebug\ncd build_x64_optdebug\n\ncmake ^\n    -DCMAKE_INSTALL_PREFIX='C:\\src\\llvm-project\\build_optdebug\\install' ^\n    -DCMAKE_BUILD_TYPE=RelWithDebInfo ^\n    -DLLVM_ENABLE_PROJECTS='lldb;clang;lld' ^\n    -DLLVM_ENABLE_RUNTIMES=\"libcxx;libcxxabi;libunwind\" \\\n    -DLLVM_TARGETS_TO_BUILD=\"X86\" \\\n    -DLLDB_ENABLE_PYTHON=0 ^\n    -GNinja ^\n    ../llvm\n\nninja install\n```\n\n### Build\n\n`lldb-eval` uses [Bazel](https://bazel.build/), you can find the installation\ninstructions on its website.\n\nYou need to set the `LLVM_INSTALL_PATH` environmental variable with a location\nto your LLVM installation:\n\n```bash\n# (Linux) If you installed the packages via \"apt install\".\nexport LLVM_INSTALL_PATH=/usr/lib/llvm-10\n\n# If you built from source using the instruction above.\nexport LLVM_INSTALL_PATH=~/src/llvm-project/build_optdebug/install\n```\n\n```powershell\n# (Windows) If you built from source using the instructions above.\n$env:LLVM_INSTALL_PATH = C:\\src\\llvm-project\\build_optdebug\\install\n```\n\nNow you can build and test `lldb-eval`:\n\n```bash\n# Build and run all tests\nbazel test ...:all\n\n# Evaluate a sample expression\nbazel run tools:exec -- \"(1 + 2) * 42 / 4\"\n```\n\nDepending on your distribution of LLVM, you may also need to provide\n`--@llvm_project//:llvm_build={static,dynamic}` flag. For example, if your\n`liblldb.so` is linked dynamically (this is the case when installing via `apt`),\nthen you need to use `llvm_build=dynamic`. The build script [tries to choose the\ncorrect default value automatically](/build_defs/repo_rules.bzl#L21), but it can\nbe wrong in some situations (please, report and contribute 🙂).\n\n\u003e **Hint:** You can add this option to your `user.bazelrc` !\n\n### Local per-repo Bazel config\n\nYou can create `user.bazelrc` in the repository root and put there your local\nconfiguration. Check [Bazel docs](https://docs.bazel.build/versions/master/guide.html#bazelrc)\nfor the format. For example:\n\n```bash\n# Building on Linux (usually don't need this, Bazel detects automatically)\nbuild --config=linux\n# Using statically linked liblldb.so\nbuild --@llvm_project//:llvm_build=static\n```\n\n## Publications\n\n* [Blazing fast expression evaluation for C++ in LLDB](https://werat.dev/blog/blazing-fast-expression-evaluation-for-c-in-lldb/)\n* [Building a faster expression evaluator for LLDB](https://www.youtube.com/watch?v=9aThSRGjYdA) at LLVM Developers' Meeting 2021\n* [lldb-eval fuzzer: Finding bugs in an LLDB-based expression evaluator](https://www.youtube.com/watch?v=dJ9k7-pmwvM) at LLVM Developers' Meeting 2021\n\n## Disclaimer\n\nThis is not an officially supported Google product.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Flldb-eval","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Flldb-eval","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Flldb-eval/lists"}