[Lldb-commits] [lldb] r355941 - [Reproducers] Add a test to ensure we can reuse the reproducer dir.

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 12 10:31:04 PDT 2019


Author: jdevlieghere
Date: Tue Mar 12 10:31:04 2019
New Revision: 355941

URL: http://llvm.org/viewvc/llvm-project?rev=355941&view=rev
Log:
[Reproducers] Add a test to ensure we can reuse the reproducer dir.

Yesterday I noticed a reproducer test failing after making a local
change. Removing the reproducer directory solved the issue. Add a test
case that detects this.

Added:
    lldb/trunk/lit/Reproducer/TestReuseDirectory.test
Modified:
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Added: lldb/trunk/lit/Reproducer/TestReuseDirectory.test
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Reproducer/TestReuseDirectory.test?rev=355941&view=auto
==============================================================================
--- lldb/trunk/lit/Reproducer/TestReuseDirectory.test (added)
+++ lldb/trunk/lit/Reproducer/TestReuseDirectory.test Tue Mar 12 10:31:04 2019
@@ -0,0 +1,10 @@
+# UNSUPPORTED: system-windows, system-freebsd
+
+# Test that we can capture twice to the same directory without breaking the
+# reproducer functionality.
+
+# RUN: rm -rf %t.repro
+# RUN: %clang %S/Inputs/simple.c -g -o %t.out
+# RUN: %lldb -x -b -s %S/Inputs/GDBRemoteCapture.in --capture --capture-path %t.repro %t.out | FileCheck %S/TestGDBRemoteRepro.test --check-prefix CHECK --check-prefix CAPTURE
+# RUN: %lldb -x -b -s %S/Inputs/GDBRemoteCapture.in --capture --capture-path %t.repro %t.out | FileCheck %S/TestGDBRemoteRepro.test --check-prefix CHECK --check-prefix CAPTURE
+# RUN: %lldb --replay %t.repro | FileCheck %S/TestGDBRemoteRepro.test --check-prefix CHECK --check-prefix REPLAY

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=355941&r1=355940&r2=355941&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Tue Mar 12 10:31:04 2019
@@ -178,7 +178,7 @@ public:
 
     std::error_code EC;
     m_stream_up = llvm::make_unique<raw_fd_ostream>(history_file.GetPath(), EC,
-                                                    sys::fs::OpenFlags::F_None);
+                                                    sys::fs::OpenFlags::F_Text);
     return m_stream_up.get();
   }
 




More information about the lldb-commits mailing list