<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/-ext-/debug, branch v4.0.4</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>YJIT: Split the block on optimized getlocal/setlocal (#13282)</title>
<updated>2025-05-12T16:03:46+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-05-12T16:03:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=53a27f114afafcdfea1a6066d01c12e4dc295657'/>
<id>53a27f114afafcdfea1a6066d01c12e4dc295657</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: End the block after OPTIMIZE_METHOD_TYPE_CALL (#13245)</title>
<updated>2025-05-05T20:35:28+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-05-05T20:35:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=cbf9c088f8005a49b6aa3f475c70041357774c61'/>
<id>cbf9c088f8005a49b6aa3f475c70041357774c61</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Move Array#map to Ruby</title>
<updated>2024-11-13T20:27:26+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-11-13T04:47:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=01db456196e17eb067f70eb1d4fceba143a51c01'/>
<id>01db456196e17eb067f70eb1d4fceba143a51c01</id>
<content type='text'>
Co-Authored-By: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-Authored-By: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Show the method owner in backtraces</title>
<updated>2024-02-15T10:11:58+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2024-02-15T05:23:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9d1b000bd1bb747bcc49e2d7677fb7c2b31c5a94'/>
<id>9d1b000bd1bb747bcc49e2d7677fb7c2b31c5a94</id>
<content type='text'>
```
test.rb:1:in 'Object#toplevel_meth': unhandled exception
        from test.rb:4:in 'Foo.class_meth'
        from test.rb:6:in 'Foo#instance_meth'
        from test.rb:11:in 'singleton_meth'
        from test.rb:13:in '&lt;main&gt;'
```

[Feature #19117]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
```
test.rb:1:in 'Object#toplevel_meth': unhandled exception
        from test.rb:4:in 'Foo.class_meth'
        from test.rb:6:in 'Foo#instance_meth'
        from test.rb:11:in 'singleton_meth'
        from test.rb:13:in '&lt;main&gt;'
```

[Feature #19117]
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix use of the rb_profile_frames start parameter</title>
<updated>2023-12-28T16:58:21+00:00</updated>
<author>
<name>Dylan Thacker-Smith</name>
<email>Dylan.Smith@shopify.com</email>
</author>
<published>2019-09-27T05:10:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2b96737636e1c96fedda83895ef32e19a914e310'/>
<id>2b96737636e1c96fedda83895ef32e19a914e310</id>
<content type='text'>
Previously, it was decrementing the start argument until it reached
zero without actually changing the control frame pointer.

[Bug #14607]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, it was decrementing the start argument until it reached
zero without actually changing the control frame pointer.

[Bug #14607]
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix thread leakage</title>
<updated>2023-11-03T00:32:32+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-11-03T00:32:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8b02de8f41296d1a2449ecaeb24726f088ce899c'/>
<id>8b02de8f41296d1a2449ecaeb24726f088ce899c</id>
<content type='text'>
Wait for the worker thread to finish.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Wait for the worker thread to finish.
</pre>
</div>
</content>
</entry>
<entry>
<title>[Feature #10602] Add new API rb_profile_thread_frames()</title>
<updated>2023-10-31T02:16:18+00:00</updated>
<author>
<name>Daisuke Aritomo</name>
<email>osyoyu@osyoyu.com</email>
</author>
<published>2023-09-29T06:35:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4adf418be963b3554962b2f27057be81486c57d9'/>
<id>4adf418be963b3554962b2f27057be81486c57d9</id>
<content type='text'>
Add a new API rb_profile_thread_frames(), which is essentialy a
per-thread version of rb_profile_frames().

While the original rb_profile_frames() always returns results about the
current active thread obtained by GET_EC(), this new API takes a Thread
to be profiled as an argument.

This should come in handy when profiling I/O-bound programs such as
webapps, since this new API allows us to learn about Threads performing
I/O (which do not have the GVL).

Profiling worker threads (such as Sidekiq workers) may be another
application.

Implements [Feature #10602]

Co-authored-by: Mike Perham &lt;mike@perham.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a new API rb_profile_thread_frames(), which is essentialy a
per-thread version of rb_profile_frames().

While the original rb_profile_frames() always returns results about the
current active thread obtained by GET_EC(), this new API takes a Thread
to be profiled as an argument.

This should come in handy when profiling I/O-bound programs such as
webapps, since this new API allows us to learn about Threads performing
I/O (which do not have the GVL).

Profiling worker threads (such as Sidekiq workers) may be another
application.

Implements [Feature #10602]

Co-authored-by: Mike Perham &lt;mike@perham.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Show backtraces when failed</title>
<updated>2023-10-18T09:10:24+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2023-10-18T01:28:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=46b8846b5c40cf4053f678dae1684f1c6eb52673'/>
<id>46b8846b5c40cf4053f678dae1684f1c6eb52673</id>
<content type='text'>
If `assert_equal(backtrace_locations.size, profile_frames.size)` in
`TestProfileFrames#test_matches_backtrace_locations_main_thread`
failed, we do not have enough information about it like that:

```
    1) Failure:
  TestProfileFrames#test_matches_backtrace_locations_main_thread [/home/runner/work/ruby/ruby/src/test/-ext-/debug/test_profile_frames.rb:148]:
  &lt;31&gt; expected but was
  &lt;30&gt;.
```

This patch shows both `backtrace_locations` and `profile_frames`
if failed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If `assert_equal(backtrace_locations.size, profile_frames.size)` in
`TestProfileFrames#test_matches_backtrace_locations_main_thread`
failed, we do not have enough information about it like that:

```
    1) Failure:
  TestProfileFrames#test_matches_backtrace_locations_main_thread [/home/runner/work/ruby/ruby/src/test/-ext-/debug/test_profile_frames.rb:148]:
  &lt;31&gt; expected but was
  &lt;30&gt;.
```

This patch shows both `backtrace_locations` and `profile_frames`
if failed.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use the caller location as default filename for eval family of methods</title>
<updated>2023-07-24T12:51:20+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>byroot@ruby-lang.org</email>
</author>
<published>2023-07-13T09:49:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=43a5c191358699fe8b19314763998cb8ca77ed90'/>
<id>43a5c191358699fe8b19314763998cb8ca77ed90</id>
<content type='text'>
[Feature #19755]

Before (in /tmp/test.rb):

```ruby
Object.class_eval("p __FILE__") # =&gt; "(eval)"
```

After:

```ruby
Object.class_eval("p __FILE__") # =&gt; "(eval at /tmp/test.rb:1)"
```

This makes it much easier to track down generated code in case
the author forgot to provide a filename argument.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Feature #19755]

Before (in /tmp/test.rb):

```ruby
Object.class_eval("p __FILE__") # =&gt; "(eval)"
```

After:

```ruby
Object.class_eval("p __FILE__") # =&gt; "(eval at /tmp/test.rb:1)"
```

This makes it much easier to track down generated code in case
the author forgot to provide a filename argument.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix `rb_profile_frames` output includes dummy main thread frame</title>
<updated>2022-07-26T01:43:44+00:00</updated>
<author>
<name>Ivo Anjo</name>
<email>ivo.anjo@datadoghq.com</email>
</author>
<published>2022-07-11T13:51:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=649bfbe00d8032fa2c0536e596a284f69926e87f'/>
<id>649bfbe00d8032fa2c0536e596a284f69926e87f</id>
<content type='text'>
The `rb_profile_frames` API did not skip the two dummy frames that
each thread has at its beginning. This was unlike `backtrace_each` and
`rb_ec_parcial_backtrace_object`, which do skip them.

This does not seem to be a problem for non-main thread frames,
because both `VM_FRAME_RUBYFRAME_P(cfp)` and
`rb_vm_frame_method_entry(cfp)` are NULL for them.

BUT, on the main thread `VM_FRAME_RUBYFRAME_P(cfp)` was true
and thus the dummy thread was still included in the output of
`rb_profile_frames`.

I've now made `rb_profile_frames` skip this extra frame (like
`backtrace_each` and friends), as well as add a test that asserts
the size and contents of `rb_profile_frames`.

Fixes [Bug #18907] (&lt;https://bugs.ruby-lang.org/issues/18907&gt;)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The `rb_profile_frames` API did not skip the two dummy frames that
each thread has at its beginning. This was unlike `backtrace_each` and
`rb_ec_parcial_backtrace_object`, which do skip them.

This does not seem to be a problem for non-main thread frames,
because both `VM_FRAME_RUBYFRAME_P(cfp)` and
`rb_vm_frame_method_entry(cfp)` are NULL for them.

BUT, on the main thread `VM_FRAME_RUBYFRAME_P(cfp)` was true
and thus the dummy thread was still included in the output of
`rb_profile_frames`.

I've now made `rb_profile_frames` skip this extra frame (like
`backtrace_each` and friends), as well as add a test that asserts
the size and contents of `rb_profile_frames`.

Fixes [Bug #18907] (&lt;https://bugs.ruby-lang.org/issues/18907&gt;)
</pre>
</div>
</content>
</entry>
</feed>
