• Login
sketchucation logo sketchucation
  • Login
⚠️ Libfredo 15.4b | Minor release with bugfixes and improvements Update

Debugging?

Scheduled Pinned Locked Moved Developers' Forum
6 Posts 3 Posters 371 Views 3 Watching
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.
  • T Offline
    thomthom
    last edited by 3 Feb 2009, 17:36

    Is it possible to hook up a debugger to SU scripts?

    I'd like to use breakpoints and stepping etc.

    Thomas Thomassen — SketchUp Monkey & Coding addict
    List of my plugins and link to the CookieWare fund

    1 Reply Last reply Reply Quote 0
    • T Offline
      thomthom
      last edited by 5 Feb 2009, 16:28

      No?

      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply Reply Quote 0
      • A Offline
        avariant
        last edited by 5 Feb 2009, 18:09

        I've seen a ruby gem called ruby_debug, but I don't know anything about gems, or if such a thing is compatible with SU. It seems to imply it's like a command-line debugger.

        1 Reply Last reply Reply Quote 0
        • P Offline
          pecan
          last edited by 6 Feb 2009, 01:18

          @avariant said:

          I've seen a ruby gem called ruby_debug, but I don't know anything about gems, or if such a thing is compatible with SU. It seems to imply it's like a command-line debugger.

          Debug is built into the base Ruby system. And you can attempt to load it from an installed Ruby version 1.8 directory.

          # Add debug library load path
          $;.push "c;/User/Programs/ruby/lib/ruby/1.8"
          # invoke the debugger
          require "debug.rb"
          puts "Ready to run"
          
          

          Result:

          load "/temp2/dbug.rb"
          Error; #<Errno;;EBADF; Bad file descriptor>
          c;/User/Programs/ruby/lib/ruby/1.8/debug.rb;74;in `flush'
          c;/User/Programs/ruby/lib/ruby/1.8/debug.rb;74;in `readline'
          c;/User/Programs/ruby/lib/ruby/1.8/debug.rb;275;in `debug_command'
          c;/User/Programs/ruby/lib/ruby/1.8/debug.rb;705;in `excn_handle'
          c;/User/Programs/ruby/lib/ruby/1.8/debug.rb;755;in `trace_func'
          c;/User/Programs/ruby/lib/ruby/1.8/debug.rb;945
          c;/User/Programs/ruby/lib/ruby/1.8/debug.rb;944
          
          

          Debug Line 74: is
          STDOUT.flush

          But... it was built to run under a shell, such as MS DOS and writes to STDOUT and reads from STDIN console files.

          Since SU imbeds Ruby in a GUI window, there is no STDIN or STDOUT.

          I suspect with experimentation and work, STDIN and STDOUT could be redirected to the SU Ruby window, or a shell could be started to run along side SU to accept debugger IO.

          It would take replacing the Ruby 1.8 debug.rb script with another compatible with SU.

          An interesting project. It should be done. Anyone?

          1 Reply Last reply Reply Quote 0
          • T Offline
            thomthom
            last edited by 6 Feb 2009, 07:31

            That would be very interesting.
            I don't think I have the experience to do it though. 😞

            Thomas Thomassen — SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            1 Reply Last reply Reply Quote 0
            • P Offline
              pecan
              last edited by 18 Feb 2009, 22:55

              See plugin SCrud:

              301 Moved Permanently

              favicon

              (www.sketchucation.com)

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

              Advertisement