Skip to content

About

Minimal C++ host template showing how to embed angelscript-dap and debug AngelScript in VS Code.

Topics

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

AngelScript Debugger Example

English | Español

A small C++ host to run and debug AngelScript from VS Code.

Attaching in VS Code and stepping through AngelScript while inspecting variables and the call stack

Attach in VS Code, step through AngelScript, and inspect variables and the call stack.

Quick start

> git clone --recursive https://github.com/angelscript-tools/angelscript-debugger-example.git
> cd angelscript-debugger-example
> .\run-demo.cmd --build-only

Builds angelscript-demo.exe.

> code .
> F5

Set a breakpoint on a // BP line in scripts/basic.as, select Launch AngelScript Demo, and press F5.

Launch from VS Code

Launching the host with F5, pausing at a breakpoint, and reading script output in the Debug Console

Launch with F5, inspect the score, and continue to see the final total.

Attach to a running host

> .\run-demo.cmd
> F5

Wait for DAP listening, then select Attach to AngelScript Demo in VS Code, and press F5.

Project layout

└── 📁 angelscript-debugger-example
    ├── 📁 .vscode
    │   ├── 📄 launch.json         Attach and Launch configurations
    │   ├── 📄 settings.json       Predefined stub setting
    │   └── 📄 tasks.json          Build task for Launch
    ├── 📁 host
    │   └── 📄 main.cpp            C++ host, print, Player, and the DAP server
    ├── 📁 scripts
    │   ├── 📄 basic.as            Score calculation and function calls
    │   ├── 📄 advanced.as         Objects, collections, and exceptions
    │   ├── 📄 engine.as           Host calls and callbacks
    │   └── 📄 host.as.predefined  Host API declarations
    ├── 📁 external
    │   ├── 📁 angelscript         AngelScript engine (submodule)
    │   └── 📁 angelscript-dap     Debugger core (submodule)
    ├── 📁 media
    └── 📄 run-demo.cmd            Build and run the demo

Requirements

Windows, Git, CMake 3.21+, Ninja, Visual Studio 2022+ or Build Tools with Desktop development with C++ (MSVC x64, C++20), and VS Code with the AngelScript extension.

Use the debugger in your own host

The debugger is the angelscript-dap repository, included here as a submodule. host/main.cpp shows the calls a host makes, and the angelscript-dap README lists the CMake options.

add_subdirectory(external/angelscript-dap)  # after your AngelScript target
target_link_libraries(my_host PRIVATE angelscript_dap)

Related

Project Use
angelscript-lsp Editor support for VS Code
angelscript-cli Run, check and debug scripts from the terminal
angelscript-mcp MCP server so AI agents check and navigate scripts
angelscript-agent-kit Skill and one-step installs for Claude Code, Codex, Gemini CLI and Antigravity
angelscript-dap The debugger core and its support
angelscript-jit Optional JIT compiler
angelscript-engine Patched SDK builds for AngelScript 2.20 to 2.39
tree-sitter-angelscript Tree-sitter grammar the language server uses
angelscript-api-dumper Writes .as.predefined stubs from a running engine
asdebugger The Sven Co-op plugin built on the same core

License

MIT. See also CONTRIBUTING.md and docs/THIRD_PARTY.md.

About

Minimal C++ host template showing how to embed angelscript-dap and debug AngelScript in VS Code.

Topics

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages