rr
rr copied to clipboard
rr delta/diff
My apologies if this request is a little "out there", feel free to close it if so.
My use-case: I have a bug. I know which change caused this bug. (right down to the exact line) However, this change causes tons of subtle ripple effects in the execution of my program, such that, by the time an assert trips, I am far away from the start of the problem.
What I want is to do 2 runs of RR, 1 before and 1 after the patch.
Then I want to run some kind of 'rr delta' program, which will tell me the earliest point at which the execution of the two traces begins to diverge.
Likely this will also need: () some kind of 'ignore and continue' command to skip the boring stuff that is slightly out of order () some kind of 'only consider these threads' as interesting (*) some kind of 'ignore filter' to ignore whole swaths of source code where the differences are uninteresting.
That's a good idea that I've been thinking about for a long time. It would be a cool research project. Unfortunately I don't have the time to work on it.
You might be able to hack something together with gdb that works in some cases.
drltrace from dynamorio can generate a log of shared library calls, and for the main binary you can print __builtin_return_address(0) from gcc's -finstrument-functions callbacks and resolve addresses to symbols using llvm-symbolizer or similar. Then diff the logs. This is all at function call granularity though.
As something close, one can call rr dump for different executions, which contains a lot of events (mostly syscalls though), then reduce the difference by using grep and co, and compare with diff and e.g. diffr.
This would be an awesome functionality for writing deterministic programs.