sketchucation logo sketchucation
    • 登入
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update

    [Talk] Ruby Debugger for SketchUp 14+

    已排程 已置頂 已鎖定 已移動 Developers' Forum
    45 貼文 8 Posters 6.6k 瀏覽 8 Watching
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • J 離線
      Jim
      最後由 編輯

      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 條回覆 最後回覆 回覆 引用 0
      • Dan RathbunD 離線
        Dan Rathbun
        最後由 編輯

        @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 條回覆 最後回覆 回覆 引用 0
        • Dan RathbunD 離線
          Dan Rathbun
          最後由 編輯

          @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 條回覆 最後回覆 回覆 引用 0
          • jiminy-billy-bobJ 離線
            jiminy-billy-bob
            最後由 編輯

            @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 條回覆 最後回覆 回覆 引用 0
            • J 離線
              Jim
              最後由 編輯

              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 條回覆 最後回覆 回覆 引用 0
              • J 離線
                Jim
                最後由 編輯

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

                2014-04_02.png

                Hi

                1 條回覆 最後回覆 回覆 引用 0
                • S 離線
                  slbaumgartner
                  最後由 編輯

                  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 條回覆 最後回覆 回覆 引用 0
                  • D 離線
                    driven
                    最後由 編輯

                    @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 條回覆 最後回覆 回覆 引用 0
                    • tt_suT 離線
                      tt_su
                      最後由 編輯

                      @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 條回覆 最後回覆 回覆 引用 0
                      • J 離線
                        Jim
                        最後由 編輯

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

                        Hi

                        1 條回覆 最後回覆 回覆 引用 0
                        • Dan RathbunD 離線
                          Dan Rathbun
                          最後由 編輯

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

                          RubyForge - Page not found

                          favicon

                          (debug-commons.rubyforge.org)

                          I'm not here much anymore.

                          1 條回覆 最後回覆 回覆 引用 0
                          • J 離線
                            Jim
                            最後由 編輯

                            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 條回覆 最後回覆 回覆 引用 0
                            • jiminy-billy-bobJ 離線
                              jiminy-billy-bob
                              最後由 編輯

                              Nice! Can't wait to try this

                              25% off Skatter for SketchUcation Premium Members

                              1 條回覆 最後回覆 回覆 引用 0
                              • Dan RathbunD 離線
                                Dan Rathbun
                                最後由 編輯

                                @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 條回覆 最後回覆 回覆 引用 0
                                • Dan RathbunD 離線
                                  Dan Rathbun
                                  最後由 編輯

                                  @dan rathbun said:

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

                                  RubyForge - Page not found

                                  favicon

                                  (debug-commons.rubyforge.org)

                                  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 條回覆 最後回覆 回覆 引用 0
                                  • S 離線
                                    slbaumgartner
                                    最後由 編輯

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

                                    Steve

                                    1 條回覆 最後回覆 回覆 引用 0
                                    • tt_suT 離線
                                      tt_su
                                      最後由 編輯

                                      @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 條回覆 最後回覆 回覆 引用 0
                                      • Dan RathbunD 離線
                                        Dan Rathbun
                                        最後由 編輯

                                        Nothing seems to have changed in at least a month (and that seems to be only the readme.)

                                        If you have something to announce, come on out and say it.

                                        I'm not here much anymore.

                                        1 條回覆 最後回覆 回覆 引用 0
                                        • J 離線
                                          Jim
                                          最後由 編輯

                                          @dan rathbun said:

                                          Why Python, and perhaps GitHub it ?

                                          Why Python? Python just seemed like my best chance for success for a proof-of-concept compared to the alternative ways to extend Npp.

                                          The Python code is currently posted on this Gist. I'm sure it's ugly as I don't know exactly what I'm doing in Python yet - I am learning as I go about Python, PythonScript, and the Npp environment. I'll put it in a proper Github repo when it's more stable.

                                          Maybe there's a Pythonista around who would be willing to help out?

                                          This is also a bit complicated to setup - I had to compile my own version of PythonScript.dll from the latest GitHub source to get the margin click callback to return the correct values.

                                          One big downside of PythonScript is it appears to have weak support for creating Toolbars in Npp, so creating a good user interface may be a problem.

                                          I would love for this to be written in c++ to take advantage of more features of Npp, but that would require learning c++ first and that takes time.

                                          @dan rathbun said:

                                          I am wondering if this ruby debug ide protocol is based on (or compatible with,)
                                          the DBGp protocol

                                          No, DBGp is incompatible.

                                          The commands that the SketchUp Debugging Server accepts can be found by interpreting these regular expressions.

                                          Hi

                                          1 條回覆 最後回覆 回覆 引用 0
                                          • Dan RathbunD 離線
                                            Dan Rathbun
                                            最後由 編輯

                                            Yea.. I agree I poked around in the NPP Plugin "How to" today. The C++ stuff is too complex to learn quickly.

                                            I did not find any Ruby binding, so Python would be the next best thing. It is similar to ruby (without all the "end"s.)

                                            I tried first to install PythonScript in my %AppData% path where all my other NPP plugins are installed, but got an error when trying to open the Python Console. (Something about Python being an ANSI version, and incompatible with the Unicode NPP.)

                                            Installing it in the %ProgramFiles% path works (as the doc stated that is where to install it.) So it will require Admin privileges.

                                            I'm not here much anymore.

                                            1 條回覆 最後回覆 回覆 引用 0
                                            • 1
                                            • 2
                                            • 3
                                            • 1 / 3
                                            • 第一個貼文
                                              最後的貼文
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement