Add cross-platform GDB debugger with C++ support#220
Draft
Conversation
Agent-Logs-Url: https://github.com/one-ware/OneWare/sessions/611f23d4-255c-4a97-9754-3675681a455e Co-authored-by: hendrikmennen <25281882+hendrikmennen@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add GDB debugger for C++ support
Add cross-platform GDB debugger with C++ support
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
OneWare.Debuggermodule had partial GDB MI code but was never wired up — the view shipped as a "Coming Soon!" placeholder andBreakpointStorehad its debugger hooks commented out. This PR completes it into a working, cross-platform GDB debugger usable against C++ projects.OneWare.DebuggerGdbSessionbecomes a concrete (non-abstract) class;RunCommand/RunCommandAsyncare now public and a thread-safeIsRunningis exposed.IDebuggerService/DebuggerService(DI singleton) owns at most one active session, applies the shared breakpoints, forwards GDB output toIOutputService, and exposesStartAsync/Stop/Continue/Pause/Step/Next/Finish. Breakpoints toggled while a session is live are applied/removed automatically. Async MI mode is used everywhere except Windows (which falls back to the existing SIGINT helper for pause).DebuggerModuleregisters the service, eagerly resolves it at startup so it observes the breakpoint store, and registers aTools/Debugger/GDB PathFilePathSettingwith OS-specific defaults (gdb.exeon Windows,gdbelsewhere) and PATH-based auto-detection at start time.DebuggerViewModel/DebuggerViewreplace the placeholder with a functional toolbar (Start/Stop/Continue/Pause/Step/Next/Finish) and an executable picker, bound toIsDebugging/IsRunningforCanExecute.OneWare.EssentialsBreakpointStoreexposes a single sharedInstance, andExtendedTextEditor.SetEnableBreakpointsbinds every editor margin to it. The previous per-margin store made cross-file debugging impossible — only breakpoints in the editor that started the session were observable. C++ already hasCanAddBreakPoints => true, so C++ breakpoints now flow into the live GDB session without further wiring.Tests
tests/OneWare.Debugger.UnitTests/with 6 tests for GDB MI output parsing:GdbCommandResult(^donewith nested results,^error,msg=...,^running,^connected) andGdbEvent(*stoppedat a breakpoint withframe/fullname/line,*running).Notes / follow-ups
_exec-runis used to launch the inferior with a fallback to_exec-continue; remote-target /attachflows are not yet exposed.gdb.exe(e.g. MSYS2 / MinGW) since one isn't auto-installed.lldbrather thangdbby default — users will need to installgdb(brew install gdb, code-sign) or we follow up with anlldb-mibackend behind the sameIDebuggerService.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
www.myget.org/opt/hostedtoolcache/CodeQL/2.25.1/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp /opt/hostedtoolcache/CodeQL/2.25.1/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp(dns block)/usr/share/dotnet/dotnet dotnet restore --no-dependencies /home/REDACTED/work/OneWare/OneWare/src/VtNetCore.Avalonia/VtNetCore.Avalonia.sln --packages /tmp/codeql-scratch-4731918ca57aa503/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-4731918ca57aa503/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-4731918ca57aa503/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true(dns block)/usr/share/dotnet/dotnet dotnet restore --no-dependencies /home/REDACTED/work/OneWare/OneWare/src/VtNetCore.Avalonia/VtNetCore.Avalonia.App/VtNetCore.Avalonia.App.csproj --packages /tmp/codeql-scratch-4731918ca57aa503/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-4731918ca57aa503/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-4731918ca57aa503/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true(dns block)If you need me to access, download, or install something from one of these locations, you can either: