[Lldb-commits] [PATCH] D65152: Fix issues with inferior stdout coming out of order

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 23 13:01:57 PDT 2019


clayborg added inline comments.


================
Comment at: include/lldb/Core/Debugger.h:350
+  std::mutex m_output_flush_mutex;
+  void FlushProcessOutput(Process &process, bool is_stdout);
 
----------------
What about making this function:

```
void Debugger::FlushProcessOutput(Process &process, bool flush_stdout, bool flush_stderr);
```

Then we don't need to call this twice everywhere.



================
Comment at: source/Core/Debugger.cpp:1416-1421
+    if (got_stdout || got_state_changed)
+      FlushProcessOutput(*process_sp, /*is_stdout*/ true);
 
     // Now display and STDERR
-    if (got_stderr || got_state_changed) {
-      GetProcessSTDERR(process_sp.get(), error_stream_sp.get());
-    }
+    if (got_stderr || got_state_changed)
+      FlushProcessOutput(*process_sp, /*is_stdout*/ false);
----------------
If we change FlushProcessOutput as mentioned above this would be:

```
FlushProcessOutput(Process &process, got_stdout || got_state_changed, got_stderr || got_state_changed);
```




================
Comment at: source/Interpreter/CommandInterpreter.cpp:2712-2713
+    return;
+  m_debugger.FlushProcessOutput(*process_sp, /*is_stdout*/ true);
+  m_debugger.FlushProcessOutput(*process_sp, /*is_stdout*/ false);
 }
----------------
```
m_debugger.FlushProcessOutput(*process_sp, true, true);
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65152/new/

https://reviews.llvm.org/D65152





More information about the lldb-commits mailing list