Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
breakpointing JRuby Libgdx code
require_relative 'imports' # LibGDX class java_imports
require 'pry-debugger-jruby'
class MainGame < ApplicationAdapter
def create
#binding.pry
breakpoint
Gdx::graphics::setContinuousRendering(false)
$ww, $hh = Gdx::graphics::getWidth, Gdx::graphics::getHeight
$camera = PerspectiveCamera.new(67, $ww, $hh)
end
def render
Gdx::gl::gl_clear_color(0, 0, 0, 1)
Gdx::gl::gl_clear(GL20::GL_COLOR_BUFFER_BIT | GL20::GL_DEPTH_BUFFER_BIT)
end
end
=begin
stacktrace w breakpoint:
Exception in thread "LWJGL Application" org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `run_init_script' for Debugger:Module
at RUBY.debugger(/Users/gslzwol/.rvm/gems/jruby-9.0.5.0@zomg-red-conspiracy/gems/ruby-debug-base-0.10.6-java/lib/ruby-debug-base.rb:228)
at RUBY.create(/Users/gslzwol/stuffs/zomg-owh/src/zredc.rb:11)
stacktrace w binding.pry:
Exception in thread "LWJGL Application" org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `push' for #<Java::ComBadlogicGdxUtils::Array:0x2dd571a8>
at RUBY.push_prompt(/Users/gslzwol/.rvm/gems/jruby-9.0.5.0@zomg-red-conspiracy/gems/pry-0.10.4/lib/pry/pry_instance.rb:582)
at RUBY.initialize(/Users/gslzwol/.rvm/gems/jruby-9.0.5.0@zomg-red-conspiracy/gems/pry-0.10.4/lib/pry/pry_instance.rb:74)
at RUBY.start(/Users/gslzwol/.rvm/gems/jruby-9.0.5.0@zomg-red-conspiracy/gems/pry-0.10.4/lib/pry/repl.rb:15)
at RUBY.start(/Users/gslzwol/.rvm/gems/jruby-9.0.5.0@zomg-red-conspiracy/gems/pry-0.10.4/lib/pry/pry_class.rb:169)
at RUBY.block in start_with_pry_debugger(/Users/gslzwol/.rvm/gems/jruby-9.0.5.0@zomg-red-conspiracy/gems/pry-debugger-jruby-1.2.0-java/lib/pry-debugger-jruby/pry_ext.rb:15)
at RUBY.block in run(/Users/gslzwol/.rvm/gems/jruby-9.0.5.0@zomg-red-conspiracy/gems/pry-debugger-jruby-1.2.0-java/lib/pry-debugger-jruby/processor.rb:18)
at org.jruby.RubyKernel.catch(org/jruby/RubyKernel.java:1096)
at RUBY.run(/Users/gslzwol/.rvm/gems/jruby-9.0.5.0@zomg-red-conspiracy/gems/pry-debugger-jruby-1.2.0-java/lib/pry-debugger-jruby/processor.rb:17)
at RUBY.start_with_pry_debugger(/Users/gslzwol/.rvm/gems/jruby-9.0.5.0@zomg-red-conspiracy/gems/pry-debugger-jruby-1.2.0-java/lib/pry-debugger-jruby/pry_ext.rb:14)
at RUBY.pry(/Users/gslzwol/.rvm/gems/jruby-9.0.5.0@zomg-red-conspiracy/gems/pry-0.10.4/lib/pry/core_extensions.rb:43)
at RUBY.create(/Users/gslzwol/stuffs/zomg-owh/src/zredc.rb:10)
=end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.