summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/File.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2016-03-10 20:49:32 +0000
committerGreg Clayton <gclayton@apple.com>2016-03-10 20:49:32 +0000
commita31baf081b9bbe51ad411249dbdc67abbcedad41 (patch)
treea7d1df36dc2a7cb23d425c43327059b7369638ab /lldb/source/Host/common/File.cpp
parentad04914a53bc21c2f1678ecc5ab0c5617b668ad0 (diff)
downloadbcm5719-llvm-a31baf081b9bbe51ad411249dbdc67abbcedad41.tar.gz
bcm5719-llvm-a31baf081b9bbe51ad411249dbdc67abbcedad41.zip
Fixed the python interpreter so that it correctly inherits the top IOHandler's files instead of always using stdin/out/err.
Removed lldb_private::File::Duplicate() and the copy constructor and the assignment operator that used to duplicate the file handles and made them private so no one uses them. Previously the lldb_private::File::Duplicate() function duplicated files that used file descriptors, (int) but not file streams (FILE *), so the lldb_private::File::Duplicate() function only worked some of the time. No one else excep thee ScriptInterpreterPython was using these functions, so that aren't needed nor desired. Previously every time you would drop into the python interpreter we would duplicate files, and now we avoid this file churn. <rdar://problem/24877720> llvm-svn: 263161
Diffstat (limited to 'lldb/source/Host/common/File.cpp')
-rw-r--r--lldb/source/Host/common/File.cpp51
1 files changed, 0 insertions, 51 deletions
diff --git a/lldb/source/Host/common/File.cpp b/lldb/source/Host/common/File.cpp
index 99a87ac5c1a..5b38920f243 100644
--- a/lldb/source/Host/common/File.cpp
+++ b/lldb/source/Host/common/File.cpp
@@ -109,27 +109,6 @@ File::File (const FileSpec& filespec,
}
}
-File::File (const File &rhs) :
- IOObject(eFDTypeFile, false),
- m_descriptor (kInvalidDescriptor),
- m_stream (kInvalidStream),
- m_options (0),
- m_own_stream (false),
- m_is_interactive (eLazyBoolCalculate),
- m_is_real_terminal (eLazyBoolCalculate)
-{
- Duplicate (rhs);
-}
-
-
-File &
-File::operator = (const File &rhs)
-{
- if (this != &rhs)
- Duplicate (rhs);
- return *this;
-}
-
File::~File()
{
Close ();
@@ -215,7 +194,6 @@ File::GetStream ()
return m_stream;
}
-
void
File::SetStream (FILE *fh, bool transfer_ownership)
{
@@ -226,35 +204,6 @@ File::SetStream (FILE *fh, bool transfer_ownership)
}
Error
-File::Duplicate (const File &rhs)
-{
- Error error;
- if (IsValid ())
- Close();
-
- if (rhs.DescriptorIsValid())
- {
-#ifdef _WIN32
- m_descriptor = ::_dup(rhs.GetDescriptor());
-#else
- m_descriptor = dup(rhs.GetDescriptor());
-#endif
- if (!DescriptorIsValid())
- error.SetErrorToErrno();
- else
- {
- m_options = rhs.m_options;
- m_should_close_fd = true;
- }
- }
- else
- {
- error.SetErrorString ("invalid file to duplicate");
- }
- return error;
-}
-
-Error
File::Open (const char *path, uint32_t options, uint32_t permissions)
{
Error error;
OpenPOWER on IntegriCloud