From f6eaba85a8c385795d94cf97e5633d08f2bb04c4 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Sat, 11 Dec 2010 01:20:39 +0000 Subject: Add test_display_source_python() test case to TestSourceManager.py which uses the lldb PyThon API SBSourceManager to display source files. To accomodate this, the C++ SBSourceManager API has been changed to take an lldb::SBStream as the destination for display of source lines. Modify SBStream::ctor() so that its opaque pointer is initialized with an StreamString instance. llvm-svn: 121605 --- lldb/source/API/SBSourceManager.cpp | 10 ++++------ lldb/source/API/SBStream.cpp | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'lldb/source/API') diff --git a/lldb/source/API/SBSourceManager.cpp b/lldb/source/API/SBSourceManager.cpp index 32f792d8220..0fa98e35dea 100644 --- a/lldb/source/API/SBSourceManager.cpp +++ b/lldb/source/API/SBSourceManager.cpp @@ -9,6 +9,7 @@ #include "lldb/API/SBSourceManager.h" +#include "lldb/API/SBStream.h" #include "lldb/API/SBFileSpec.h" #include "lldb/Core/Stream.h" @@ -49,26 +50,23 @@ SBSourceManager::DisplaySourceLinesWithLineNumbers uint32_t context_before, uint32_t context_after, const char* current_line_cstr, - FILE *f + SBStream &s ) { if (m_opaque_ptr == NULL) return 0; - if (f == NULL) + if (s.m_opaque_ap.get() == NULL) return 0; if (file.IsValid()) { - StreamFile str (f); - - return m_opaque_ptr->DisplaySourceLinesWithLineNumbers (*file, line, context_before, context_after, current_line_cstr, - &str); + s.m_opaque_ap.get()); } return 0; } diff --git a/lldb/source/API/SBStream.cpp b/lldb/source/API/SBStream.cpp index 55714fd4128..b8a18a14033 100644 --- a/lldb/source/API/SBStream.cpp +++ b/lldb/source/API/SBStream.cpp @@ -17,7 +17,7 @@ using namespace lldb; using namespace lldb_private; SBStream::SBStream () : - m_opaque_ap (), + m_opaque_ap (new StreamString()), m_is_file (false) { } -- cgit v1.2.3