diff --git a/CHANGELOG.md b/CHANGELOG.md
index 89104ef..a88b491 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,7 @@
## [1.17beta] - 2023-??-??
* Add a dialog when a breakpoint is reached.
+* Add support for the RR debugger. (seergdb --rr host:port)
## [1.16] - 2023-04-07
* Add pid to main window and console title bars.
diff --git a/src/SeerDebugDialog.cpp b/src/SeerDebugDialog.cpp
index 173d03e..81051aa 100644
--- a/src/SeerDebugDialog.cpp
+++ b/src/SeerDebugDialog.cpp
@@ -776,8 +776,8 @@ void SeerDebugDialog::handleRunModeChanged (int id) {
if (id == 3) {
executableSymbolNameLineEdit->setEnabled(true);
executableSymbolNameToolButton->setEnabled(true);
- preCommandsPlainTextEdit->setPlaceholderText("gdb commands before \"connect\"");
- postCommandsPlainTextEdit->setPlaceholderText("gdb commands after \"connect\"");
+ preCommandsPlainTextEdit->setPlaceholderText("gdb commands before \"RR connect\"");
+ postCommandsPlainTextEdit->setPlaceholderText("gdb commands after \"RR connect\"");
}
// ID == 4 COREFILE
diff --git a/src/SeerDebugDialog.ui b/src/SeerDebugDialog.ui
index 712f0fe..18681a1 100644
--- a/src/SeerDebugDialog.ui
+++ b/src/SeerDebugDialog.ui
@@ -207,7 +207,7 @@
- 3
+ 2
@@ -588,7 +588,20 @@
- -
+
-
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+ -
-
@@ -606,7 +619,7 @@
- How to access the remote gdbserver.
+ How to access the gdbserver.
@@ -621,19 +634,6 @@
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
@@ -650,7 +650,7 @@
-
- Connect to a RR replay server.
+ Connect to a RR replay session.
@@ -670,7 +670,7 @@
-
- Help for Connect launch method.
+ Help for RR launch method.
...
@@ -688,7 +688,7 @@
-
- RR replay server
+ RR replay session
@@ -701,7 +701,7 @@
- How to access the remote gdbserver.
+ How to access the RR session.
diff --git a/src/SeerGdbWidget.cpp b/src/SeerGdbWidget.cpp
index 72c18cc..03e7c07 100644
--- a/src/SeerGdbWidget.cpp
+++ b/src/SeerGdbWidget.cpp
@@ -58,7 +58,7 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) {
_gdbHandleTerminatingException = true;
_gdbRandomizeStartAddress = false;
_gdbEnablePrettyPrinting = true;
- _gdbRecordMode = "stop";
+ _gdbRecordMode = "";
_gdbRecordDirection = "";
_consoleMode = "";
_consoleScrollLines = 1000;
@@ -551,7 +551,9 @@ void SeerGdbWidget::setGdbRecordMode(const QString& mode) {
_gdbRecordMode = mode;
- handleGdbCommand("record " + gdbRecordMode());
+ if (mode != "rr" && mode != "") {
+ handleGdbCommand("record " + gdbRecordMode());
+ }
emit recordSettingsChanged();
}
@@ -862,6 +864,7 @@ void SeerGdbWidget::handleGdbRunExecutable (const QString& breakMode) {
connectConsole();
setExecutableLaunchMode("run");
+ setGdbRecordMode("");
setExecutablePid(0);
// Load ithe executable, if needed.
@@ -978,6 +981,7 @@ void SeerGdbWidget::handleGdbAttachExecutable () {
// No console for 'attach' mode.
setExecutableLaunchMode("attach");
+ setGdbRecordMode("");
// Load ithe executable, if needed.
if (newExecutableFlag() == true) {
@@ -1046,6 +1050,7 @@ void SeerGdbWidget::handleGdbConnectExecutable () {
// No console for 'connect' mode.
setExecutableLaunchMode("connect");
+ setGdbRecordMode("");
setExecutablePid(0);
// Connect to the remote gdbserver.
@@ -1115,6 +1120,7 @@ void SeerGdbWidget::handleGdbRRExecutable () {
// No console for 'connect' mode.
setExecutableLaunchMode("rr");
+ setGdbRecordMode("rr");
setExecutablePid(0);
// Connect to the remote gdbserver.
@@ -1200,6 +1206,7 @@ void SeerGdbWidget::handleGdbCoreFileExecutable () {
// No console for 'core' mode.
setExecutableLaunchMode("corefile");
+ setGdbRecordMode("");
setExecutablePid(0);
if (newExecutableFlag() == true) {
@@ -1236,6 +1243,7 @@ void SeerGdbWidget::handleGdbShutdown () {
// We are in no mode now.
setExecutableLaunchMode("");
+ setGdbRecordMode("");
// Give the gdb and 'exit' command.
// This should handle detaching from an attached pid.
@@ -1363,7 +1371,7 @@ void SeerGdbWidget::handleGdbRecordReverse () {
void SeerGdbWidget::handleGdbRecordStartStopToggle () {
- if (gdbRecordMode() == "stop") {
+ if (gdbRecordMode() == "stop" || gdbRecordMode() == "") {
setGdbRecordMode("full");
setGdbRecordDirection("");
@@ -1373,6 +1381,10 @@ void SeerGdbWidget::handleGdbRecordStartStopToggle () {
setGdbRecordMode("stop");
setGdbRecordDirection("");
+ }else if (gdbRecordMode() == "rr") {
+
+ // Don't do anthing.
+
}else{
setGdbRecordMode("stop");
@@ -2840,6 +2852,7 @@ void SeerGdbWidget::killGdb () {
// Clear the launch mode.
setExecutableLaunchMode("");
+ setGdbRecordMode("");
// Kill the process.
_gdbProcess->kill();
diff --git a/src/SeerMainWindow.cpp b/src/SeerMainWindow.cpp
index 2f66578..c7f34ad 100644
--- a/src/SeerMainWindow.cpp
+++ b/src/SeerMainWindow.cpp
@@ -856,6 +856,9 @@ void SeerMainWindow::handleText (const QString& text) {
}else if (text.startsWith("^done,asm_insns=[")) {
return;
+ }else if (text.startsWith("^done,ada-exceptions={") && text.endsWith("}")) {
+ return;
+
}else if (text.contains(QRegExp("^([0-9]+)\\^done"))) {
return;
@@ -1084,7 +1087,7 @@ void SeerMainWindow::handleRecordSettingsChanged () {
// Toolbar
actionRecordProcess->setText("RR");
- actionRecordProcess->setEnabled(false);
+ actionRecordProcess->setEnabled(true);
actionRecordDirection->setEnabled(true);
}else{
diff --git a/src/resource.qrc b/src/resource.qrc
index 9bb57a2..7ecf7c5 100644
--- a/src/resource.qrc
+++ b/src/resource.qrc
@@ -66,6 +66,7 @@
resources/help/RunDebugMode.md
resources/help/AttachDebugMode.md
resources/help/ConnectDebugMode.md
+ resources/help/RRDebugMode.md
resources/help/CorefileDebugMode.md
diff --git a/src/resources/help/DebugModes.md b/src/resources/help/DebugModes.md
index b057c80..c7696d2 100644
--- a/src/resources/help/DebugModes.md
+++ b/src/resources/help/DebugModes.md
@@ -6,6 +6,7 @@ Seer supports most debugging modes that gdb provides. These are:
* Starting and running a program
* Attaching to a local process on the system
* Connecting to a gdbserver
+* Connecting to a RR replay session
* Loading a corefile leftover from a program that crashed
### What can you do?
diff --git a/src/resources/help/RRDebugMode.md b/src/resources/help/RRDebugMode.md
new file mode 100644
index 0000000..675025b
--- /dev/null
+++ b/src/resources/help/RRDebugMode.md
@@ -0,0 +1,56 @@
+## RR debug mode
+
+### Introduction
+
+This mode allows Seer to debug a local or remote RR replay session.
+
+RR allows time-travel debugging. In that, you can step forward or backwards in the execution of program
+being debugged.
+
+gdb has its own notion of time-travel debugging. However, it differs from RR's method. With gdb, the
+record of instructions is recorded as you are debugging the program. With RR, the record of instructions
+are made once when you run the program with 'rr record'. Seer/gdb can then connect to the recordings
+via the 'rr replay -s' command.
+
+Further information on RR is listed below in the references.
+
+
+### Requirements
+In this mode, Seer needs:
+
+* Optional symbol file if the executable doesn't have debug information
+* How to look for the RR replay session (machine and port)
+* Optional gdb commands to execute before and after Seer connects to the RR replay session
+
+### What can you do?
+In this mode, Seer will connect to the RR replay session via its host:port. The program will be stopped befor 'main'.
+At this point you can set breakpoints and tell Seer to 'continue' or any typical debugging command.
+
+Seer will show a 'Direction' arrow on the toolbar. This will set the debugging direction to forward or reverse. And
+affects all commands like: 'step', 'next', 'finish', etc.
+
+A typical debugging sequence would look like:
+
+```
+ # Use RR to record all instructions for a program.
+ $ rr record -n hellosegv one two three
+
+ # Use RR to start a replay session on the previously create instructions. Pick a free port.
+ $ rr replay -s 50505 -k
+ Launch gdb with
+ gdb '-l' '10000' '-ex' 'set sysroot /' '-ex' 'target extended-remote 127.0.0.1:50505' /nas/erniep/Development/seer/tests/hellosegv/hellosegv
+
+ # In a separate terminal, use Seer to connect to that replay session port.
+ $ seergdb --rr localhost:50505
+```
+
+Now use Seer as you normally would. Use the Direction arrow in the main toolbar to change debugging directions.
+
+### References
+
+Check references for RR and gdb.
+
+* [RR website](https://rr-project.org)
+* [RR github](https://github.com/rr-debugger/rr/wiki/Usage)
+* [gdb's record mode](https://sourceware.org/gdb/current/onlinedocs/gdb.html/Process-Record-and-Replay.html#index-record-mode)
+