Allow multiple levels of breakpoint command with options

Open
#620 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
ruby
Domain
devtools

Research direction

Start with the debugger command handling for the do: and pre: options, using the nested debugger(do:) examples in the issue as the initial cases to understand. The work is done when multiple nested command levels and the shown hash-style command script are supported without requiring manual execution between actions.

Written by the indexing model from the issue text.

Description

enhancement

Your proposal

Allow nesting commands like this:

debugger(do: "break Foo#initialize do: (watch @ivar do: pp self)")

Or even:

debugger(do: {
  "break Foo#initialize" => {
    do: { "watch @ivar" => { do: "pp self" } }
  },
  "catch MyError" => { do: "bt 20" }
})

This will allow users to write a simple script, place it at one place (e.g. a Rails controller), and execute the entire debugging process without any automatically.

Right now it's not possible because the debugger assumes do: or pre: options only have 1 level of action.

Dominant language
Ruby
Stars
1.3k
Forks
146
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ruby/debug

All issues in ruby/debug

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.