summaryrefslogtreecommitdiffstats
path: root/lldb/source/API
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2010-12-11 01:20:39 +0000
committerJohnny Chen <johnny.chen@apple.com>2010-12-11 01:20:39 +0000
commitf6eaba85a8c385795d94cf97e5633d08f2bb04c4 (patch)
treee71c6a8acf16c1f522366fd1ef237a4d5cfd2831 /lldb/source/API
parent92da7052617dc26e24da2d2ee1040c348e435f77 (diff)
downloadbcm5719-llvm-f6eaba85a8c385795d94cf97e5633d08f2bb04c4.tar.gz
bcm5719-llvm-f6eaba85a8c385795d94cf97e5633d08f2bb04c4.zip
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
Diffstat (limited to 'lldb/source/API')
-rw-r--r--lldb/source/API/SBSourceManager.cpp10
-rw-r--r--lldb/source/API/SBStream.cpp2
2 files changed, 5 insertions, 7 deletions
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)
{
}
OpenPOWER on IntegriCloud