豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Fix help message of the eval command#1130

Merged
ko1 merged 1 commit intoruby:masterfrom
matthieuprat:fix-eval-command-help
Jun 5, 2025
Merged

Fix help message of the eval command#1130
ko1 merged 1 commit intoruby:masterfrom
matthieuprat:fix-eval-command-help

Conversation

@matthieuprat
Copy link
Copy Markdown
Contributor

When running the eval command (or its alias, call) without an argument, you get the following error:

[REPL ERROR] #<NameError: undefined local variable or method `cmd' for #<DEBUGGER__::Session:0x0000000120a0fa20>>
  debug-1.10.0/lib/debug/session.rb:934:in `block in register_default_command'
  debug-1.10.0/lib/debug/session.rb:1165:in `process_command'
  ...

...instead of this hint:

To evaluate the variable `eval`, use `pp eval` instead.

I believe the regression was introduced in a402e73.

To fix this issue, I was thinking of passing the command name alongside the argument in the process_line method but I wasn't sure this was worth it just for this hint. So I removed the hint altogether instead.

When running the `eval` command (or its alias, `call`) without an
argument, you get the following error:

```
[REPL ERROR] #<NameError: undefined local variable or method `cmd' for #<DEBUGGER__::Session:0x0000000120a0fa20>>
  debug-1.10.0/lib/debug/session.rb:934:in `block in register_default_command'
  debug-1.10.0/lib/debug/session.rb:1165:in `process_command'
  ...
```

...instead of this hint:

```
To evaluate the variable `eval`, use `pp eval` instead.
```

I believe the regression was introduced in a402e73.

To fix this issue, I was thinking of passing the command name alongside
the argument in the `process_line` method but I wasn't sure this was
worth it just for this hint. So I removed the hint altogether instead.
@ko1
Copy link
Copy Markdown
Collaborator

ko1 commented Jun 5, 2025

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants