First of all, for those who haven't tried
rr yet, stop everything and go check
it out right now. It's revolutionary. I'll wait.
OK. Back? I generally talk to gdb from inside GNU Emacs. This has two modes:
- GUD. This is the "old" mode, and you launch it via
M-x gud-gdb. GUD expects gdb to be running with annotation level 1. This annotation level can be set in several ways:
gdb --annotate 1
set annotate 1within
M-x gud-gdb, emacs suggests
gdb --fullname, so by taking the suggestion the user doesn't have to remember any of these.
- gdb-mi. This is the "new" mode, launched via
M-x gdb. It also needs a special communications mode, but this one is entered with any of
As with GUD,
M-x gdbsuggests something:
gdb -i=miso once again the user doesn't need to remember any of this.
Now, when I
rr replay, I'm also talking to gdb, and I need to pass the same
communication options. But
rr doesn't support these, so the user needs to do
something to turn them on, which at the very least means learning and
remembering trivia about these options. Well, I fixed this, so now I can now go
back to being blissfully ignorant:
Now, when invoking
rr replay from Emacs, you simply take the suggested command
gdb --fullname or
gdb -i=mi), replace
rr replay, add the log
we're replaying, and things then work as expected.
Note that if you're stuck with an older version of
rr then at least for GUD
there's a simple workaround:
echo set annotate 1 >> ~/.gdbinit