Add Phase 3 debugger features: p/x commands, %DB::sub, @DB::args#287
Merged
Add Phase 3 debugger features: p/x commands, %DB::sub, @DB::args#287
Conversation
- Add `p expr` command to evaluate and print expressions - Add `x expr` command to dump data structures (uses Data::Dumper) - Pass code and registers context to DebugHooks.debug() - Temporarily disable debug mode during eval to prevent recursion - Fix EvalStringHandler to pass errorUtil to BytecodeCompiler Note: Lexical variable access not yet working due to scope limitations. Expressions like `p 1+2` and `p "hello"` work correctly. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <noreply@cognition.ai>
- Add 'p expr' command to evaluate and print expressions in debugger - Add 'x expr' command to dump expressions with Data::Dumper formatting - Implement %DB::sub hash to track subroutine locations (file:start-end) - Implement @db::args to capture subroutine arguments on each call - Fix step-into subroutines by tracking callDepth with enterSubroutine/exitSubroutine - Fix DEBUG opcode line numbers for lazily compiled subroutines using getLineNumberAccurate() - Add DEBUG opcode support to bytecode disassembler Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <noreply@cognition.ai>
- Create docs/reference/debugger.md with full command reference - Update cli-options.md to document -d flag - Update feature-matrix.md with Phase 3 debugger features Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <noreply@cognition.ai>
- Add `r` command to step out of current subroutine - Add `T` command to display stack trace - Implement one-time breakpoints for `c line` command - Add stepOutDepth tracking in DebugState - Update documentation with new commands Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <noreply@cognition.ai>
Move debugger features from bullet points under "Compiler Usability" to a standalone section with organized tables for: - Execution commands - Breakpoints - Source and stack commands - Expression evaluation - Debug variables Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <noreply@cognition.ai>
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.
Summary
This PR adds Phase 3 features to the Perl debugger:
p exprcommand: Evaluate and print expressions in the debuggerx exprcommand: Dump expressions with Data::Dumper formatting%DB::subhash: Track subroutine locations (file:startline-endline)@DB::argsarray: Capture subroutine arguments on each callBug Fixes
callDepthwithenterSubroutine()/exitSubroutine()callsgetLineNumberAccurate()which counts from the beginning of the fileTesting
Test plan
@DB::argsshows correct arguments%DB::subtracks subroutine locationsGenerated with Devin