summaryrefslogtreecommitdiff
path: root/test/ruby/test_backtrace.rb
AgeCommit message (Collapse)Author
2019-03-21Fix a wrong lineno in backtrace for cfuncmame
lineno is an int, and INT2FIX(0) was assigned. [Bug #15719] [ruby-core:91911] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-28Revert "Add test for cause on pty"naruse
This reverts commit r65422. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-28Add test for cause on ptynaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-27fix testnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-27Print exception's cause like Javanaruse
Print `cause` of the exception if the exception is not caught and printed its backtraces and error message [Feature #8257] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-08Remove unnecessary `require 'thread'`kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-30Use qualified namesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-19test/ruby: suppress parser warningsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16Add frozen_string_literal: false for all filesnaruse
When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-05* proc.c: enable optimization of Proc#call.ko1
[Feature #11569] * NEWS: write about this optimization and incompatibilities. * test/ruby/test_backtrace.rb: catch up this fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-01test_backtrace.rb: add testsnobu
* test/ruby/test_backtrace.rb (test_caller_locations_base_label): test for Thread::Backtrace::Location#base_label. * test/ruby/test_backtrace.rb (test_caller_locations_label): test for Thread::Backtrace::Location#label. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-31test_backtrace.rb: add testnobu
* test/ruby/test_backtrace.rb (test_caller_locations_lineno): test for Thread::Backtrace::Location#lineno. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-31test_backtrace.rb: split testnobu
* test/ruby/test_backtrace.rb (test_caller_locations_absolute_path): split from test_caller_locations_path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-31test_backtrace.rb: add testnobu
* test/ruby/test_backtrace.rb (test_caller_locations_path): test for Thread::Backtrace::Location#path and #absolute_path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-26test/ruby: fix leaked threadsnobu
* test/thread/test_backtrace.rb: join work threads not to leak threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-26test/ruby: fix leaked threadsnobu
* test/thread/test_{backtrace,beginendblock,proc,threadgroup}.rb: join work threads not to leak threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-21vm.c: rewind cfpnobu
* vm.c (m_core_hash_{from_ary,merge_{ary,ptr,kwd}}): rewind cfp to show proper backtrace. [ruby-dev:35820] [Bug #416] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-21test_backtrace.rb: r18554 testsnobu
* test/ruby/test_backtrace.rb (test_core_backtrace_{alias,undef}): add tests for r18554. [ruby-dev:35820] [Bug #416] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-02* test/ruby/test_backtrace.rb: get rid of warnings. unused variable,usa
shadowing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-25* vm_insnhelper.c (argument_error): insert dummy frame to makeko1
a backtrace object intead of modify backtrace string array. [Bug #9295] * test/ruby/test_backtrace.rb: add a test for this patch. fix test to compare a result of Exception#backtrace with a result of Exception#backtrace_locations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13* error.c: add Exception#backtrace_locations.ko1
Now, there are no setter and independent from Exception#backtrace. [Feature #8960] * eval.c (setup_exception): set backtrace locations for `bt_location' special attribute. * vm_backtrace.c (rb_backtrace_to_location_ary): added. * internal.h: ditto. * test/ruby/test_backtrace.rb: add a test for Exception#backtrace_locations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-11revert r44133. See https://bugs.ruby-lang.org/issues/8886 detailsko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-11* eval.c (rb_raise_jump): pop frame after setup exception.ko1
Patches by deivid (David Rodriguez). [Bug #8886] * test/minitest/test_minitest_unit.rb: catch up this change. * test/ruby/test_backtrace.rb: ditto. * test/ruby/test_settracefunc.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-10* vm_backtrace.c (vm_backtrace_to_ary): Ignore the second argument ifsorah
it is nil. [Bug #8884] [ruby-core:57094] * test/ruby/test_backtrace.rb (test_caller_with_nil_length): Test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-23test_backtrace.rb: test Thread#backtrace_locations with rangezzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-31* test/ruby/test_backtrace.rb: Add test for r37957 [Feature #7434]zzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-01* test/ruby/test_backtrace.rb: add a test forko1
Thread::Backtrace::Location#inspect. BTW, tests for `caller_locations' are not enough. Any volunteers are welcome. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-19* thread.c: add `Thread#backtrace_locations' method.ko1
This method is similart to `caller_locations' method for specific method. And fix to accept `level' and `n' parameters for `Thread#backtrace' and `Thread#backtrace_locations'. `caller' (and `caller_locations') do not return `caller' method frame. However, `Thread#backtrace' (and `Thread#backtrace_locations') return `Thread#backtrace' method frame itself if `Thread.current.backtrace' was called. * vm_backtrace.c: ditto. * internal.h: ditto. * test/ruby/test_backtrace.rb: add tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22* test/ruby/test_backtrace.rb: decrease recursion depthko1
to reduce consuming stack size. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-04* test/ruby/test_backtrace.rb: fix test.ko1
Windows path includes `:' character. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-02* vm_backtrace.c: change names.ko1
(1) Class name: RubyVM::FrameInfo -> RubyVM::Backtrace::Location. (2) Method name: RubyVM::FrameInfo.caller -> Kernel.caller_locations. (3) Instance methods of RubyVM::FrameInfo (RubyVM::Backtrace::Location) (3-1) name -> label (3-2) basename -> base_label (basename is confusing with File.basename) (3-3) line_no -> lineno (We have already similar name File#lineno, commented by kou [ruby-dev:45686]). (3-4) filename -> path. (3-5) filepath -> absolute_path. (3-5) iseq -> removed (we will make other APIs to access iseq and other information of frame for debugging). * test/ruby/test_backtrace.rb: apply above changes. And apply comment from kou [ruby-dev:45686]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-26* test/ruby/test_backtrace.rb (test_caller_lev):ko1
decreaze recursion size. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-26* vm.c (RubyVM::FrameInfo): add a class to access each frameko1
information. You don't need to parse strings from caller(). FrameInfo has the following methods: FrameInfo#name: method name, class name, etc with decorations. FrameInfo#basename: name without decorations. FrameInfo#line_no: line number. FrameInfo#filename: file name. FrameInfo#filepath: full filepath. FrameInfo#iseq: iseq if it is iseq frame (defined by ruby script) FrameInfo#to_s: return caller() method style string. RubyVM::FrameInfoFrameInfo.caller(n, lev) returns array of FrameInfo objects. The name "RubyVM::FrameInfoFrameInfo.caller" is long and ambiguous (same as caller() method), we need to change the name before Ruby 2.0 release. Good names or comments are welcome. * test/ruby/test_backtrace.rb: add a test for above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-25* vm_eval.c (rb_f_caller): caller() method accepts second optionalko1
argument `n' which specify how many frames should return. For example, `caller(0, 1)' returns only one frame information which calls caller() method. If there are less than n frame information, then all frame information are returned. If n is 0, then always return []. This fix is part of [ruby-dev:42345] [Ruby 1.9-Feature#3917]. However, performance and features are not enough. RDoc is also not available. * test/ruby/test_backtrace.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-25* properties.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-25* vm.c: refactoring backtrace related funcitons.ko1
(1) unify similar functions (rb_backtrace_each() and backtrace_object()). backtrace_each() is a unified function. variation: a) backtrace_object(): create backtrace object. b) vm_backtrace_str_ary(): create bt as an array of string. c) vm_backtrace_print(): print backtrace to specified file. d) rb_backtrace_print_as_bugreport(): print backtrace on bugreport style. (2) remove rb_backtrace_each(). Use backtrace_each() instead. (3) chang the type of lev parameter to size_t. a) lev == 0 means current frame (exception, etc use it). b) lev == 1 means upper frame (caller(0) use it). * vm_core.h, vm_dump.c, vm_eval.c: ditto. * vm.c (backtrace_object(), vm_backtrace_str_ary()): fix to return a correct size of caller(lev) array. Let n be a "caller(0).size" then ln as caller(lev).size should be (n - lev). However, the previous implementation returns a wrong size array (ln > n - lev). [ruby-dev:45673] * test/ruby/test_backtrace.rb: add tests for backtrace. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e