diff --git a/lldb/bindings/interface/SBStream.i b/lldb/bindings/interface/SBStream.i --- a/lldb/bindings/interface/SBStream.i +++ b/lldb/bindings/interface/SBStream.i @@ -62,14 +62,8 @@ size_t GetSize(); - // wrapping the variadic Printf() with a plain Print() - // because it is hard to support varargs in SWIG bridgings - %extend { - void Print (const char* str) - { - self->Printf("%s", str); - } - } + void + Print (const char* str); void RedirectToFile (const char *path, bool append); diff --git a/lldb/include/lldb/API/SBStream.h b/lldb/include/lldb/API/SBStream.h --- a/lldb/include/lldb/API/SBStream.h +++ b/lldb/include/lldb/API/SBStream.h @@ -37,6 +37,8 @@ void Printf(const char *format, ...) __attribute__((format(printf, 2, 3))); + void Print(const char *str); + void RedirectToFile(const char *path, bool append); void RedirectToFile(lldb::SBFile file); diff --git a/lldb/source/API/SBStream.cpp b/lldb/source/API/SBStream.cpp --- a/lldb/source/API/SBStream.cpp +++ b/lldb/source/API/SBStream.cpp @@ -60,6 +60,12 @@ return static_cast(m_opaque_up.get())->GetSize(); } +void SBStream::Print(const char *str) { + LLDB_RECORD_METHOD(void, SBStream, Print, (const char *), str); + + Printf("%s", str); +} + void SBStream::Printf(const char *format, ...) { if (!format) return; @@ -204,6 +210,7 @@ LLDB_REGISTER_METHOD(void, SBStream, RedirectToFileHandle, (FILE *, bool)); LLDB_REGISTER_METHOD(void, SBStream, RedirectToFileDescriptor, (int, bool)); LLDB_REGISTER_METHOD(void, SBStream, Clear, ()); + LLDB_REGISTER_METHOD(void, SBStream, Print, (const char *)); } }