Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ jobs:
- name: Verify interpreter benchmark workloads
working-directory: sandbox/Benchmark
run: dotnet run --project Benchmark.csproj -c Release --no-restore -- --verify
- name: Test debugger protocol
run: dotnet test tests/Lua.Debugger.Dap.Tests/Lua.Debugger.Dap.Tests.csproj -c Release --no-restore
- name: Test debugger controls and hosting
run: dotnet test tests/Lua.Debugger.Tests/Lua.Debugger.Tests.csproj -c Release --no-restore
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.DS_Store
.claude/settings.local.json
artifacts/
[Bb]in/
[Oo]bj/

/.idea/
*.sln.DotSettings.user
41 changes: 41 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Lua debugger extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/editor-extensions/vscode",
"${workspaceFolder}/.vscode/lua-debugger.code-workspace"
]
},
{
"name": "Debug Lua sample",
"type": "lua-csharp",
"request": "attach",
"host": "127.0.0.1",
"port": 4711,
"stopOnEntry": true,
"preLaunchTask": "Run Lua debugger sample"
},
{
"name": "Debug user-script host",
"type": "lua-csharp",
"request": "attach",
"host": "127.0.0.1",
"port": 4711,
"stopOnEntry": true,
"preLaunchTask": "Run user-script host"
},
{
"name": "Attach to Lua application",
"type": "lua-csharp",
"request": "attach",
"host": "127.0.0.1",
"port": 4711,
"stopOnEntry": false
}
]
}
7 changes: 7 additions & 0 deletions .vscode/lua-debugger.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"folders": [
{
"path": ".."
}
]
}
99 changes: 99 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Run Lua debugger sample",
"type": "process",
"command": "dotnet",
"args": [
"run",
"--project",
"sandbox/Debugger/Debugger.csproj",
"--configuration",
"Release",
"--",
"sandbox/Debugger/example.lua"
],
"options": {
"cwd": "${workspaceFolder}"
},
"isBackground": true,
"problemMatcher": {
"base": "$msCompile",
"background": {
"activeOnStart": true,
"beginsPattern": "^\\s*Determining projects to restore\\.\\.\\.$",
"endsPattern": "^Lua debugger listening on "
}
}
},
{
"label": "Run user-script host",
"type": "process",
"command": "dotnet",
"args": [
"run",
"--project",
"sandbox/DebuggerHost/DebuggerHost.csproj",
"--configuration",
"Release",
"--",
"--host",
"${input:luaHostType}",
"--pause",
"${input:luaPauseMode}",
"--scripts",
"${input:luaUserScripts}",
"--entry",
"${input:luaUserEntry}",
"--wait-for-debugger"
],
"options": {
"cwd": "${workspaceFolder}"
},
"isBackground": true,
"problemMatcher": {
"base": "$msCompile",
"background": {
"activeOnStart": true,
"beginsPattern": "^\\s*Determining projects to restore\\.\\.\\.$",
"endsPattern": "^Lua debugger listening on "
}
}
}
],
"inputs": [
{
"id": "luaUserScripts",
"type": "promptString",
"description": "Application-owned script directory (absolute or relative to the repository)",
"default": "sandbox/DebuggerHost/UserScripts"
},
{
"id": "luaUserEntry",
"type": "promptString",
"description": "Entry file relative to script directory (blank: main.lua for game; worker.lua for service)",
"default": ""
},
{
"id": "luaHostType",
"type": "pickString",
"description": "Application hosting model",
"options": [
"game",
"service"
],
"default": "game"
},
{
"id": "luaPauseMode",
"type": "pickString",
"description": "Debugger pause policy: async releases the host thread; sync blocks it",
"options": [
"async",
"sync"
],
"default": "async"
}
]
}
6 changes: 6 additions & 0 deletions Lua.slnx
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
<Solution>
<Folder Name="/sandbox/">
<Project Path="sandbox/Debugger/Debugger.csproj" />
<Project Path="sandbox/DebuggerHost/DebuggerHost.csproj" />
<File Path="sandbox/ConsoleApp2/.gitignore" />
<Project Path="sandbox/Benchmark/Benchmark.csproj" />
<Project Path="sandbox/ConsoleApp1/ConsoleApp1.csproj" />
<Project Path="sandbox/ConsoleApp2/ConsoleApp2.csproj" />
<Project Path="sandbox/JitTest/JitTest.csproj" />
</Folder>
<Folder Name="/src/">
<Project Path="src/Lua.Debugger/Lua.Debugger.csproj" />
<Project Path="src/Lua.Debugger.Dap/Lua.Debugger.Dap.csproj" />
<Project Path="src/Lua.Annotations/Lua.Annotations.csproj" />
<Project Path="src/Lua.SourceGenerator/Lua.SourceGenerator.csproj" />
<Project Path="src/Lua/Lua.csproj" />
</Folder>
<Folder Name="/tests/">
<Project Path="tests/Lua.Debugger.Tests/Lua.Debugger.Tests.csproj" />
<Project Path="tests/Lua.Debugger.Dap.Tests/Lua.Debugger.Dap.Tests.csproj" />
<Project Path="tests/Lua.SourceGenerator.Tests/Lua.SourceGenerator.Tests.csproj" />
<Project Path="tests/Lua.Tests/Lua.Tests.csproj" />
</Folder>
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Performance and allocation costs depend on the workload and embedding API. The i
* Support for exception handling with try-catch
* High-performance implementation utilizing modern C#
* Unity support (works with both Mono and IL2CPP)
* Optional [C# debugger and DAP attach server](docs/debugger.md)

## Installation

Expand Down
1 change: 1 addition & 0 deletions README_JA.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ MoonSharpは多くの場合で十分な速度を発揮しますが、設計上
* try-catchによる例外処理のサポート
* 最新のC#を活用したハイパフォーマンスな実装
* Unityサポート(Mono/IL2CPPの両方で動作)
* オプションの[C#デバッガーとDAP接続サーバー](docs/debugger.md)

## インストール

Expand Down
Loading
Loading