aboutsummaryrefslogtreecommitdiff
path: root/source/Core
diff options
context:
space:
mode:
Diffstat (limited to 'source/Core')
-rw-r--r--source/Core/CMakeLists.txt76
-rw-r--r--source/Core/Makefile14
-rw-r--r--source/Core/StringList.cpp37
3 files changed, 127 insertions, 0 deletions
diff --git a/source/Core/CMakeLists.txt b/source/Core/CMakeLists.txt
new file mode 100644
index 000000000000..b975fb88e784
--- /dev/null
+++ b/source/Core/CMakeLists.txt
@@ -0,0 +1,76 @@
+add_lldb_library(lldbCore
+ Address.cpp
+ AddressRange.cpp
+ AddressResolver.cpp
+ AddressResolverFileLine.cpp
+ AddressResolverName.cpp
+ ArchSpec.cpp
+ Baton.cpp
+ Broadcaster.cpp
+ Communication.cpp
+ Connection.cpp
+ ConnectionMachPort.cpp
+ ConnectionSharedMemory.cpp
+ ConstString.cpp
+ CxaDemangle.cpp
+ DataBufferHeap.cpp
+ DataBufferMemoryMap.cpp
+ DataEncoder.cpp
+ DataExtractor.cpp
+ Debugger.cpp
+ Disassembler.cpp
+ DynamicLoader.cpp
+ EmulateInstruction.cpp
+ Error.cpp
+ Event.cpp
+ FastDemangle.cpp
+ FileLineResolver.cpp
+ FileSpecList.cpp
+ FormatEntity.cpp
+ History.cpp
+ IOHandler.cpp
+ Listener.cpp
+ Log.cpp
+ Logging.cpp
+ Mangled.cpp
+ Module.cpp
+ ModuleChild.cpp
+ ModuleList.cpp
+ Opcode.cpp
+ PluginManager.cpp
+ RegisterValue.cpp
+ RegularExpression.cpp
+ Scalar.cpp
+ SearchFilter.cpp
+ Section.cpp
+ SourceManager.cpp
+ State.cpp
+ Stream.cpp
+ StreamAsynchronousIO.cpp
+ StreamCallback.cpp
+ StreamFile.cpp
+ StreamGDBRemote.cpp
+ StreamString.cpp
+ StringList.cpp
+ StructuredData.cpp
+ Timer.cpp
+ UserID.cpp
+ UserSettingsController.cpp
+ UUID.cpp
+ Value.cpp
+ ValueObject.cpp
+ ValueObjectCast.cpp
+ ValueObjectChild.cpp
+ ValueObjectConstResult.cpp
+ ValueObjectConstResultCast.cpp
+ ValueObjectConstResultChild.cpp
+ ValueObjectConstResultImpl.cpp
+ ValueObjectDynamicValue.cpp
+ ValueObjectList.cpp
+ ValueObjectMemory.cpp
+ ValueObjectRegister.cpp
+ ValueObjectSyntheticFilter.cpp
+ ValueObjectVariable.cpp
+ VMRange.cpp
+ )
+
diff --git a/source/Core/Makefile b/source/Core/Makefile
new file mode 100644
index 000000000000..b7773e3f571d
--- /dev/null
+++ b/source/Core/Makefile
@@ -0,0 +1,14 @@
+##===- source/Core/Makefile --------------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LLDB_LEVEL := ../..
+LIBRARYNAME := lldbCore
+BUILD_ARCHIVE = 1
+
+include $(LLDB_LEVEL)/Makefile
diff --git a/source/Core/StringList.cpp b/source/Core/StringList.cpp
index 4e07ba4a4579..ce197ac7bd48 100644
--- a/source/Core/StringList.cpp
+++ b/source/Core/StringList.cpp
@@ -11,6 +11,8 @@
#include "lldb/Core/StreamString.h"
#include "lldb/Host/FileSpec.h"
+#include "lldb/Core/Log.h"
+#include "lldb/Core/StreamString.h"
#include <string>
@@ -305,12 +307,29 @@ StringList::operator << (const char* str)
}
StringList&
+StringList::operator << (const std::string& str)
+{
+ AppendString(str);
+ return *this;
+}
+
+StringList&
StringList::operator << (StringList strings)
{
AppendList(strings);
return *this;
}
+StringList&
+StringList::operator = (const std::vector<std::string> &rhs)
+{
+ Clear();
+ for (const auto &s : rhs)
+ m_strings.push_back(s);
+
+ return *this;
+}
+
size_t
StringList::AutoComplete (const char *s, StringList &matches, size_t &exact_idx) const
{
@@ -339,3 +358,21 @@ StringList::AutoComplete (const char *s, StringList &matches, size_t &exact_idx)
return matches.GetSize();
}
+void
+StringList::LogDump(Log *log, const char *name)
+{
+ if (!log)
+ return;
+
+ StreamString strm;
+ if (name)
+ strm.Printf("Begin %s:\n", name);
+ for (const auto &s : m_strings) {
+ strm.Indent();
+ strm.Printf("%s\n", s.c_str());
+ }
+ if (name)
+ strm.Printf("End %s.\n", name);
+
+ log->Debug("%s", strm.GetData());
+}