rbspy
rbspy copied to clipboard
Line numbers aren't reported in traces on Ruby 2.6.x
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.
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 printf
s to ruby's .gdbinit so that the individual values can be printed and compared as the rust code is being written.
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.
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.