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.
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?This PR creates a new dev command called
brew debugger
which spawns a debugger for Homebrew commands. To use the debugger, add a method call tobinding.break
anywhere in the code. Then, runbrew debugger <cmd>
(this supports passing flags to the command by doingbrew debugger -- <cmd> --flags
). This will automatically spawn a debugger session at the breakpoint usingrdbg
and thedebugger
gem.I've also added a VS Code launch configuration to attach to an existing debug session. If you're using VS Code, you can run
brew debugger --open <cmd>
. Then, use the Run and Debug tab of VS Code to attach to the debugger to use the VS Code debugging frontend. I'm happy to provide a video showing this if my description is confusing.Ultimately, my goal is to allow you to add breakpoints in VS Code and just run directly from there avoiding the need to create a session using
brew debugger
, but that's going to take some more work. I'm not sure therdbg
VS Code extension will support that super cleanly at the moment, so I might need to add some more hack-y workarounds to do that. If anyone has any insight, feel free to let me know.CC @issyl0 and @krehel because we talked about this today on the maintainer zoom