oracle / graal

GraalVM compiles Java applications into native executables that start instantly, scale fast, and use fewer compute resources 🚀
https://www.graalvm.org
Other
20.34k stars 1.63k forks source link

on enter not working for TruffleRuby with the insight tool #3007

Open petenorth opened 3 years ago

petenorth commented 3 years ago

Describe GraalVM and your environment :

Have you verified this issue still happens when using the latest snapshot? Yes

Describe the issue The insight tool does not capture TruffleRuby method entries

Code snippet or code repository that reproduces the issue fibonacci.rb

def fib(n)
  first_num, second_num = [0, 1]
  (n - 1).times do
    first_num, second_num = second_num, first_num + second_num
  end
  puts first_num
end
fib(4)

and local-variable-trace.rb

puts("Ruby: Insight version " + insight[:version] + " is launching")

config = Truffle::Interop.hash_keys_as_members({
  roots: true
})

insight.on("enter", -> (ctx, frame) {
    puts(frame[:n].to_s)
}, config)

Steps to reproduce the issue ruby --insight=local-variable-trace.rb --experimental-options fibonacci.rb

Expected behavior In addition to the number 2 the frame strings should be printed for each method entry

fernando-valdez commented 3 years ago

Hi @petenorth, thank you for reporting this issue. I will take a look at it. If I have any questions I will let you know.