• Login
sketchucation logo sketchucation
  • Login
๐Ÿค‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

[Talk] Ruby Debugger for SketchUp 14+

Scheduled Pinned Locked Moved Developers' Forum
45 Posts 8 Posters 5.8k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    Dan Rathbun
    last edited by 20 Apr 2014, 19:48

    @jiminy-billy-bob said:

    Ok so it's a faster way to get the same thing than reading the error's number line in the ruby console and check it in notepad++?

    The "I" in IDE means integrated.

    An IDE has panes, some of which are variable lists, editor, console, object tree, project tree, etc.

    I think some IDEs have used the Scintilla editor engine which NotePad++ also uses.

    In an IDE you usually set breakpoints by clicking in the margin if the editor pane, and a breakpoint icon appears. (In Notepad++, it is a blue sphere.)

    I'm not here much anymore.

    1 Reply Last reply Reply Quote 0
    • D Offline
      Dan Rathbun
      last edited by 21 Apr 2014, 19:55

      @dan rathbun said:

      @jim said:

      The code I posted might be used as a starting point to interface a simple editor with the debugger.

      I have d/l'd a couple of gems to do this:

      ruby-debug-ide-0.4.22.gem (written by the RubyMine folks)
      debase-0.0.9.gem (a dependancy of the above.)

      Haven't gotten them installed yet.

      The above gems require building with the DevKit, for the system Ruby install.

      I'm installing the DevKit today for my main system Ruby, but not for SketchUp's Ruby. (I really do not know if I should attempt hooking the DevKit into SketchUp's Ruby install as the folder structure does not follow the norm.)

      @unknownuser said:

      The ruby-debug-ide protocol has been mostly implemented so any Ruby IDE that supports this protocol should work. We have tested with Aptana RadRails, NetBeans (with Ruby community plugin) and RubyMine.

      So... it seems we do not need to install the above gems into SketchUp's Ruby ? (confirmation requested.)

      I'm not here much anymore.

      1 Reply Last reply Reply Quote 0
      • J Offline
        Jim
        last edited by 21 Apr 2014, 21:05

        @jiminy-billy-bob said:

        Ok so it's a faster way to get the same thing than reading the error's number line in the ruby console and check it in notepad++?

        Not exactly.

        The debugger will let you:

        1. Stop execution of a Sketchup/Ruby script at some given line. (breakpoint.) Multiple breakpoints can be set across files.
        2. Inspect local and global variable at that line.
        3. Inspect the call stack at that breakpoint.
        4. Step through the following script lines one at a time. Goto 2

        If Notepad++ can do that, then I've been missing out. And if it were only a faster way to do the same thing, wouldn't that be worth investigating?

        Here's the help listing for the console debugger:
        2014-04_01.png

        Hi

        1 Reply Last reply Reply Quote 0
        • J Offline
          Jim
          last edited by 21 Apr 2014, 22:08

          I'm not interested in installing a 100+ MB IDE in order to write plugins and to use the debugger efficiently, which is the reason I am playing with getting my editor (vim) to talk to the debugger.

          Since the su debugger communicates over a tcp socket, there is a chance of creating an intermediate service between the editor and the debugger. Unfortunately, Notepad++ might require a c/c++ plugin to interface with the SU Debugger.

          Hi

          1 Reply Last reply Reply Quote 0
          • D Offline
            Dan Rathbun
            last edited by 22 Apr 2014, 00:49

            @jim said:

            If Notepad++ can do that, then I've been missing out.

            I may be confused with the "bookmark" feature. (But normally a bookmark feature allows giving them names. NPP does not allow giving them names, making them "act" like breakpoints.)

            I'm not here much anymore.

            1 Reply Last reply Reply Quote 0
            • D Offline
              Dan Rathbun
              last edited by 22 Apr 2014, 01:28

              @jim said:

              I'm not interested in installing a 100+ MB IDE in order to write plugins and to use the debugger efficiently, ...

              Hmmm... I came across Arcadia. It's written in Ruby, and is less than 1MB (~600KB).
              It uses Tcl/Tk for GUI elements, so make sure that is installed in your system Ruby.
              http://arcadia.rubyforge.org/

              I'm not here much anymore.

              1 Reply Last reply Reply Quote 0
              • J Offline
                jiminy-billy-bob
                last edited by 22 Apr 2014, 06:53

                @jim said:

                The debugger will let you:

                1. Stop execution of a Sketchup/Ruby script at some given line. (breakpoint.) Multiple breakpoints can be set across files.
                2. Inspect local and global variable at that line.
                3. Inspect the call stack at that breakpoint.
                4. Step through the following script lines one at a time. Goto 2

                Oh now that sounds might interresting!

                @jim said:

                And if it were only a faster way to do the same thing, wouldn't that be worth investigating?

                Sure! I was just trying to understand the whole thing. I never heard of breakpoints before. (My coding knowledge is limited to html/css, js, and a little ruby)

                25% off Skatter for SketchUcation Premium Members

                1 Reply Last reply Reply Quote 0
                • J Offline
                  Jim
                  last edited by 22 Apr 2014, 23:48

                  It appears you (the ide) must maintain the tcp connection to the debugger for the duration of the debugging session. The debugger does not respond if you try to reconnect and send messages after closing the connection.

                  It seems like you should be able to close and connect to the debugger as long as it is running.

                  This means any type of Editor -> SketchUp Debugger bridge can only connect once and needs to stay running the duration of the user's debugging activities. I was hoping to use a small script executed from the editor that would connect -> send message -> disconnect to the debugger.

                  Hi

                  1 Reply Last reply Reply Quote 0
                  • J Offline
                    Jim
                    last edited by 23 Apr 2014, 00:18

                    The SketchUp debugger is logging messages, so having a windows debugger such as DbgView open can be useful.

                    2014-04_02.png

                    Hi

                    1 Reply Last reply Reply Quote 0
                    • topic:timeago-later,8 days
                    • S Offline
                      slbaumgartner
                      last edited by 30 Apr 2014, 19:08

                      The Readme on Github says that Mac is not supported yet, but the repository contains project files for Xcode and build succeeded on my Mac. However, there is no discussion of where to put the dylib or how to invoke it. I tried putting it with the other dylibs in the Frameworks folder and activating with the command line args as suggested for Windows, but I can't see any evidence that it does anything (SU starts and seems to run as normal...). Has anybody gotten this to work on Mac yet?

                      Steve

                      1 Reply Last reply Reply Quote 0
                      • D Offline
                        driven
                        last edited by 30 Apr 2014, 19:11

                        @slbaumgartner said:

                        Has anybody gotten this to work on Mac yet?

                        @Steve

                        been awaiting your return, I only had a brief look...

                        than ran...
                        john

                        learn from the mistakes of others, you may not live long enough to make them all yourself...

                        1 Reply Last reply Reply Quote 0
                        • tt_suT Offline
                          tt_su
                          last edited by 1 May 2014, 09:02

                          @slbaumgartner said:

                          The Readme on Github says that Mac is not supported yet, but the repository contains project files for Xcode and build succeeded on my Mac. However, there is no discussion of where to put the dylib or how to invoke it.

                          Work in progress. I don't recall right now if you will need a new release of SU for OSX before it will work. I'll check in.

                          1 Reply Last reply Reply Quote 0
                          • topic:timeago-later,10 days
                          • J Offline
                            Jim
                            last edited by 11 May 2014, 13:29

                            Do these IDE's somehow notify SketchUp that the file has been modified and needs to be reloaded by SketchUp?

                            Hi

                            1 Reply Last reply Reply Quote 0
                            • D Offline
                              Dan Rathbun
                              last edited by 11 May 2014, 14:59

                              Bugra said they implemented the communication protocol that some of the Ruby debugger gems also implement. Documented (somewhat) here:

                              http://debug-commons.rubyforge.org/protocol-spec.html

                              I'm not here much anymore.

                              1 Reply Last reply Reply Quote 0
                              • J Offline
                                Jim
                                last edited by 12 May 2014, 02:09

                                Here is a demo video of a Notepad++ plugin I am working on for SketchUp Debugger communications.

                                It is written in Python and requires the PythonScript plugin for Notepad++. The video shows setting a breakpoint, inspecting local variables, and stepping through the script.

                                There's no user interface and I use a lot of typed commands, so it is best to watch the video in high quality and full screen.

                                Just made it to show possibilities/measure interest/gather feedback.

                                Hi

                                1 Reply Last reply Reply Quote 0
                                • J Offline
                                  jiminy-billy-bob
                                  last edited by 12 May 2014, 06:01

                                  Nice! Can't wait to try this

                                  25% off Skatter for SketchUcation Premium Members

                                  1 Reply Last reply Reply Quote 0
                                  • D Offline
                                    Dan Rathbun
                                    last edited by 12 May 2014, 13:23

                                    @jim said:

                                    Here is a demo video of a Notepad++ plugin I am working on for SketchUp Debugger communications.

                                    I'd much rather stay with using NP++.

                                    Why Python, and perhaps GitHub it ?

                                    I'm not here much anymore.

                                    1 Reply Last reply Reply Quote 0
                                    • D Offline
                                      Dan Rathbun
                                      last edited by 12 May 2014, 15:13

                                      @dan rathbun said:

                                      Bugra said they implemented the communication protocol that some of the Ruby debugger gems also implement. Documented (somewhat) here:

                                      http://debug-commons.rubyforge.org/protocol-spec.html

                                      I am wondering if this ruby debug ide protocol is based on (or compatible with,)
                                      the DBGp protocol: http://www.xdebug.org/docs-dbgp.php#description

                                      I'm not here much anymore.

                                      1 Reply Last reply Reply Quote 0
                                      • S Offline
                                        slbaumgartner
                                        last edited by 12 May 2014, 16:22

                                        Whimper! Bugra (or whoever) please, please! We Mac users are dying of envy....

                                        Steve

                                        1 Reply Last reply Reply Quote 0
                                        • tt_suT Offline
                                          tt_su
                                          last edited by 12 May 2014, 17:01

                                          @slbaumgartner said:

                                          Whimper! Bugra (or whoever) please, please! We Mac users are dying of envy....

                                          Soon. ๐Ÿ˜„ We need it as well - we share your pain.

                                          Btw, have you checked the GitHub repo lately? ๐Ÿ˜‰

                                          1 Reply Last reply Reply Quote 0
                                          • 1
                                          • 2
                                          • 3
                                          • 2 / 3
                                          2 / 3
                                          • First post
                                            21/45
                                            Last post
                                          Buy SketchPlus
                                          Buy SUbD
                                          Buy WrapR
                                          Buy eBook
                                          Buy Modelur
                                          Buy Vertex Tools
                                          Buy SketchCuisine
                                          Buy FormFonts

                                          Advertisement