455 Commits
Author SHA1 Message Date
Hiroshi SHIBATAandClaude Opus 5.5 9f323525f8 Fix error paths of lldb rbbt
Without an argument, or with an expression that failed to evaluate, rbbt raised a Python exception instead of reporting the problem. Evaluating without a process referred to an undefined `target` as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 07:36:48 +09:00
Hiroshi SHIBATAandClaude Opus 5.5 321a6665d1 Test rbbt on ZJIT frames
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 07:36:48 +09:00
Hiroshi SHIBATAandClaude Opus 5.5 901acf5600 Test rbbt in test_lldb_cruby.rb
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 07:36:48 +09:00
Hiroshi SHIBATAandClaude Opus 5.5 9dd04cb1f8 Update rp expectations in test_lldb_cruby.rb
rp has long printed the GC bits of a heap object before its type, and every string as a `const char` array since e078352a78, so three of the four tests were failing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 07:36:48 +09:00
Hiroshi SHIBATAandClaude Opus 5.5 f0ee6a3a9d Read ZJIT frames in lldb rbbt as CFP_ISEQ does
ZJIT does not write `_iseq` and `pc` of its frames until they are materialized, so rbbt dropped them or printed stale ones. Read the JIT frame instead when ZJIT is enabled, as CFP_ISEQ() and CFP_PC() do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 07:36:48 +09:00
Hiroshi SHIBATAandClaude Opus 5.5 a482d0cb69 Read iseq strings in lldb rbbt through the target
A core saved with `process save-core -s modified-memory` lacks static strings such as `<main>`, which SBProcess cannot read, so rbbt printed `error!!` as the label. SBTarget falls back to the object file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 07:36:48 +09:00
Hiroshi SHIBATAandClaude Opus 5.5 62f61596f0 Follow the cfp->_iseq rename in lldb rbbt
226f37059e renamed the field, so `->iseq` no longer resolved and rbbt skipped every ISEQ frame, printing only CFUNC ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 07:36:48 +09:00
Hiroshi SHIBATAandClaude Opus 5.5 b4bc7bc702 misc/gdb.py: Fix the swapped Params and Locals conditions
cfp printed Params only when the frame had locals and Locals only when it had params, so a method with arguments and no locals showed an empty Locals instead of its arguments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 07:16:36 +09:00
Hiroshi SHIBATAandClaude Opus 5.5 e8b378affa misc/gdb.py: Compute the base pointer without calling vm_base_ptr
gdb cannot call functions on a core file, so cfp stopped at its first Env line there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 07:16:36 +09:00
Hiroshi SHIBATAandClaude Opus 5.5 1a5a8c761d misc/gdb.py: Read the frame iseq through cfp_iseq_pc
The cfp command still read cfp->iseq, which 226f37059e renamed to _iseq, so it stopped with "There is no member named iseq." on every frame. cfp_iseq_pc in .gdbinit also gives the right iseq for ZJIT frames.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 07:16:36 +09:00
Peter Zhu 1d8d84b3d6 Increase IMEMO_MASK by one bit
We are out of imemo types because IMEMO_MASK uses 4 bits and we have 16
imemo types. This makes it not possible to experiment with new imemo types,
so we can increase it by one bit to have 16 more imemo types.
2026-09-03 08:38:46 +09:00
Takashi Kokubun 17da26ee1c ZJIT: Rewrite jit_perf script in Ruby (#17474) 2026-06-25 17:50:46 -07:00
Nobuyoshi Nakada 2683a37669 T_DATA is always struct RTypedData now 2026-05-28 19:29:32 +09:00
Takashi Kokubun 8a5fc14f7e ZJIT: Allow --zjit-perf to dump perf symbols for HIR (#16501) 2026-03-23 13:14:07 -07:00
Takashi Kokubun 8003f48be7 yjit_perf.py: Generalize the script for ZJIT 2026-03-19 10:19:33 -07:00
Takashi Kokubun ea5aae06fd yjit_perf.py: Fix the script for the latest perf format 2026-03-19 10:19:33 -07:00
Nobuyoshi Nakada dddb651118 Compare the canonical type name [ci skip]
Members of node types are defined using the canonical types, instead
of the typedef names.
2026-01-30 21:08:57 +09:00
Nobuyoshi Nakada a797561e25 Update Typed Data dump on debuggers [ci skip] 2026-01-16 16:47:34 +09:00
Takashi Kokubun 4f8478f50c misc/.vscode/settings.json: Fix rust-analyzer warnings 2026-01-13 15:27:45 -08:00
John Hawthorn 7f25b8f5fb Disable TSAN for rb_gc_mark_machine_context
Previously this was listed as a suppression, but we actually want this
permanently unsanitized. This should be faster and more reliable since
TASN won't have to match against symbolicated backtraces.
2025-07-24 16:35:42 -07:00
John Hawthorn 3ad2019259 Extract vm_locked_by_ractor_p
This introduces a new method to encapsulate checking whether the current
Ractor owns the vm->ractor.sync lock. This allows us to disable TSan on
it since that operation should be safe, and still get validation of
other uses.
2025-07-24 16:35:20 -07:00
John Hawthorn 41ec0f5b97 Update misc/tsan_suppressions.txt
* Add gc_enable/disable to TSAN suppressions
* Remove deleted methods from tsan suppressions
* Remove TSAN errors we've fixed
* Add another two inline cache suppressions
* Improve comments
2025-07-22 09:37:13 -07:00
Hiroshi SHIBATA 0ce4b43ebf Update default gems and bundled gems list at expand_tabs.rb 2025-07-04 13:14:45 +09:00
Hiroshi SHIBATA 9503a77da2 DRb has been extracted as bundled gems 2025-07-04 13:01:39 +09:00
Nobuyoshi Nakada 2eb5ee8aad Remove unnecessary shebang and excutable bits [ci skip] 2025-06-19 19:49:01 +09:00
Jean Boussier 15084fbc3c Get rid of FL_EXIVAR
Now that the shape_id gives us all the same information, it's no
longer needed.
2025-06-13 23:50:30 +02:00
John Hawthorn 7854b71e7f Supress a few more tsan errors 2025-06-11 18:11:36 -07:00
John Hawthorn 84bfcaa80d Add two more TSan suppressions 2025-05-20 09:56:31 -07:00
John Hawthorn e7f97eb2f3 Use atomic load for signal buff size 2025-05-20 09:56:31 -07:00
John Hawthorn 05e0e7223a Use atomic load to read interrupt mask 2025-05-20 09:56:31 -07:00
John Hawthorn d67d169aea Use atomics for system_working global
Although it almost certainly works in this case, volatile is best not
used for multi-threaded code. Using atomics instead avoids warnings from
TSan.

This also simplifies some logic, as system_working was previously only
ever assigned to 1, so --system_working <= 0 should always return true
(unless it underflowed).
2025-05-15 15:18:10 -07:00
John Hawthorn 86f5cec782 Add misc/tsan_suppressions.txt 2025-05-13 20:09:30 -07:00
Étienne Barrié e1f544c1cf Always look for the top-level RBasic in LLDB scripts
`rp` and other commands were broken for me because they always showed
the object as a T_NONE.

The reason was that instead of returning the type `struct RBasic`,
FindFirstType("struct RBasic") was returning
`yjit::cruby::autogened::RBasic`.

Explicitly asking for the top-level RBasic by prefixing it with `::` is
enough to fix those commands.
2025-04-15 11:50:48 +09:00
Étienne Barrié 6e184ebb5a Fix LLDB heap_page command
Move _append_command_output and _append_expression to LLDBInterface, and
use it from HeapPageCommand after setting result.
2025-04-15 11:50:48 +09:00
Eileen 5aa05f179c Fix lldb debug scripts (#13048)
In ruby/ruby#13008 `RVALUE` was removed without replacement. This means
the lldb scripts that relied on `RVALUE` stopped working.

I updated the ones that were using it just for the bytesize to use
`slot_size` and then round to the nearest power of 40. We can't use
`slot_size` directly because in debug mode it's `48` but `RVALUE` is
`40` bytes.

For the `as_type` method, I updated it to check the type. It's only used
for `bignum` and `array` so that's a simple change.

Lastly, for the `dump_page` method I replaced it with `struct free_slot`
since that's looking at the freelist.

`struct RVALUE` has been removed from all the scripts and I verified
that `rp` is fixed. I'm not confident the `dump_page` method is fixed,
the freelist looks off, but for now this gets us closer.
2025-04-08 12:52:49 -04:00
Étienne Barrié 332f5d0b73 Remove RUBY_FL_PROMOTED{0,1} from debugger scripts
These flags were removed in d426343418 and
print_flags is broken because of it.
2025-03-28 17:36:24 +01:00
Takashi Kokubun e9e4770a18 Fix .vscode/settings.json for the latest extension 2025-02-12 16:17:08 -08:00
Nobuyoshi Nakada 5a18956430 ruby-style.el: Minimize backslash columns [ci skip]
Basically we don't align line continuation backslashes.
2024-10-17 19:34:31 +09:00
Matt Valentine-House 8e7df4b7c6 Rename size_pool -> heap
Now that we've inlined the eden_heap into the size_pool, we should
rename the size_pool to heap. So that Ruby contains multiple heaps, with
different sized objects.

The term heap as a collection of memory pages is more in memory
management nomenclature, whereas size_pool was a name chosen out of
necessity during the development of the Variable Width Allocation
features of Ruby.

The concept of size pools was introduced in order to facilitate
different sized objects (other than the default 40 bytes). They wrapped
the eden heap and the tomb heap, and some related state, and provided a
reasonably simple way of duplicating all related concerns, to provide
multiple pools that all shared the same structure but held different
objects.

Since then various changes have happend in Ruby's memory layout:

* The concept of tomb heaps has been replaced by a global free pages list,
  with each page having it's slot size reconfigured at the point when it
  is resurrected
* the eden heap has been inlined into the size pool itself, so that now
  the size pool directly controls the free_pages list, the sweeping
  page, the compaction cursor and the other state that was previously
  being managed by the eden heap.

Now that there is no need for a heap wrapper, we should refer to the
collection of pages containing Ruby objects as a heap again rather than
a size pool
2024-10-03 21:20:09 +01:00
Nobuyoshi Nakada 7836626f92 Add c-style for prism [ci skip] 2024-09-20 22:50:27 +09:00
Nobuyoshi Nakada cedc7737b6 Make interchangeable NODE types aliases 2024-06-02 09:43:33 +09:00
Nobuyoshi Nakada 43798e0f6d lldb: Show coderange 2024-05-28 16:23:18 +09:00
Nobuyoshi Nakada d076101af9 Fix dump of NODE [ci skip] 2024-05-16 21:25:52 +09:00
yui-knk f057741c5d NODE_LIT is not used anymore 2024-04-04 13:17:26 +09:00
Nobuyoshi Nakada e720a6b485 Show the chilled status of a String [ci skip] 2024-03-25 14:33:20 +09:00
Takashi Kokubun b0be2961f7 YJIT: Let yjit_perf.py support perf with Python disabled (#10246)
* YJIT: Let yjit_perf.py support perf with Python disabled

* Update yjit.md about perf

* Recommend the extra interface by default
2024-03-14 10:08:23 -07:00
yui-knk e7ab5d891c Introduce NODE_REGX to manage regexp literal 2024-02-21 08:06:48 +09:00
yui-knk 89cfc15207 [Feature #20257] Rearchitect Ripper
Introduce another semantic value stack for Ripper so that
Ripper can manage both Node and Ruby Object separately.
This rearchitectutre of Ripper solves these issues.
Therefore adding test cases for them.

* [Bug 10436] https://bugs.ruby-lang.org/issues/10436
* [Bug 18988] https://bugs.ruby-lang.org/issues/18988
* [Bug 20055] https://bugs.ruby-lang.org/issues/20055

Checked the differences of `Ripper.sexp` for files under `/test/ruby`
are only on test_pattern_matching.rb.
The differences comes from the differences between
`new_hash_pattern_tail` functions between parser and Ripper.
Ripper `new_hash_pattern_tail` didn’t call `assignable` then
`kw_rest_arg` wasn’t marked as local variable.
This is also fixed by this commit.

```
--- a/./tmp/before/test_pattern_matching.rb
+++ b/./tmp/after/test_pattern_matching.rb
@@ -3607,7 +3607,7 @@
                  [:in,
                   [:hshptn, nil, [], [:var_field, [:@ident, “a”, [984, 13]]]],
                   [[:binary,
-                    [:vcall, [:@ident, “a”, [985, 10]]],
+                    [:var_ref, [:@ident, “a”, [985, 10]]],
                     :==,
                     [:hash, nil]]],
                   nil]]],
@@ -3662,7 +3662,7 @@
                  [:in,
                   [:hshptn, nil, [], [:var_field, [:@ident, “a”, [993, 13]]]],
                   [[:binary,
-                    [:vcall, [:@ident, “a”, [994, 10]]],
+                    [:var_ref, [:@ident, “a”, [994, 10]]],
                     :==,
                     [:hash,
                      [:assoclist_from_args,
@@ -3813,7 +3813,7 @@
                    [:command,
                     [:@ident, “raise”, [1022, 10]],
                     [:args_add_block,
-                     [[:vcall, [:@ident, “b”, [1022, 16]]]],
+                     [[:var_ref, [:@ident, “b”, [1022, 16]]]],
                      false]]],
                   [:else, [[:var_ref, [:@kw, “true”, [1024, 10]]]]]]]],
                nil,
@@ -3876,7 +3876,7 @@
                      [:@int, “0”, [1033, 15]]],
                     :“&&“,
                     [:binary,
-                     [:vcall, [:@ident, “b”, [1033, 20]]],
+                     [:var_ref, [:@ident, “b”, [1033, 20]]],
                      :==,
                      [:hash, nil]]]],
                   nil]]],
@@ -3946,7 +3946,7 @@
                      [:@int, “0”, [1042, 15]]],
                     :“&&“,
                     [:binary,
-                     [:vcall, [:@ident, “b”, [1042, 20]]],
+                     [:var_ref, [:@ident, “b”, [1042, 20]]],
                      :==,
                      [:hash,
                       [:assoclist_from_args,
@@ -5206,7 +5206,7 @@
                      [[:assoc_new,
                        [:@label, “c:“, [1352, 22]],
                        [:@int, “0”, [1352, 25]]]]]],
-                   [:vcall, [:@ident, “r”, [1352, 29]]]],
+                   [:var_ref, [:@ident, “r”, [1352, 29]]]],
                   false]]],
                [:binary,
                 [:call,
@@ -5299,7 +5299,7 @@
                       [:assoc_new,
                        [:@label, “c:“, [1367, 34]],
                        [:@int, “0”, [1367, 37]]]]]],
-                   [:vcall, [:@ident, “r”, [1367, 41]]]],
+                   [:var_ref, [:@ident, “r”, [1367, 41]]]],
                   false]]],
                [:binary,
                 [:call,
@@ -5931,7 +5931,7 @@
              [:in,
               [:hshptn, nil, [], [:var_field, [:@ident, “r”, [1533, 11]]]],
               [[:binary,
-                [:vcall, [:@ident, “r”, [1534, 8]]],
+                [:var_ref, [:@ident, “r”, [1534, 8]]],
                 :==,
                 [:hash,
                  [:assoclist_from_args,
```
2024-02-20 17:33:58 +09:00
Takashi Kokubun 7177731282 YJIT: Add --yjit-perf=codegen option (#9957) 2024-02-14 09:09:14 -08:00
Takashi Kokubun 0a30fc6211 Remove obsoleted lldb_yjit.py
which clearly seems to be written for Ruby 3.1 YJIT that was not
rewritten in Rust yet. Since it has been left there as is, I don't think
anybody is actively using this script. We could add a new one if we need
it again.
2024-01-08 15:51:15 -08:00