rbspy icon indicating copy to clipboard operation
rbspy copied to clipboard

Line numbers aren't reported in traces on Ruby 2.6.x

Open jvns opened this issue 5 years ago • 3 comments

jvns avatar May 19 '19 15:05 jvns

To anyone wanting to look into this:

I added support for 2.6.x in #210. The internal structs changed a little so it required a new get_lineno function.

I couldn't figure out how to extract the positions table. Line 517 errors before it can do the logic.

It might be worth looking at the line numbering logic anyway. I'm not entirely convinced it's working correctly in 2.5.x either.

daniellockyer avatar May 19 '19 23:05 daniellockyer

I think the main issue is that insns_info.positions is often 0 (at least for our CI test programs), which means we would take the else branch in .gdbinit and will need to implement the "succinct bitvector" lookup. It's math-intensive but compact. Might not be too bad if someone runs gdb and adds a few printfs to ruby's .gdbinit so that the individual values can be printed and compared as the rust code is being written.

acj avatar Apr 25 '21 18:04 acj

This may also be an issue in 3.1.0, i'm doing some digging as to why but I'm seeing many line numbers report as 0 but other information is correct.

dalehamel avatar Aug 23 '22 22:08 dalehamel

Ruby 2.6 reached EOL status about 18 months ago, so there's probably limited value in fixing this. If anyone needs line numbers to work, the code here might be a helpful starting point, but be warned that it wasn't working consistently enough to ship.

acj avatar Oct 13 '23 00:10 acj