From 31a6961c13ba67e82d84f3b4c8f4a73abb18c687 Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Thu, 4 Oct 2012 02:16:06 +0000 Subject: [PATCH] Patch submitted by Dan Malea -- I introduced a dependency between ProcessGDBRemote and DynamicLoaderDarwinKernel and a patch was needed to get this building on Linux. Thanks! llvm-svn: 165193 --- lldb/lib/Makefile | 8 ++++++-- .../Darwin-Kernel/DynamicLoaderDarwinKernel.cpp | 3 ++- lldb/source/Plugins/Makefile | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lldb/lib/Makefile b/lldb/lib/Makefile index 3424492e6854..87f805f6ba25 100644 --- a/lldb/lib/Makefile +++ b/lldb/lib/Makefile @@ -85,9 +85,13 @@ ifeq ($(HOST_OS),Darwin) endif ifeq ($(HOST_OS),Linux) - USEDLIBS += lldbPluginProcessPOSIX.a \ + USEDLIBS += lldbHostLinux.a \ lldbPluginProcessLinux.a \ - lldbHostLinux.a + lldbPluginProcessPOSIX.a \ + lldbPluginDynamicLoaderMacOSX.a \ + lldbPluginDynamicLoaderDarwinKernel.a \ + lldbPluginOperatingSystemDarwinKernel.a + endif ifeq ($(HOST_OS),FreeBSD) diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp index 67a3b16b0f89..eb172ed00077 100644 --- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp +++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp @@ -409,7 +409,8 @@ DynamicLoaderDarwinKernel::LoadKernelModuleIfNeeded() { kernel_name = m_kernel.module_sp->GetObjectFile()->GetFileSpec().GetFilename(); } - strlcpy (m_kernel.name, kernel_name.AsCString(), sizeof(m_kernel.name)); + strncpy (m_kernel.name, kernel_name.AsCString(), sizeof(m_kernel.name)); + m_kernel.name[sizeof (m_kernel.name) - 1] = '\0'; if (m_kernel.address == LLDB_INVALID_ADDRESS) { diff --git a/lldb/source/Plugins/Makefile b/lldb/source/Plugins/Makefile index 148cffce938e..543b5dbef28b 100644 --- a/lldb/source/Plugins/Makefile +++ b/lldb/source/Plugins/Makefile @@ -33,6 +33,8 @@ DIRS += Process/mach-core endif ifeq ($(HOST_OS),Linux) +DIRS += DynamicLoader/MacOSX-DYLD DynamicLoader/Darwin-Kernel +DIRS += OperatingSystem/Darwin-Kernel DIRS += Process/Linux Process/POSIX endif