Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiple levels of breakpoint command with options #620

Open
st0012 opened this issue Apr 10, 2022 · 3 comments
Open

Allow multiple levels of breakpoint command with options #620

st0012 opened this issue Apr 10, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@st0012
Copy link
Member

st0012 commented Apr 10, 2022

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.

@ko1
Copy link
Collaborator

ko1 commented Apr 17, 2022

This request is, allowing "break do:" with debug commands, not Ruby expression, right?

@st0012
Copy link
Member Author

st0012 commented Apr 17, 2022

Sorry, I don't understand the question. I want to allow break do: in another break do: if that's what you're asking.

Currently this works:

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

But this doesn't work because the debugger doesn't know how to parse the later do:.

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

@ko1
Copy link
Collaborator

ko1 commented Apr 17, 2022

Ah, I see. I misunderstood the current do: spec.
To introduce parens we need to introduce parser to analyze the commands and we need to consider the syntax more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants