llvm-project/lldb/source/Plugins/InstrumentationRuntime
Lawrence D'Anna 7ca15ba73f remove File::SetStream(), make new files instead.
Summary:
This patch removes File::SetStream() and File::SetDescriptor(),
and replaces most direct uses of File with pointers to File.
Instead of calling SetStream() on a file, we make a new file and
replace it.

My ultimate goal here is to introduce a new API class SBFile, which
has full support for python io.IOStream file objects.   These can
redirect read() and write() to python code, so lldb::Files will
need a way to dispatch those methods.   Additionally it will need some
form of sharing and assigning files, as a SBFile will be passed in and
assigned to the main IO streams of the debugger.

In my prototype patch queue, I make File itself copyable and add a
secondary class FileOps to manage the sharing and dispatch.  In that
case SBFile was a unique_ptr<File>.
(here: https://github.com/smoofra/llvm-project/tree/files)

However in review, Pavel Labath suggested that it be shared_ptr instead.
(here: https://reviews.llvm.org/D67793)

In order for SBFile to use shared_ptr<File>, everything else should
as well.

If this patch is accepted, I will make SBFile use a shared_ptr
I will remove FileOps from future patches and use subclasses of File
instead.

Reviewers: JDevlieghere, jasonmolenda, zturner, jingham, labath

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D67891

llvm-svn: 373090
2019-09-27 14:33:35 +00:00
..
ASan remove File::SetStream(), make new files instead. 2019-09-27 14:33:35 +00:00
MainThreadChecker [Process] Remove unused field from HistoryThread 2019-06-19 21:33:44 +00:00
TSan remove File::SetStream(), make new files instead. 2019-09-27 14:33:35 +00:00
UBSan remove File::SetStream(), make new files instead. 2019-09-27 14:33:35 +00:00
CMakeLists.txt Shorten sanitizer plugin names 2017-06-26 08:13:22 +00:00