summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core
diff options
context:
space:
mode:
authorLawrence D'Anna <lawrence_danna@apple.com>2019-10-03 04:04:48 +0000
committerLawrence D'Anna <lawrence_danna@apple.com>2019-10-03 04:04:48 +0000
commit96898eb6a935533aaebbfbd085150fbf705c0ffc (patch)
tree810c11bdcc946df6b525a243f65b19d9c59ce9d0 /lldb/source/Core
parent5750453020926ce270aee38bd5eb7f0ff3467237 (diff)
downloadbcm5719-llvm-96898eb6a935533aaebbfbd085150fbf705c0ffc.tar.gz
bcm5719-llvm-96898eb6a935533aaebbfbd085150fbf705c0ffc.zip
SBDebugger::SetInputFile, SetOutputFile, etc.
Summary: Add new methods to SBDebugger to set IO files as SBFiles instead of as FILE* streams. In future commits, the FILE* methods will be deprecated and these will become the primary way to set the debugger I/O streams. Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68181 llvm-svn: 373563
Diffstat (limited to 'lldb/source/Core')
-rw-r--r--lldb/source/Core/Debugger.cpp23
1 files changed, 7 insertions, 16 deletions
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index fe2815029ca..3774d75cc7e 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -821,31 +821,22 @@ void Debugger::SetAsyncExecution(bool async_execution) {
repro::DataRecorder *Debugger::GetInputRecorder() { return m_input_recorder; }
-void Debugger::SetInputFileHandle(FILE *fh, bool tranfer_ownership,
- repro::DataRecorder *recorder) {
+void Debugger::SetInputFile(FileSP file_sp, repro::DataRecorder *recorder) {
+ assert(file_sp && file_sp->IsValid());
m_input_recorder = recorder;
-
- m_input_file_sp = std::make_shared<File>(fh, tranfer_ownership);
- if (!m_input_file_sp->IsValid())
- m_input_file_sp = std::make_shared<File>(stdin, false);
-
+ m_input_file_sp = file_sp;
// Save away the terminal state if that is relevant, so that we can restore
// it in RestoreInputState.
SaveInputTerminalState();
}
-void Debugger::SetOutputFileHandle(FILE *fh, bool tranfer_ownership) {
- FileSP file_sp = std::make_shared<File>(fh, tranfer_ownership);
- if (!file_sp->IsValid())
- file_sp = std::make_shared<File>(stdout, false);
+void Debugger::SetOutputFile(FileSP file_sp) {
+ assert(file_sp && file_sp->IsValid());
m_output_stream_sp = std::make_shared<StreamFile>(file_sp);
-
}
-void Debugger::SetErrorFileHandle(FILE *fh, bool tranfer_ownership) {
- FileSP file_sp = std::make_shared<File>(fh, tranfer_ownership);
- if (!file_sp->IsValid())
- file_sp = std::make_shared<File>(stderr, false);
+void Debugger::SetErrorFile(FileSP file_sp) {
+ assert(file_sp && file_sp->IsValid());
m_error_stream_sp = std::make_shared<StreamFile>(file_sp);
}
OpenPOWER on IntegriCloud