Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use GDBFrontend with rr (record & replay) debugger #67

Open
vimkim opened this issue Jul 18, 2024 · 3 comments
Open

How to use GDBFrontend with rr (record & replay) debugger #67

vimkim opened this issue Jul 18, 2024 · 3 comments
Labels
howto question Further information is requested

Comments

@vimkim
Copy link

vimkim commented Jul 18, 2024

It will be amazing if this awesome project supports rr (record and replay) debugger.

Adding a 'reverse step' and 'reverse next' button would be amazing too!

@rohanrhu
Copy link
Owner

You can do it in the same way as you do with only GDB, GDBFrontend delivers a terminal emulator at the bottom but buttons would be so nice. I think you mean packaging rr into the GDBFrontend distribution? How could we deliver the best solution for this? I don't know anything about rr.

@vimkim
Copy link
Author

vimkim commented Jul 18, 2024

Oh I see. I wish you to take a look at rr debugger one day (it works on WSL too).

RR is such an amazing debugger and I use it all the time. It is a game changer.

GDB's record & reverse feature is quite limited and you can do it only for a small program. If you try to record a huge program such as mysql executable it breaks.

RR debugger, on the other hand, was made by Mozilla for debugging large executables like firefox browser.
It just feels like a miracle since you can reverse the whole program state back from the end to the beginning, even if you run firefox with it. As a hardcore debugger user, RR boosts up your productivity by an order of magnitude when analyzing a program.

And the reason I'm suggesting you to implement it is that, in their documentation, it says

rr implements the standard gdb server interface, and also can present the gdb command-line interface. This means it can be used in integrated development environments (IDEs) which support GUI debugging based on gdb/gdbserver.

https://github.com/rr-debugger/rr/wiki/Using-rr-in-an-IDE

I'm not into details but it seems it might be easy to integrate rr into your debugger, with just a little tweak.

I see other gdb GUI frontends like gdbgui, or gf (https://github.com/nakst/gf) supports RR mode.

It will be definitely appealing to c/cpp/rust/go community if you support rr with your debugger.

@vimkim
Copy link
Author

vimkim commented Jul 20, 2024

Amazing news! It just works with RR debugger!!

I had been trying to figure it out by myself for three days and almost got frustrated, but I eventually succeeded by thoroughly reading the RR debugger's documentation. It turned out to be quite simple.

Steps to use gdb-frontend with RR debugger

terminal 1

$ rr record <my program>
$ rr replay -s 9999 -k
...

terminal 2

$ gdbfrontend
...

Then, go to the webpage and connect to localhost:9999

image

Then, type the following in the gdb command line

set sysroot /

image

Then set a breakpoint and continue and you are good to go. It works like a charm!!!!

The effects of reverse commands, such as reverse step, reverse continue, and reverse next, are also displayed perfectly on the screen (unlike in VS Code, where they currently do not).

Thank you so much for creating such an amazing project. The only thing I would like to see added is support for reverse buttons, though they are not necessary since I can always use the command line.

I appreciate your hard work. If you don't mind, I recommend you to:

  1. Specify in your README.md that your project works with rr.
  2. Inform the rr community that your project is compatible with the rr debugger.

I believe many people like me would get to know about this project and appreciate your great work.

You are at the forefront of improving the welfare of Linux developers. Thanks again.

@rohanrhu rohanrhu added the howto label Dec 7, 2024
@rohanrhu rohanrhu changed the title support for rr debugger How to use GDBFrontend with rr (record & replay) debugger Dec 7, 2024
@rohanrhu rohanrhu added the question Further information is requested label Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
howto question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants