1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test/ruby/test_m17n.rb: Update the debugging code to get C stacktrace

This commit is contained in:
Yusuke Endoh 2020-03-23 10:54:44 +09:00
parent c4e3d9e953
commit 1d996fe72f

View file

@ -315,28 +315,9 @@ class TestM17N < Test::Unit::TestCase
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