Support for IDE-like debugging of RGSS / ruby scripts #198

Open
opened 2018-04-28 13:47:52 +00:00 by Poityu · 8 comments
Poityu commented 2018-04-28 13:47:52 +00:00 (Migrated from github.com)

The idea is that it would be much easier to debug scripts, with step through/step into...etc functions provided by the IDE.

I saw some people mentioning using IDEs instead of the engine editor with MV, which shouldn't be too difficult because MV is backed by Javascript.

For engines with RGSS, I am under the impression that this would require quite some hacking, correct? (Likely involves RubyInline/Rice/FFI)
This is because both the official and the mkxp binary are exe first, Ruby second (Binary runtime that calls into Ruby script), where as MV is Javascript first. (Javascript that calls into JS Runtime)

Appreciate clarifications or confirmations.

The idea is that it would be much easier to debug scripts, with step through/step into...etc functions provided by the IDE. I saw some people mentioning using IDEs instead of the engine editor with MV, which shouldn't be too difficult because MV is backed by Javascript. For engines with RGSS, I am under the impression that this would require quite some hacking, correct? (Likely involves RubyInline/Rice/FFI) This is because both the official and the mkxp binary are exe first, Ruby second (Binary runtime that calls into Ruby script), where as MV is Javascript first. (Javascript that calls into JS Runtime) Appreciate clarifications or confirmations.
Ancurio commented 2018-04-29 09:46:50 +00:00 (Migrated from github.com)

Last time I checked (a long time ago), there was no simple way to step through a running ruby script, look at (local) variables etc., has this changed meanwhile?
I don't like the idea of people using mkxp to create new games (because the engine architecture of RPG Maker is flawed, see #103), but I would still appreciate an effort like this, simply for the fact that it's a nightmare to debug existing games right now with the current infrastructure (which is barely more than printf-debugging).

This is because both the official and the mkxp binary are exe first, Ruby second (Binary runtime that calls into Ruby script), where as MV is Javascript first. (Javascript that calls into JS Runtime)

This is correct. I don't know what's involved in making MRI "traceable", and I don't really have time or resources to devote to this, but I would support such an effort.

Last time I checked (a long time ago), there was no simple way to step through a running ruby script, look at (local) variables etc., has this changed meanwhile? I don't like the idea of people using mkxp to create new games (because the engine architecture of RPG Maker is flawed, see #103), but I would still appreciate an effort like this, simply for the fact that it's a nightmare to debug existing games right now with the current infrastructure (which is barely more than printf-debugging). > This is because both the official and the mkxp binary are exe first, Ruby second (Binary runtime that calls into Ruby script), where as MV is Javascript first. (Javascript that calls into JS Runtime) This is correct. I don't know what's involved in making MRI "traceable", and I don't really have time or resources to devote to this, but I would support such an effort.
Poityu commented 2018-04-29 12:26:13 +00:00 (Migrated from github.com)

Oh, I see..

Last time I checked (a long time ago), there was no simple way to step through a running ruby script, look at (local) variables etc., has this changed meanwhile?

Hmm, RubyMine seems to be able to? I'm approaching this from a similar perspective where ActionScript under Flash has no breakpoint at all, but with Flex you get those things...But in fact, I am not familiar with Ruby development at all, sorry if this turned out to be a silly question.

it's a nightmare to debug existing games right now with the current infrastructure (which is barely more than printf-debugging).

Can't agree more.

This is correct. I don't know what's involved in making MRI "traceable", and I don't really have time or resources to devote to this, but I would support such an effort.

Thanks for the answer. I don't think I can do it even if I have all the time I want. One can only dream...

Oh, I see.. > Last time I checked (a long time ago), there was no simple way to step through a running ruby script, look at (local) variables etc., has this changed meanwhile? Hmm, RubyMine seems to be able to? I'm approaching this from a similar perspective where ActionScript under Flash has no breakpoint at all, but with Flex you get those things...But in fact, I am not familiar with Ruby development at all, sorry if this turned out to be a silly question. > it's a nightmare to debug existing games right now with the current infrastructure (which is barely more than printf-debugging). Can't agree more. > This is correct. I don't know what's involved in making MRI "traceable", and I don't really have time or resources to devote to this, but I would support such an effort. Thanks for the answer. I don't think I can do it even if I have all the time I want. One can only dream...
Poityu commented 2019-02-07 23:28:52 +00:00 (Migrated from github.com)

Well...I don't know why I missed them, but there were certainly some attempts at porting the engine that can be used for the purpose. None seem to be finished.

I have managed a frankenstein that can be boot up and debugged from VSCode (breakpoints/step into/step over/inspect variables...etc), it can show the title screen (in a quite poor way, because it is spliced together), but that's about it...
VXonGosu.zip

I have no idea what is happening beyond title screen, either in a infinite loop or takes too much time drawing. Monkey patching can only get one so far...

Well...I don't know why I missed them, but there were certainly some attempts at porting the engine that can be used for the purpose. None seem to be finished. I have managed a frankenstein that can be boot up and debugged from VSCode (breakpoints/step into/step over/inspect variables...etc), it can show the title screen (in a quite poor way, because it is spliced together), but that's about it... [VXonGosu.zip](https://github.com/Ancurio/mkxp/files/2843031/VXonGosu.zip) I have no idea what is happening beyond title screen, either in a infinite loop or takes too much time drawing. Monkey patching can only get one so far...
gbbnfhb commented 2021-10-22 16:11:14 +00:00 (Migrated from github.com)

ruby2.6 + ruby_jard 
use rubygems install ruby_jard 

debug

ruby2.6 + ruby_jard  use rubygems install ruby_jard  ![debug](https://user-images.githubusercontent.com/55620705/138487228-7cff614a-5666-446f-b691-a734298d74f5.png)
Ancurio commented 2021-10-24 06:06:20 +00:00 (Migrated from github.com)

ruby2.6 + ruby_jard  use rubygems install ruby_jard 

:O 超かっこいいじゃないすか、まるでIDEのdebuggerみたいです。 スクショ ありがとうございます。

> ruby2.6 + ruby_jard  use rubygems install ruby_jard  :O 超かっこいいじゃないすか、まるでIDEのdebuggerみたいです。 スクショ ありがとうございます。
Speak2Erase commented 2022-01-12 19:47:38 +00:00 (Migrated from github.com)

You can actually get rdebug_ide and debase working inside mkxp, with some trickery. It's kinda meh, but it works.
Ruby does come bundled with an official debugger too, so you could try to upgrade to 3.1.0 and use that instead.

You can actually get rdebug_ide and debase working inside mkxp, with some trickery. It's kinda meh, but it works. Ruby does come bundled with an official debugger too, so you could try to upgrade to 3.1.0 and use that instead.
gbbnfhb commented 2022-01-13 01:28:49 +00:00 (Migrated from github.com)

Currently, mkxp doesn't work on ruby 3.1, but I'm investigating.
https://aur.archlinux.org/packages/mkxp-git/
Again, it's 2.7, and since ruby_jard>2.5 or higher, I've adopted the stable 2.6.

Currently, mkxp doesn't work on ruby 3.1, but I'm investigating. https://aur.archlinux.org/packages/mkxp-git/ Again, it's 2.7, and since ruby_jard>2.5 or higher, I've adopted the stable 2.6.
Speak2Erase commented 2022-01-13 18:07:55 +00:00 (Migrated from github.com)

You can try using binding-util.h from mkxp-z, it supports 3.1

You can try using binding-util.h from mkxp-z, it supports 3.1
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: MapleShrine/mkxp#198
No description provided.