From 209e3a14867db64967a05e34bef97f15afdbebe7 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Tue, 12 Mar 2019 17:31:04 +0000 Subject: [PATCH] [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. llvm-svn: 355941 --- lldb/lit/Reproducer/TestReuseDirectory.test | 10 ++++++++++ lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 lldb/lit/Reproducer/TestReuseDirectory.test diff --git a/lldb/lit/Reproducer/TestReuseDirectory.test b/lldb/lit/Reproducer/TestReuseDirectory.test new file mode 100644 index 0000000..d486736 --- /dev/null +++ b/lldb/lit/Reproducer/TestReuseDirectory.test @@ -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 diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 1b9c5d6..6200486 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -178,7 +178,7 @@ public: std::error_code EC; m_stream_up = llvm::make_unique(history_file.GetPath(), EC, - sys::fs::OpenFlags::F_None); + sys::fs::OpenFlags::F_Text); return m_stream_up.get(); } -- 2.7.4