diff options
Diffstat (limited to 'lldb/source/Host/macosx')
| -rw-r--r-- | lldb/source/Host/macosx/Host.mm | 35 | ||||
| -rw-r--r-- | lldb/source/Host/macosx/Makefile | 16 | ||||
| -rw-r--r-- | lldb/source/Host/macosx/Symbols.cpp | 7 |
3 files changed, 39 insertions, 19 deletions
diff --git a/lldb/source/Host/macosx/Host.mm b/lldb/source/Host/macosx/Host.mm index 4aee4445b61..b2ca2bb6ce9 100644 --- a/lldb/source/Host/macosx/Host.mm +++ b/lldb/source/Host/macosx/Host.mm @@ -23,9 +23,9 @@ #include <Foundation/Foundation.h> -#include "CFCBundle.h" -#include "CFCReleaser.h" -#include "CFCString.h" +#include "cfcpp/CFCBundle.h" +#include "cfcpp/CFCReleaser.h" +#include "cfcpp/CFCString.h" #include "lldb/Host/Host.h" #include "lldb/Core/ArchSpec.h" @@ -434,7 +434,7 @@ Host::SetThreadName (lldb::pid_t pid, lldb::tid_t tid, const char *name) // Set the pthread name if possible if (pid == curr_pid && tid == curr_tid) { - ::pthread_setname_np (name) == 0; + ::pthread_setname_np (name); } #endif ThreadNameAccessor (false, pid, tid, name); @@ -446,21 +446,22 @@ Host::GetProgramFileSpec () static FileSpec g_program_filepsec; if (!g_program_filepsec) { - std::string program_fullpath; - program_fullpath.resize (PATH_MAX); + char program_fullpath[PATH_MAX]; // If DST is NULL, then return the number of bytes needed. - uint32_t len = program_fullpath.size(); - int err = _NSGetExecutablePath ((char *)program_fullpath.data(), &len); - if (err < 0) + uint32_t len = sizeof(program_fullpath); + int err = _NSGetExecutablePath (program_fullpath, &len); + if (err == 0) + g_program_filepsec.SetFile (program_fullpath); + else if (err == -1) { - // The path didn't fit in the buffer provided, increase its size - // and try again - program_fullpath.resize(len); - len = program_fullpath.size(); - err = _NSGetExecutablePath ((char *)program_fullpath.data(), &len); + char *large_program_fullpath = (char *)::malloc (len + 1); + + err = _NSGetExecutablePath (large_program_fullpath, &len); + if (err == 0) + g_program_filepsec.SetFile (large_program_fullpath); + + ::free (large_program_fullpath); } - if (err == 0) - g_program_filepsec.SetFile(program_fullpath.data()); } return g_program_filepsec; } @@ -505,7 +506,7 @@ Host::ResolveExecutableInBundle (FileSpec *file) struct MonitorInfo { - int handle; + uint32_t handle; pthread_t thread; Host::MonitorChildProcessCallback callback; void *callback_baton; diff --git a/lldb/source/Host/macosx/Makefile b/lldb/source/Host/macosx/Makefile new file mode 100644 index 00000000000..de505891d76 --- /dev/null +++ b/lldb/source/Host/macosx/Makefile @@ -0,0 +1,16 @@ +##===- source/Host/macosx/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 := lldbHostMacOSX +BUILD_ARCHIVE = 1 + +SOURCES := $(notdir $(wildcard *.cpp *.mm)) + +include $(LLDB_LEVEL)/Makefile diff --git a/lldb/source/Host/macosx/Symbols.cpp b/lldb/source/Host/macosx/Symbols.cpp index 2b8026f7985..ccdde69bcbf 100644 --- a/lldb/source/Host/macosx/Symbols.cpp +++ b/lldb/source/Host/macosx/Symbols.cpp @@ -19,20 +19,23 @@ #include <CoreFoundation/CoreFoundation.h> // Project includes -#include "CFCReleaser.h" #include "lldb/Core/ArchSpec.h" #include "lldb/Core/DataBuffer.h" #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Timer.h" #include "lldb/Core/UUID.h" +#include "Host/macosx/cfcpp/CFCReleaser.h" + using namespace lldb; using namespace lldb_private; extern "C" { + CFURLRef DBGCopyFullDSYMURLForUUID (CFUUIDRef uuid, CFURLRef exec_url); CFDictionaryRef DBGCopyDSYMPropertyLists (CFURLRef dsym_url); -}; + +} static bool SkinnyMachOFileContainsArchAndUUID |

