[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 23 10:01:06 PDT 2024


================
@@ -1363,6 +1374,43 @@ Status ProcessGDBRemote::DoResume() {
       }
     }
 
+    if (direction == RunDirection::eRunReverse && continue_packet_error) {
+      if (num_continue_C_tids > 0 || num_continue_S_tids > 0) {
+        error.SetErrorString("can't deliver signals while running in reverse");
+        LLDB_LOGF(log, "ProcessGDBRemote::DoResumeReverse: Signals not supported");
+        return error;
+      }
+
+      if (num_continue_s_tids > 0) {
+        if (num_continue_s_tids > 1) {
+          error.SetErrorString("can't step multiple threads while reverse-stepping");
+          LLDB_LOGF(log, "ProcessGDBRemote::DoResumeReverse: can't step multiple threads");
+          return error;
+        }
+
+        if (!m_gdb_comm.GetReverseStepSupported()) {
+          error.SetErrorString("target does not support reverse-stepping");
+          LLDB_LOGF(log, "ProcessGDBRemote::DoResumeReverse: target does not support reverse-stepping");
+          return error;
+        }
+
+        m_gdb_comm.SetCurrentThreadForRun(m_continue_s_tids.front());
+        continue_packet.PutCString("bs");
+      } else {
+        if (!m_gdb_comm.GetReverseContinueSupported()) {
----------------
jimingham wrote:

Why do you wait till this late do check that someone asked for a reverse continue but that's not supported?  I would expect that to be the first thing you checked since you aren't going to do any useful work if that's not true.

https://github.com/llvm/llvm-project/pull/99736


More information about the lldb-commits mailing list