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
This commit is contained in:
Johnny Chen
2010-12-11 01:20:39 +00:00
parent 92da705261
commit f6eaba85a8
5 changed files with 51 additions and 8 deletions

View File

@@ -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;
}