Work in progress for:

rdar://problem/10577182
Audit lldb API impl for places where we need to perform a NULL check

Add NULL checks for SBStream APIs.

llvm-svn: 146934
This commit is contained in:
Johnny Chen 2011-12-20 00:41:28 +00:00
parent 98a52db80c
commit 4f8189bc6b
2 changed files with 7 additions and 1 deletions

View File

@ -59,6 +59,8 @@ SBStream::GetSize()
void
SBStream::Printf (const char *format, ...)
{
if (!format)
return;
va_list args;
va_start (args, format);
ref().PrintfVarArg (format, args);

View File

@ -74,7 +74,11 @@ class SourceManagerTestCase(TestBase):
# 6 }
self.expect(stream.GetData(), "Source code displayed correctly",
exe=False,
patterns = ['=> %d.*Hello world' % self.line])
patterns = ['=> %d.*Hello world' % self.line])
# Boundary condition testings for SBStream(). LLDB should not crash!
stream.Printf(None)
stream.RedirectToFile(None, True)
def move_and_then_display_source(self):
"""Test that target.source-map settings work by moving main.c to hidden/main.c."""