Live data from Hacker News

rr – record and replay debugger for C/C++

rr-project.org

91–100 of 134 posts

Re: rr – record and replay debugger for C/C++

#91
post #83
post #78

Earlier quoted context omitted.

This is the usual killer feature of something like rr. You debug, look at some variable: `p whatever`. You see that its value is wrong. You want to know where this wrong value came from, so you `watch -l whatever` and `rc`. Bam!

There are some bugs I would never have figured out without this technique. It feels like cheating.

It’s not cheating, it’s technique!

Re: rr – record and replay debugger for C/C++

#93

Long ago, VMWare workstation supported doing this, but not just for userspace programs but also for kernels and even drivers, in a VM. The feature shipped and existed for a few versions before it was killed by internal politics.

And, I guess, before that, there was AMD SymNow, which was plug-in extendable and gave a plugin full control over CPU being emulated. I wonder if something like that is available somewhere?

Re: rr – record and replay debugger for C/C++

#95
post #9

Earlier 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?

> If a certain piece of software is working well, what is the benefit of rewriting it in Rust? One benefit is it's easier to hide malicious code thanks to Rust's complicated syntax.

It's far easier to hide malicious code in C or C++: just write some subtle undefined behavior that you can write an exploit against. Developers do that all the time even when they're not trying to be malicious. In Rust you'd have to wrap it in "unsafe" which draws attention.

Re: rr – record and replay debugger for C/C++

#96
post #94

GDBs built-in reverse debugging: https://www.sourceware.org/gdb/wiki/ProcessRecord/Tutorial I assume rr provides more features and flexibility. Anyway I want to mention that GDB itself can already reverse debug for some time now.

If you want to mention this, then you very clearly haven't actually tried it. The implementation in GDB is more convenient than rr (you can start/stop recording at will), but it is also orders of magnitude less efficient. It's only usable for very small code snippets. Otherwise it takes effectively forever and/or runs out of resources.

Re: rr – record and replay debugger for C/C++

#97
post #83
post #78

Earlier quoted context omitted.

This is the usual killer feature of something like rr. You debug, look at some variable: `p whatever`. You see that its value is wrong. You want to know where this wrong value came from, so you `watch -l whatever` and `rc`. Bam!

There are some bugs I would never have figured out without this technique. It feels like cheating.

Totally. rr is nothing short of a revolution in debuggin.

Re: rr – record and replay debugger for C/C++

#98
post #3

[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…

rr supports Aarch64 pretty well now.

Re: rr – record and replay debugger for C/C++

#99
post #27

Earlier 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.

I did use gdb recently on Windows, but this was for a cross compiled program using mingw. Not sure it works for programs made with MSVC.

Re: rr – record and replay debugger for C/C++

#100
post #94

GDBs built-in reverse debugging: https://www.sourceware.org/gdb/wiki/ProcessRecord/Tutorial I assume rr provides more features and flexibility. Anyway I want to mention that GDB itself can already reverse debug for some time now.

rr predates the one in gdb if I am not mistaken
Post reply on HN