Skip to content

Commit df7be7e

Browse files
committed
Add Thread::Backtrace.limit method
1 parent 7cbac45 commit df7be7e

File tree

4 files changed

+48
-50
lines changed

4 files changed

+48
-50
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ Compatibility:
9292
* Add `Process._fork` (#2733, @horakivo).
9393
* Update to JCodings 1.0.58 and Joni 2.1.44 (@eregon).
9494
* Add `MatchData#match` and `MatchData#match_length` (#2733, @horakivo).
95+
* Add `Thread::Backtrace.limit` method (#2733, @andrykonchin).
9596

9697
Performance:
9798

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
slow:Thread::Backtrace.limit returns maximum backtrace length set by --backtrace-limit command-line option
22
slow:Thread::Backtrace.limit returns -1 when --backtrace-limit command-line option is not set
3-
fails:Thread::Backtrace.limit returns maximum backtrace length set by --backtrace-limit command-line option
4-
fails:Thread::Backtrace.limit returns -1 when --backtrace-limit command-line option is not set

src/main/ruby/truffleruby/core/thread.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,12 @@ def list
331331

332332
Primitive.thread_set_group Thread.current, ThreadGroup::Default
333333

334+
class Thread::Backtrace
335+
def self.limit
336+
Primitive.exception_backtrace_limit
337+
end
338+
end
339+
334340
class Thread::Backtrace::Location
335341
def inspect
336342
to_s.inspect

test/mri/excludes/TestRubyOptions.rb

Lines changed: 41 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,41 @@
1-
exclude :test_autosplit, "needs investigation"
2-
exclude :test_chdir, "needs investigation"
3-
exclude :test_copyright, "needs investigation"
4-
exclude :test_debug, "needs investigation"
5-
exclude :test_dump_insns_with_rflag, "needs investigation"
6-
exclude :test_dump_parsetree_with_rflag, "needs investigation"
7-
exclude :test_dump_syntax_with_rflag, "needs investigation"
8-
exclude :test_dump_yydebug_with_rflag, "needs investigation"
9-
exclude :test_encoding, "needs investigation"
10-
exclude :test_eval, "needs investigation"
11-
exclude :test_frozen_string_literal_debug, "needs investigation"
12-
exclude :test_indentation_check, "needs investigation"
13-
exclude :test_invalid_option, "needs investigation"
14-
exclude :test_kanji, "needs investigation"
15-
exclude :test_notfound, "needs investigation"
16-
exclude :test_option_variables, "needs investigation"
17-
exclude :test_pflag_gsub, "needs investigation"
18-
exclude :test_pflag_sub, "needs investigation"
19-
exclude :test_program_name, "needs investigation"
20-
exclude :test_require, "needs investigation"
21-
exclude :test_rubyopt, "needs investigation"
22-
exclude :test_safe_level, "needs investigation"
23-
exclude :test_script_is_directory, "needs investigation"
24-
exclude :test_search, "needs investigation"
25-
exclude :test_separator, "needs investigation"
26-
exclude :test_set_program_name, "needs investigation"
27-
exclude :test_set_program_name, "needs investigation"
28-
exclude :test_setproctitle, "needs investigation"
29-
exclude :test_setproctitle, "needs investigation"
30-
exclude :test_sflag, "needs investigation"
31-
exclude :test_shadowing_variable, "needs investigation"
32-
exclude :test_shebang, "needs investigation"
33-
exclude :test_unused_variable, "needs investigation"
34-
exclude :test_usage_long, "needs investigation"
35-
exclude :test_verbose, "needs investigation"
36-
exclude :test_version, "needs investigation"
37-
exclude :test_yydebug, "needs investigation"
38-
exclude :test_segv_loaded_features, "needs investigation"
39-
exclude :test_segv_setproctitle, "needs investigation"
40-
exclude :test_segv_test, "needs investigation"
41-
exclude :test_assignment_in_conditional, "needs investigation"
42-
exclude :test_cwd_encoding, "needs investigation"
43-
exclude :test_disable, "needs investigation"
44-
exclude :test_flag_in_shebang, "needs investigation"
45-
exclude :test_frozen_string_literal, "needs investigation"
46-
exclude :test_jit_debug, "needs investigation"
47-
exclude :test_warning, "needs investigation"
48-
exclude :test_backtrace_limit, "pid 285721 exit 1"
1+
exclude :test_script_is_directory, "[ruby-core:26925]"
2+
exclude :test_dump_yydebug_with_rflag, "pid 86142 exit 1"
3+
exclude :test_version, "Expected /^ruby 3\\.1\\.3(?:[p ]|dev|rc).*? \\[x86_64\\-darwin21\\]$/ to match \"truffleruby 23.0.0-dev-82f5ec31*, like ruby 3.1.3, Interpreted JVM [x86_64-darwin]\"."
4+
exclude :test_eval, "pid 86149 exit 1"
5+
exclude :test_backtrace_limit, "pid 86150 exit 1"
6+
exclude :test_dump_parsetree_with_rflag, "pid 86151 exit 1"
7+
exclude :test_invalid_option, "pid 86153 exit 2"
8+
exclude :test_pflag_gsub, "[ruby-core:47967]"
9+
exclude :test_rubyopt, "<\"\\\"\\\"\"> expected but was"
10+
exclude :test_frozen_string_literal, ""
11+
exclude :test_kanji, "pid 86216 exit 0."
12+
exclude :test_autosplit, "pid 86218 exit 1"
13+
exclude :test_option_variables, "<[\"[true, true, true]\","
14+
exclude :test_separator, "pid 86222 exit 1"
15+
exclude :test_cwd_encoding, "pid 86223 exit 1"
16+
exclude :test_chdir, "pid 86224 exit 1"
17+
exclude :test_indentation_check, ""
18+
exclude :test_disable, "pid 86382 exit 0."
19+
exclude :test_flag_in_shebang, "pid 86383 exit 0."
20+
exclude :test_assignment_in_conditional, "[ruby-dev:39363]"
21+
exclude :test_dump_insns_with_rflag, "pid 86385 exit 1"
22+
exclude :test___dir__encoding, "the encoding of __FILE__ and __dir__ should be same."
23+
exclude :test_require, "pid 86390 exit 1"
24+
exclude :test_encoding, "pid 86392 exit 1"
25+
exclude :test_pflag_sub, "[ruby-core:47967]"
26+
exclude :test_unused_variable, "[ruby-dev:41620]"
27+
exclude :test_setproctitle, "ArgumentError expected but nothing was raised."
28+
exclude :test_sflag, "pid 86399 exit 0."
29+
exclude :test_usage_long, "<[]> expected but was"
30+
exclude :test_yydebug, "<[]> expected to be != to"
31+
exclude :test_copyright, "pid 86402 exit 0."
32+
exclude :test_shebang, "pid 86406 exit 0."
33+
exclude :test_program_name, "<\"-\"> expected but was"
34+
exclude :test_frozen_string_literal_debug, "[\"--disable=gems\", \"--enable-frozen-string-literal\", \"--debug-frozen-string-literal\"] \"foo\" << \"bar\""
35+
exclude :test_verbose, "Expected /^ruby 3\\.1\\.3(?:[p ]|dev|rc).*? \\[x86_64\\-darwin21\\]$/ to match \"truffleruby 23.0.0-dev-82f5ec31*, like ruby 3.1.3, Interpreted JVM [x86_64-darwin]\"."
36+
exclude :test_warning, "pid 86422 exit 0."
37+
exclude :test_notfound, "[ruby-core:23717]"
38+
exclude :test_dump_syntax_with_rflag, "pid 86428 exit 1"
39+
exclude :test_segv_test, "ArgumentError: unknown exec option: :rlimit_core"
40+
exclude :test_segv_setproctitle, "ArgumentError: unknown exec option: :rlimit_core"
41+
exclude :test_segv_loaded_features, "ArgumentError: unknown exec option: :rlimit_core"

0 commit comments

Comments
 (0)