summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBDebugger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/API/SBDebugger.cpp')
-rw-r--r--lldb/source/API/SBDebugger.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp
index 4d27b43e675..1da6ed26b24 100644
--- a/lldb/source/API/SBDebugger.cpp
+++ b/lldb/source/API/SBDebugger.cpp
@@ -292,6 +292,11 @@ void SBDebugger::SetInputFileHandle(FILE *fh, bool transfer_ownership) {
SetInputFile((FileSP)std::make_shared<NativeFile>(fh, transfer_ownership));
}
+SBError SBDebugger::SetInputFile(FileSP file_sp) {
+ LLDB_RECORD_METHOD(SBError, SBDebugger, SetInputFile, (FileSP), file_sp);
+ return SetInputFile(SBFile(file_sp));
+}
+
// Shouldn't really be settable after initialization as this could cause lots
// of problems; don't want users trying to switch modes in the middle of a
// debugging session.
@@ -332,6 +337,11 @@ SBError SBDebugger::SetInputFile(SBFile file) {
return error;
}
+SBError SBDebugger::SetOutputFile(FileSP file_sp) {
+ LLDB_RECORD_METHOD(SBError, SBDebugger, SetOutputFile, (FileSP), file_sp);
+ return SetOutputFile(SBFile(file_sp));
+}
+
void SBDebugger::SetOutputFileHandle(FILE *fh, bool transfer_ownership) {
LLDB_RECORD_METHOD(void, SBDebugger, SetOutputFileHandle, (FILE *, bool), fh,
transfer_ownership);
@@ -359,6 +369,11 @@ void SBDebugger::SetErrorFileHandle(FILE *fh, bool transfer_ownership) {
SetErrorFile((FileSP)std::make_shared<NativeFile>(fh, transfer_ownership));
}
+SBError SBDebugger::SetErrorFile(FileSP file_sp) {
+ LLDB_RECORD_METHOD(SBError, SBDebugger, SetErrorFile, (FileSP), file_sp);
+ return SetErrorFile(SBFile(file_sp));
+}
+
SBError SBDebugger::SetErrorFile(SBFile file) {
LLDB_RECORD_METHOD(SBError, SBDebugger, SetErrorFile, (SBFile file), file);
SBError error;
@@ -1576,6 +1591,8 @@ static void SetFileHandleRedirect(SBDebugger *, FILE *, bool) {
static SBError SetFileRedirect(SBDebugger *, SBFile file) { return SBError(); }
+static SBError SetFileRedirect(SBDebugger *, FileSP file) { return SBError(); }
+
static bool GetDefaultArchitectureRedirect(char *arch_name,
size_t arch_name_len) {
// The function is writing to its argument. Without the redirect it would
@@ -1606,6 +1623,16 @@ template <> void RegisterMethods<SBDebugger>(Registry &R) {
SBFile)>::method<&SBDebugger::SetErrorFile>::doit,
&SetFileRedirect);
+ R.Register(&invoke<SBError (SBDebugger::*)(
+ FileSP)>::method<&SBDebugger::SetInputFile>::doit,
+ &SetFileRedirect);
+ R.Register(&invoke<SBError (SBDebugger::*)(
+ FileSP)>::method<&SBDebugger::SetOutputFile>::doit,
+ &SetFileRedirect);
+ R.Register(&invoke<SBError (SBDebugger::*)(
+ FileSP)>::method<&SBDebugger::SetErrorFile>::doit,
+ &SetFileRedirect);
+
LLDB_REGISTER_CONSTRUCTOR(SBDebugger, ());
LLDB_REGISTER_CONSTRUCTOR(SBDebugger, (const lldb::DebuggerSP &));
LLDB_REGISTER_CONSTRUCTOR(SBDebugger, (const lldb::SBDebugger &));
OpenPOWER on IntegriCloud