调试 Shoes 应用程序的最佳方法是什么?

发布于 2024-07-05 07:23:03 字数 85 浏览 8 评论 0原文

Shoes 有一些内置转储命令 (Shoes.debug),但是是否有其他工具可以调试代码而无需在整个过程中注入调试消息? 像 gdb 这样的东西会很棒。

Shoes has some built in dump commands (Shoes.debug), but are there other tools that can debug the code without injecting debug messages throughout? Something like gdb would be great.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

淡忘如思 2024-07-12 07:23:03

您还可以使用 Shoes.show_log 自动打开调试控制台。

You can also use Shoes.show_log to automatically open a debug console.

蓝天白云 2024-07-12 07:23:03

鞋子控制台。 按 Alt+/(或在 Mac 上按 apple+/)查看应用程序的堆栈跟踪。

The shoes console. Press Alt+/ (or apple+/ on a mac) to see the stack trace of your application.

贱贱哒 2024-07-12 07:23:03

请注意,如果您使用 Alt + /,则必须在启动应用程序“之前”运行它

Note that if you use Alt + / you'll have to run that "before" starting the app

大海や 2024-07-12 07:23:03

你看过 ruby​​-debug gem 吗?


% sudo gem install ruby-debug

rdebug 可执行文件为您提供了与 gdb 类似的界面(断点设置等)。 您只需使用 rdebug 而不是 ruby​​ 执行脚本即可。

您还可以执行类似的操作以避免手动设置断点:


class Foo
  require 'ruby-debug'
  def some_method_somewhere
    debugger # acts like a breakpoint is set at this point
  end
end

这是有关 ruby​​-debug 的教程:
http://www.datanoise.com/articles/ 2006/7/12/ruby-debug 教程

Have you looked at the ruby-debug gem?


% sudo gem install ruby-debug

The rdebug executable gives you a similar interface to gdb (breakpoint setting, etc). You just simply execute your script with rdebug instead of ruby.

You can also do something like this to avoid manually setting breakpoints:


class Foo
  require 'ruby-debug'
  def some_method_somewhere
    debugger # acts like a breakpoint is set at this point
  end
end

Here's a tutorial on ruby-debug:
http://www.datanoise.com/articles/2006/7/12/tutorial-on-ruby-debug

比忠 2024-07-12 07:23:03

我对这里提到的 Apple-/(或 Alt-/)位有点困惑。 我最终做的是不带任何参数运行./shoes,这会弹出控制台,然后使用./shoes my_app.rb启动我的应用程序。

I was a bit confused about the Apple-/ (or Alt-/) bit mentioned here. What I ended up doing was running ./shoes with no arguments, which popped up the console, then started my app with ./shoes my_app.rb.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文