ruby-changes:60481
From: Yusuke <ko1@a...>
Date: Mon, 23 Mar 2020 10:55:40 +0900 (JST)
Subject: [ruby-changes:60481] 1d996fe72f (master): test/ruby/test_m17n.rb: Update the debugging code to get C stacktrace
https://git.ruby-lang.org/ruby.git/commit/?id=1d996fe72f From 1d996fe72fc20fbc88f07b4b8d34b99aacc688f3 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh <mame@r...> Date: Mon, 23 Mar 2020 10:54:44 +0900 Subject: test/ruby/test_m17n.rb: Update the debugging code to get C stacktrace diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb index 321a356..fee3835 100644 --- a/test/ruby/test_m17n.rb +++ b/test/ruby/test_m17n.rb @@ -315,28 +315,9 @@ class TestM17N < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_m17n.rb#L315 begin "abc".encode(Encoding.default_external) rescue Encoding::CompatibilityError - $stderr.puts :debug_1.inspect - $stderr.puts $!.inspect - $stderr.puts *$!.backtrace - $stderr.puts "abc".encoding.inspect - $stderr.puts Encoding.default_external.inspect - end - begin - [o].inspect - rescue Encoding::CompatibilityError - $stderr.puts :debug_2.inspect - $stderr.puts $!.inspect - $stderr.puts *$!.backtrace - $stderr.puts "abc".encoding.inspect - $stderr.puts Encoding.default_external.inspect - begin - $stderr.puts o.inspect.inspect - $stderr.puts :debug_3.inspect - rescue Encoding::CompatibilityError - $stderr.puts :debug_4.inspect - $stderr.puts $!.inspect - $stderr.puts *$!.backtrace - end + TracePoint.new(:raise) do |tp| + Process.kill(:SEGV, $$) + end.enable { "abc".encode(Encoding.default_external) } end # debugging code end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/