[Lldb-commits] [lldb] r157643 - in /lldb/trunk: include/lldb/Core/StreamString.h source/Core/StreamString.cpp source/Interpreter/CommandObject.cpp
Johnny Chen
johnny.chen at apple.com
Tue May 29 13:04:10 PDT 2012
Author: johnny
Date: Tue May 29 15:04:10 2012
New Revision: 157643
URL: http://llvm.org/viewvc/llvm-project?rev=157643&view=rev
Log:
Fix arch_helper() to return the list of supported architectures.
Modified:
lldb/trunk/include/lldb/Core/StreamString.h
lldb/trunk/source/Core/StreamString.cpp
lldb/trunk/source/Interpreter/CommandObject.cpp
Modified: lldb/trunk/include/lldb/Core/StreamString.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/StreamString.h?rev=157643&r1=157642&r2=157643&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/StreamString.h (original)
+++ lldb/trunk/include/lldb/Core/StreamString.h Tue May 29 15:04:10 2012
@@ -37,6 +37,9 @@
void
Clear();
+ bool
+ Empty() const;
+
const char *
GetData () const;
Modified: lldb/trunk/source/Core/StreamString.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/StreamString.cpp?rev=157643&r1=157642&r2=157643&view=diff
==============================================================================
--- lldb/trunk/source/Core/StreamString.cpp (original)
+++ lldb/trunk/source/Core/StreamString.cpp Tue May 29 15:04:10 2012
@@ -47,6 +47,12 @@
m_packet.clear();
}
+bool
+StreamString::Empty() const
+{
+ return GetSize() == 0;
+}
+
const char *
StreamString::GetData () const
{
Modified: lldb/trunk/source/Interpreter/CommandObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandObject.cpp?rev=157643&r1=157642&r2=157643&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandObject.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandObject.cpp Tue May 29 15:04:10 2012
@@ -850,12 +850,12 @@
const char *arch_helper()
{
static StreamString g_archs_help;
- if (g_archs_help.GetData() == NULL)
+ if (g_archs_help.Empty())
{
StringList archs;
ArchSpec::AutoComplete(NULL, archs);
g_archs_help.Printf("These are the supported architecture names:\n");
- archs.Join("%s\n", g_archs_help);
+ archs.Join("\n", g_archs_help);
}
return g_archs_help.GetData();
}
More information about the lldb-commits
mailing list