Skip to content

Commit

Permalink
Update thread dump hook for modern JRuby
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Jan 15, 2025
1 parent 01d88c3 commit b239e32
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions lib/ruby/stdlib/jruby/thread_dump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,14 @@
$stderr.puts "* Thread: #{thread_r.native_thread.name}"
$stderr.puts "* Stack:"

thread_r = JRuby.reference(thread)
thread_context = thread_r.context

unless thread_context
$stderr.puts " [dead]\n"
next
end

ex = RuntimeError.new('thread dump')
ex_r = JRuby.reference(ex)

gather = trace_type::Gather::NORMAL
format = trace_type::Format::JRUBY

ex_r.backtrace_data = gather.get_backtrace_data(thread_context, thread_r.native_thread.stack_trace, true)
$stderr.puts format.print_backtrace(ex, false)
$stderr.puts thread.backtrace

$stderr.puts
end
Expand Down

0 comments on commit b239e32

Please sign in to comment.