Commit graph

35 commits

Author SHA1 Message Date
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
É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
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
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
yui-knk
7a050638b1 Introduce NODE_FILE
`__FILE__` was managed by `NODE_STR` with `String` object.
This commit introduces `NODE_FILE` and `struct rb_parser_string` so that

1. `__FILE__` is detectable from AST Node
2. Reduce dependency ruby object
2024-01-02 14:19:42 +09:00
yui-knk
97986f406b LLDB: Print actual node structure of NODE_LINE 2024-01-02 10:36:09 +09:00
Nobuyoshi Nakada
5f50593b45
Fix RCLASS_EXT dump [ci skip] 2023-12-06 15:16:21 +09:00
Nobuyoshi Nakada
b06b69e6dc
LLDB: Dump table structs in Hash [ci skip] 2023-10-31 22:40:34 +09:00
Nobuyoshi Nakada
526292d9fe
LLDB: Use expression to save the result into the history [ci skip] 2023-10-25 16:50:00 +09:00
yui-knk
7de6908a28 LLDB: Print actual node structure [ci skip] 2023-10-10 07:53:42 +09:00
Nobuyoshi Nakada
ce717be188
Fix RBignum print [ci skip] 2023-09-30 02:09:29 +09:00
Nobuyoshi Nakada
9fa7ec9332
Fix RArray print [ci skip] 2023-09-30 02:09:29 +09:00
Nobuyoshi Nakada
e825160257
Delete empty lines at EOF [ci skip] 2023-09-30 02:09:29 +09:00
Jemma Issroff
dadf17818c
Add ruby_globals to lldb for easier debugging (#8041) 2023-07-07 15:55:58 -04:00
Nobuyoshi Nakada
dcdc2cbd8e
RString::len was moved at 7577c101ed
[ci skip]
2023-06-11 17:31:49 +09:00
Nobuyoshi Nakada
e1d2dc4cfc
LLDB: Fix T_ARRAY inspect [ci skip] 2023-04-10 14:12:19 +09:00
Matt Valentine-House
dabeec8034 [ci skip] LLDB: Fix rp for arrays 2023-03-30 22:38:30 +01:00
Nobuyoshi Nakada
339295dd7c
Fix missing receiver [ci sip] 2023-03-31 01:16:44 +09:00
Matt Valentine-House
6eac424e5e [ci skip] Move rb_id2str into new LLDB format 2023-03-21 09:10:46 +00:00
git
2d97f87407 * remove trailing spaces. [ci skip] 2023-03-17 20:04:58 +00:00
Matt Valentine-House
c7862c68eb [ci skip] Move rp helper to new LLDB format
For now, the old function still exists as `old_rp`, in order to debug
issues with this command.
2023-03-17 20:04:43 +00:00
Matt Valentine-House
220cdbeea5
[lldb] Add a print_flags command (#7358) 2023-02-22 14:26:28 -05:00
Aaron Patterson
70173a72a2
Ivar copy needs to happen _before_ setting the shape
When we copy instance variables, it is possible for the GC to be kicked
off.  The GC looks at the shape to determine what slots to mark inside
the object.  If the shape is set too soon, the GC could think that there
are more instance variables on the object than there actually are at
that moment.
2022-11-01 15:38:44 -07:00
Kaíque Kandy Koga
4177f60eed Write interface instead of interfact 2022-08-19 22:18:36 +09:00
git
59da26789f * remove trailing spaces. [ci skip] 2022-08-19 02:25:54 +09:00
Matt Valentine-House
92603bbd69 [ci skip][Feature #18910][lldb] Dedup lldb_init
by moving it fully into RbBaseCommand
2022-08-18 13:25:32 -04:00
Matt Valentine-House
b26aec9daa [ci-skip][Feature #18910][lldb] New directory structure
Push the newly refactored lldb files into a sub-directory so that we're
not cluttering up the misc directory
2022-08-18 13:25:32 -04:00