Is it truly only for C/C++? My limited understanding says a debugger needs: a list of symbols (.pdb files on windows, can't remember what they are on linux), understanding of syscalls and a few other similar things. I thought they don't care too much what generated the binaries they are debugging (obviously as long as it's native code). Doesn't rr work with other languages like rust, zig, odin, nim, and similar ones?…
rr uses gdb as the actual debugger part, so anything that works in gdb will work in rr. (you won't get rr running on windows though, as it is very much linux-specific, having to wrap all of its syscalls. The linux symbol info thing is DWARF)
rr – record and replay debugger for C/C++
31–40 of 134 posts
Re: rr – record and replay debugger for C/C++
#32[flagged]
* rr record
* rr replay until crash or exception (set up catchpoint for that)
* set up hardware watchpoint for borked data that caused the issue
* work backwards in the data flow through watchpoints and reverse-continue
I would say this fundamentally changed how I approach debugging.Re: rr – record and replay debugger for C/C++
#33Is it truly only for C/C++? My limited understanding says a debugger needs: a list of symbols (.pdb files on windows, can't remember what they are on linux), understanding of syscalls and a few other similar things. I thought they don't care too much what generated the binaries they are debugging (obviously as long as it's native code). Doesn't rr work with other languages like rust, zig, odin, nim, and similar ones?…
Re: rr – record and replay debugger for C/C++
#34[flagged]
My previous job was in compiler engineering and I worked on upstream LLVM for a little while. rr was indispensable for me — not just for debugging, but as a tool for understanding how the compiler works in general. For example: you can set a watchpoint on an object in memory, and reverse-execute to the point where it was instantiated. This allowed you to answer questions such as ‘which optimisation pass was responsib…
Re: rr – record and replay debugger for C/C++
#35Re: rr – record and replay debugger for C/C++
#36Earlier quoted context omitted.
You might be interested in the rather spectacular upgrade to it, called pernosco : https://pernos.co/ It’s based on rr ( same author ) but vastly better
There are other commercial reverse debuggers, like Undo.
Re: rr – record and replay debugger for C/C++
#37Earlier quoted context omitted.
Why isn't it good for concurrency bugs? rr doesn't record the entire state up to the race condition?
it serializes your problem because you can't atomically snapshot memory when there are multiple threads writing to it
https://robert.ocallahan.org/2016/02/introducing-rr-chaos-mo...
Re: rr – record and replay debugger for C/C++
#38Earlier quoted context omitted.
rr uses gdb as the actual debugger part, so anything that works in gdb will work in rr. (you won't get rr running on windows though, as it is very much linux-specific, having to wrap all of its syscalls. The linux symbol info thing is DWARF)
Ok yeah, of course. I'd even argue that cross platform debuggers are not a thing to be desired. Too much low level integration with the operating system is needed when implementing one.
When you replay a recording, rr first starts its custom gdbserver (which reads from the recording instead of from a live process) then starts a gdb process that connects to it.
Re: rr – record and replay debugger for C/C++
#39Earlier quoted context omitted.
rr uses gdb as the actual debugger part, so anything that works in gdb will work in rr. (you won't get rr running on windows though, as it is very much linux-specific, having to wrap all of its syscalls. The linux symbol info thing is DWARF)
Ok yeah, of course. I'd even argue that cross platform debuggers are not a thing to be desired. Too much low level integration with the operating system is needed when implementing one.
Re: rr – record and replay debugger for C/C++
#40Earlier quoted context omitted.
I don't understand the "rewrite X/Y/Z in Rust" trend that has been going for a few years. I'm not familiar with Rust, but I'm almost sure it has a good C interoperability. If a certain piece of software is working well, what is the benefit of rewriting it in Rust?
There's a bit of a higher abstraction ceiling in Rust so in theory if you are successful rewriting a thing in Rust then you now have a codebase that's easier to change confidently. This sort of property is nice to have in huge codebases where you really start losing confidence in shipping changes that don't subtly break things. But of course a huge codebase is hard to rewrite in general...