Rocky Bernstein
unread,Dec 2, 2012, 3:01:41 PM12/2/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ruby Debugger
As I was going over patches the other day, I managed to investigate something I've long wanted to add, a gdb "jump" command. It's also available in the stock python debugger pdb (and pydb).
For those that are not familiar with this command, it changes execution to some other place in the code allowing you to redo or skip over statements. In a couple of my POSIX shell debuggers there is a "skip" command which allows one to skip execution the next statement.
The mechanism to do this is pretty dangerous, you basically change the VM program counter. And that's what I managed to figure out how to do. In trepanning the low-level debugger command is "set pc".
As best as I can tell, on Intel architectures in YARV there appears to be some mechanism for keeping this in a register. When that's removed, one change the PC. And so with that one can conceivably implement "skip" or "jump".
For now, those higher level debugger commands are not there because some introspection is needed for when it is safe to do so. One can't jump inside or out of a block; figuring out whether this is attempted -- although plausible now -- is not something I have done.
I will probably put out new releases of threadframe and trepanning with this within a couple of week. I think it cool even if it is a bit dangerous.