diff options
Diffstat (limited to 'lldb')
62 files changed, 237 insertions, 187 deletions
diff --git a/lldb/include/lldb/Host/File.h b/lldb/include/lldb/Host/File.h index e2c44fa5c0d..1270c5aa65d 100644 --- a/lldb/include/lldb/Host/File.h +++ b/lldb/include/lldb/Host/File.h @@ -20,6 +20,7 @@ // Project includes #include "lldb/lldb-private.h" #include "lldb/Host/IOObject.h" +#include "lldb/Host/PosixApi.h" namespace lldb_private { diff --git a/lldb/include/lldb/Host/PosixApi.h b/lldb/include/lldb/Host/PosixApi.h new file mode 100644 index 00000000000..72f97a14296 --- /dev/null +++ b/lldb/include/lldb/Host/PosixApi.h @@ -0,0 +1,23 @@ +//===-- PosixApi.h ----------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef liblldb_Host_PosixApi_h +#define liblldb_Host_PosixApi_h + +// This file defines platform specific functions, macros, and types necessary +// to provide a minimum level of compatibility across all platforms to rely +// on various posix api functionality. + +#include "llvm/Support/Compiler.h" + +#if defined(LLVM_ON_WIN32) +#include "lldb/Host/windows/PosixApi.h" +#endif + +#endif
\ No newline at end of file diff --git a/lldb/include/lldb/Host/TimeValue.h b/lldb/include/lldb/Host/TimeValue.h index 6de2bfd16a0..2ddea46e33f 100644 --- a/lldb/include/lldb/Host/TimeValue.h +++ b/lldb/include/lldb/Host/TimeValue.h @@ -12,11 +12,7 @@ // C Includes #include <stdint.h> -#ifndef _MSC_VER -#include <sys/time.h> - - -#endif +#include "lldb/Host/PosixApi.h" // C++ Includes // Other libraries and framework includes diff --git a/lldb/include/lldb/Host/windows/win32.h b/lldb/include/lldb/Host/windows/PosixApi.h index 2789a4b84f0..a8a179e56ee 100644 --- a/lldb/include/lldb/Host/windows/win32.h +++ b/lldb/include/lldb/Host/windows/PosixApi.h @@ -1,4 +1,4 @@ -//===-- lldb-win32.h --------------------------------------------*- C++ -*-===// +//===-- windows/PosixApi.h --------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -7,16 +7,19 @@ // //===----------------------------------------------------------------------===// -#ifndef LLDB_lldb_win32_h_ -#define LLDB_lldb_win32_h_ +#ifndef liblldb_Host_windows_PosixApi_h +#define liblldb_Host_windows_PosixApi_h +#include "llvm/Support/Compiler.h" +#if !defined(LLVM_ON_WIN32) +#error "windows/PosixApi.h being #included on non Windows system!" +#endif + +// va_start, va_end, etc macros. #include <stdarg.h> -#include <time.h> -// posix utilities -int vasprintf(char **ret, const char *fmt, va_list ap); -char * strcasestr(const char *s, const char* find); -char* realpath(const char * name, char * resolved); +// time_t, timespec, etc. +#include <time.h> #ifndef PATH_MAX #define PATH_MAX 32768 @@ -45,17 +48,48 @@ char* realpath(const char * name, char * resolved); #ifdef _MSC_VER +// PRIxxx format macros for printf() #include <inttypes.h> -#include <stdint.h> + +// open(), close(), creat(), etc. #include <io.h> + + typedef unsigned short mode_t; -#ifdef LLDB_DISABLE_PYTHON +// pyconfig.h typedefs this. We require python headers to be included before any +// LLDB headers, but there's no way to prevent python's pid_t definition from +// leaking, so this is the best option. +#ifndef Py_CONFIG_H typedef uint32_t pid_t; -#endif // LLDB_DISABLE_PYTHON +#endif + +#define STDIN_FILENO 0 +#define STDOUT_FILENO 1 +#define STDERR_FILENO 2 + +#define S_IFDIR _S_IFDIR +#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) + +#endif // _MSC_VER + +// MSVC 2015 and higher have timespec. Otherwise we need to define it ourselves. +#if !defined(_MSC_VER) || _MSC_VER < 1900 +struct timespec +{ + time_t tv_sec; + long tv_nsec; +}; +#endif -int usleep(uint32_t useconds); +// Various useful posix functions that are not present in Windows. We provide +// custom implementations. +int vasprintf(char **ret, const char *fmt, va_list ap); +char * strcasestr(const char *s, const char* find); +char* realpath(const char * name, char * resolved); + +int usleep(uint32_t useconds); char* getcwd(char* path, int max); int chdir(const char* path); char* basename(char *path); @@ -64,44 +98,35 @@ char *dirname(char *path); int strcasecmp(const char* s1, const char* s2); int strncasecmp(const char* s1, const char* s2, size_t n); +// empty functions +inline int posix_openpt(int flag) { LLVM_BUILTIN_UNREACHABLE; } + +inline int strerror_r(int errnum, char *buf, size_t buflen) { LLVM_BUILTIN_UNREACHABLE; } + +inline int unlockpt(int fd) { LLVM_BUILTIN_UNREACHABLE; } +inline int grantpt(int fd) { LLVM_BUILTIN_UNREACHABLE; } +inline char *ptsname(int fd) { LLVM_BUILTIN_UNREACHABLE; } + +inline pid_t fork(void) { LLVM_BUILTIN_UNREACHABLE; } +inline pid_t setsid(void) { LLVM_BUILTIN_UNREACHABLE; } + + +// vsnprintf and snprintf are provided in MSVC 2015 and higher. #if _MSC_VER < 1900 namespace lldb_private { -int vsnprintf(char *buffer, size_t count, const char *format, va_list argptr); + int vsnprintf(char *buffer, size_t count, const char *format, va_list argptr); } // inline to avoid linkage conflicts int inline snprintf(char *buffer, size_t count, const char *format, ...) { - va_list argptr; - va_start(argptr, format); - int r = lldb_private::vsnprintf(buffer, count, format, argptr); - va_end(argptr); - return r; + va_list argptr; + va_start(argptr, format); + int r = lldb_private::vsnprintf(buffer, count, format, argptr); + va_end(argptr); + return r; } #endif -#define STDIN_FILENO 0 -#define STDOUT_FILENO 1 -#define STDERR_FILENO 2 - -#define __PRETTY_FUNCTION__ __FUNCSIG__ - -#define S_IFDIR _S_IFDIR -#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) -#endif // _MSC_VER - -// timespec -// MSVC 2015 and higher have timespec. Otherwise we need to define it ourselves. -#if defined(_MSC_VER) && _MSC_VER >= 1900 -#include <time.h> -#else -struct timespec -{ - time_t tv_sec; - long tv_nsec; -}; #endif - - -#endif // LLDB_lldb_win32_h_ diff --git a/lldb/include/lldb/lldb-private.h b/lldb/include/lldb/lldb-private.h index 8cc585f923e..12da992ac12 100644 --- a/lldb/include/lldb/lldb-private.h +++ b/lldb/include/lldb/lldb-private.h @@ -12,10 +12,6 @@ #if defined(__cplusplus) -#ifdef _WIN32 -#include "lldb/Host/windows/win32.h" -#endif - #include "lldb/lldb-public.h" #include "lldb/lldb-private-enumerations.h" #include "lldb/lldb-private-interfaces.h" diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/main.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/main.cpp index 01f67913924..72ceb64a6fb 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/main.cpp @@ -16,15 +16,15 @@ namespace a { ~c(); void func1() { - puts (__PRETTY_FUNCTION__); + puts (LLVM_PRETTY_FUNCTION); } void func2() { - puts (__PRETTY_FUNCTION__); + puts (LLVM_PRETTY_FUNCTION); } void func3() { - puts (__PRETTY_FUNCTION__); + puts (LLVM_PRETTY_FUNCTION); } }; @@ -39,11 +39,11 @@ namespace b { ~c(); void func1() { - puts (__PRETTY_FUNCTION__); + puts (LLVM_PRETTY_FUNCTION); } void func3() { - puts (__PRETTY_FUNCTION__); + puts (LLVM_PRETTY_FUNCTION); } }; @@ -58,11 +58,11 @@ namespace c { ~d() {} void func2() { - puts (__PRETTY_FUNCTION__); + puts (LLVM_PRETTY_FUNCTION); } void func3() { - puts (__PRETTY_FUNCTION__); + puts (LLVM_PRETTY_FUNCTION); } }; } diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/diamond/main.cpp b/lldb/packages/Python/lldbsuite/test/lang/cpp/diamond/main.cpp index bfe098a089f..8065057304d 100644 --- a/lldb/packages/Python/lldbsuite/test/lang/cpp/diamond/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/diamond/main.cpp @@ -17,7 +17,7 @@ public: virtual ~VBase() {} void Print() { - printf("%p: %s\n%p: m_value = 0x%8.8x\n", this, __PRETTY_FUNCTION__, &m_value, m_value); + printf("%p: %s\n%p: m_value = 0x%8.8x\n", this, LLVM_PRETTY_FUNCTION, &m_value, m_value); } int m_value; }; @@ -28,7 +28,7 @@ public: Derived1() {}; void Print () { - printf("%p: %s\n", this, __PRETTY_FUNCTION__); + printf("%p: %s\n", this, LLVM_PRETTY_FUNCTION); VBase::Print(); } @@ -41,7 +41,7 @@ public: void Print () { - printf("%p: %s\n", this, __PRETTY_FUNCTION__); + printf("%p: %s\n", this, LLVM_PRETTY_FUNCTION); VBase::Print(); } }; @@ -56,7 +56,7 @@ public: { printf("%p: %s \n%p: m_joiner1 = 0x%8.8x\n%p: m_joiner2 = 0x%8.8x\n", this, - __PRETTY_FUNCTION__, + LLVM_PRETTY_FUNCTION, &m_joiner1, m_joiner1, &m_joiner2, diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual/main.cpp b/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual/main.cpp index 0adf4157731..04c665d1bfe 100644 --- a/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual/main.cpp @@ -10,17 +10,17 @@ public: virtual const char * a() { - return __PRETTY_FUNCTION__; + return LLVM_PRETTY_FUNCTION; } virtual const char * b() { - return __PRETTY_FUNCTION__; + return LLVM_PRETTY_FUNCTION; } virtual const char * c() { - return __PRETTY_FUNCTION__; + return LLVM_PRETTY_FUNCTION; } protected: char m_pad; @@ -34,7 +34,7 @@ public: virtual const char * aa() { - return __PRETTY_FUNCTION__; + return LLVM_PRETTY_FUNCTION; } protected: @@ -50,12 +50,12 @@ public: virtual const char * a() { - return __PRETTY_FUNCTION__; + return LLVM_PRETTY_FUNCTION; } virtual const char * b() { - return __PRETTY_FUNCTION__; + return LLVM_PRETTY_FUNCTION; } protected: char m_pad; @@ -70,7 +70,7 @@ public: virtual const char * a() { - return __PRETTY_FUNCTION__; + return LLVM_PRETTY_FUNCTION; } protected: char m_pad; diff --git a/lldb/packages/Python/lldbsuite/test/make/test_common.h b/lldb/packages/Python/lldbsuite/test/make/test_common.h index b0151afb892..575ca62c2fc 100644 --- a/lldb/packages/Python/lldbsuite/test/make/test_common.h +++ b/lldb/packages/Python/lldbsuite/test/make/test_common.h @@ -18,6 +18,12 @@ #include <eh.h> #endif +#if defined(_WIN32) +#define LLVM_PRETTY_FUNCTION __FUNCSIG__ +#else +#define LLVM_PRETTY_FUNCTION LLVM_PRETTY_FUNCTION +#endif + // On some systems (e.g., some versions of linux) it is not possible to attach to a process // without it giving us special permissions. This defines the lldb_enable_attach macro, which diff --git a/lldb/source/API/SystemInitializerFull.cpp b/lldb/source/API/SystemInitializerFull.cpp index e7fe5db66d9..8644757229c 100644 --- a/lldb/source/API/SystemInitializerFull.cpp +++ b/lldb/source/API/SystemInitializerFull.cpp @@ -438,7 +438,7 @@ void SystemInitializerFull::InitializeSWIG() void SystemInitializerFull::Terminate() { - Timer scoped_timer(__PRETTY_FUNCTION__, __PRETTY_FUNCTION__); + Timer scoped_timer(LLVM_PRETTY_FUNCTION, LLVM_PRETTY_FUNCTION); Debugger::SettingsTerminate(); diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index 9e535ba8ebd..d6cf0e346a9 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -269,7 +269,7 @@ protected: } const char *file_path = command.GetArgumentAtIndex(0); - Timer scoped_timer(__PRETTY_FUNCTION__, "(lldb) target create '%s'", file_path); + Timer scoped_timer(LLVM_PRETTY_FUNCTION, "(lldb) target create '%s'", file_path); FileSpec file_spec; if (file_path) diff --git a/lldb/source/Core/ConnectionSharedMemory.cpp b/lldb/source/Core/ConnectionSharedMemory.cpp index 707644d36b1..46948b842e0 100644 --- a/lldb/source/Core/ConnectionSharedMemory.cpp +++ b/lldb/source/Core/ConnectionSharedMemory.cpp @@ -27,12 +27,12 @@ // Other libraries and framework includes #include "llvm/Support/MathExtras.h" +#include "llvm/Support/ConvertUTF.h" // Project includes #include "lldb/Core/Communication.h" #include "lldb/Core/Log.h" - -#include "llvm/Support/ConvertUTF.h" +#include "lldb/Host/PosixApi.h" using namespace lldb; using namespace lldb_private; diff --git a/lldb/source/Core/CxaDemangle.cpp b/lldb/source/Core/CxaDemangle.cpp index 62335a9175c..4bb0af52e20 100644 --- a/lldb/source/Core/CxaDemangle.cpp +++ b/lldb/source/Core/CxaDemangle.cpp @@ -10,16 +10,15 @@ // - Added "#undef _LIBCPP_EXTERN_TEMPLATE" to avoid warning // - Implemented missing rebind, construct, destroy in malloc_alloc // - Replaced noexcept, constexpr, alignas with their LLVM_* equivalents -// - Included win32.h for snprintf implementation for MSVC +// - Included PosixApi.h for snprintf implementation for MSVC // - Removed constexpr member initialization for MSVC // - Changed argument to alignas() to a literal for MSVC // - Include <cstdio> for fprintf, stderr like entities. //---------------------------------------------------------------------- -#if defined(_MSC_VER) -#include "lldb/Host/windows/win32.h" // snprintf -#endif #include "llvm/Support/Compiler.h" // LLVM_{NOEXCEPT, CONSTEXPR, ALIGNAS} + +#include "lldb/Host/PosixApi.h" #include "lldb/lldb-private.h" #undef _LIBCPP_EXTERN_TEMPLATE // Avoid warning below diff --git a/lldb/source/Core/Disassembler.cpp b/lldb/source/Core/Disassembler.cpp index 1e6a245261b..2c22ee4cc39 100644 --- a/lldb/source/Core/Disassembler.cpp +++ b/lldb/source/Core/Disassembler.cpp @@ -48,7 +48,7 @@ using namespace lldb_private; DisassemblerSP Disassembler::FindPlugin (const ArchSpec &arch, const char *flavor, const char *plugin_name) { - Timer scoped_timer (__PRETTY_FUNCTION__, + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "Disassembler::FindPlugin (arch = %s, plugin_name = %s)", arch.GetArchitectureName(), plugin_name); diff --git a/lldb/source/Core/Error.cpp b/lldb/source/Core/Error.cpp index a9310237fdb..cc27a2d91b8 100644 --- a/lldb/source/Core/Error.cpp +++ b/lldb/source/Core/Error.cpp @@ -22,6 +22,7 @@ // Project includes #include "lldb/Core/Error.h" #include "lldb/Core/Log.h" +#include "lldb/Host/PosixApi.h" using namespace lldb; using namespace lldb_private; diff --git a/lldb/source/Core/Mangled.cpp b/lldb/source/Core/Mangled.cpp index 543b34e337a..31e78ced2c1 100644 --- a/lldb/source/Core/Mangled.cpp +++ b/lldb/source/Core/Mangled.cpp @@ -269,7 +269,7 @@ Mangled::GetDemangledName (lldb::LanguageType language) const if (m_mangled && !m_demangled) { // We need to generate and cache the demangled name. - Timer scoped_timer (__PRETTY_FUNCTION__, + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "Mangled::GetDemangledName (m_mangled = %s)", m_mangled.GetCString()); diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index 5fe39abda18..b7076c0f132 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -121,7 +121,7 @@ namespace lldb { Mutex::Locker locker (Module::GetAllocationModuleCollectionMutex()); ModuleCollection &modules = GetModuleCollection(); const size_t count = modules.size(); - printf ("%s: %" PRIu64 " modules:\n", __PRETTY_FUNCTION__, (uint64_t)count); + printf ("%s: %" PRIu64 " modules:\n", LLVM_PRETTY_FUNCTION, (uint64_t)count); for (size_t i = 0; i < count; ++i) { @@ -476,7 +476,7 @@ size_t Module::GetNumCompileUnits() { std::lock_guard<std::recursive_mutex> guard(m_mutex); - Timer scoped_timer(__PRETTY_FUNCTION__, + Timer scoped_timer(LLVM_PRETTY_FUNCTION, "Module::GetNumCompileUnits (module = %p)", static_cast<void*>(this)); SymbolVendor *symbols = GetSymbolVendor (); @@ -505,7 +505,7 @@ bool Module::ResolveFileAddress (lldb::addr_t vm_addr, Address& so_addr) { std::lock_guard<std::recursive_mutex> guard(m_mutex); - Timer scoped_timer(__PRETTY_FUNCTION__, "Module::ResolveFileAddress (vm_addr = 0x%" PRIx64 ")", vm_addr); + Timer scoped_timer(LLVM_PRETTY_FUNCTION, "Module::ResolveFileAddress (vm_addr = 0x%" PRIx64 ")", vm_addr); SectionList *section_list = GetSectionList(); if (section_list) return so_addr.ResolveAddressUsingFileSections(vm_addr, section_list); @@ -668,7 +668,7 @@ uint32_t Module::ResolveSymbolContextsForFileSpec (const FileSpec &file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, SymbolContextList& sc_list) { std::lock_guard<std::recursive_mutex> guard(m_mutex); - Timer scoped_timer(__PRETTY_FUNCTION__, + Timer scoped_timer(LLVM_PRETTY_FUNCTION, "Module::ResolveSymbolContextForFilePath (%s:%u, check_inlines = %s, resolve_scope = 0x%8.8x)", file_spec.GetPath().c_str(), line, @@ -1086,7 +1086,7 @@ Module::FindTypes_Impl (const SymbolContext& sc, llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files, TypeMap& types) { - Timer scoped_timer(__PRETTY_FUNCTION__, __PRETTY_FUNCTION__); + Timer scoped_timer(LLVM_PRETTY_FUNCTION, LLVM_PRETTY_FUNCTION); if (!sc.module_sp || sc.module_sp.get() == this) { SymbolVendor *symbols = GetSymbolVendor (); @@ -1191,7 +1191,7 @@ Module::GetSymbolVendor (bool can_create, lldb_private::Stream *feedback_strm) ObjectFile *obj_file = GetObjectFile (); if (obj_file != nullptr) { - Timer scoped_timer(__PRETTY_FUNCTION__, __PRETTY_FUNCTION__); + Timer scoped_timer(LLVM_PRETTY_FUNCTION, LLVM_PRETTY_FUNCTION); m_symfile_ap.reset(SymbolVendor::FindPlugin(shared_from_this(), feedback_strm)); m_did_load_symbol_vendor = true; } @@ -1438,7 +1438,7 @@ Module::GetObjectFile() std::lock_guard<std::recursive_mutex> guard(m_mutex); if (!m_did_load_objfile.load()) { - Timer scoped_timer(__PRETTY_FUNCTION__, + Timer scoped_timer(LLVM_PRETTY_FUNCTION, "Module::GetObjectFile () module = %s", GetFileSpec().GetFilename().AsCString("")); DataBufferSP data_sp; lldb::offset_t data_offset = 0; @@ -1509,7 +1509,7 @@ Module::GetUnifiedSectionList() const Symbol * Module::FindFirstSymbolWithNameAndType (const ConstString &name, SymbolType symbol_type) { - Timer scoped_timer(__PRETTY_FUNCTION__, + Timer scoped_timer(LLVM_PRETTY_FUNCTION, "Module::FindFirstSymbolWithNameAndType (name = %s, type = %i)", name.AsCString(), symbol_type); @@ -1547,7 +1547,7 @@ Module::FindFunctionSymbols (const ConstString &name, uint32_t name_type_mask, SymbolContextList& sc_list) { - Timer scoped_timer(__PRETTY_FUNCTION__, + Timer scoped_timer(LLVM_PRETTY_FUNCTION, "Module::FindSymbolsFunctions (name = %s, mask = 0x%8.8x)", name.AsCString(), name_type_mask); @@ -1567,7 +1567,7 @@ Module::FindSymbolsWithNameAndType (const ConstString &name, SymbolType symbol_t // No need to protect this call using m_mutex all other method calls are // already thread safe. - Timer scoped_timer(__PRETTY_FUNCTION__, + Timer scoped_timer(LLVM_PRETTY_FUNCTION, "Module::FindSymbolsWithNameAndType (name = %s, type = %i)", name.AsCString(), symbol_type); @@ -1592,7 +1592,7 @@ Module::FindSymbolsMatchingRegExAndType (const RegularExpression ®ex, SymbolT // No need to protect this call using m_mutex all other method calls are // already thread safe. - Timer scoped_timer(__PRETTY_FUNCTION__, + Timer scoped_timer(LLVM_PRETTY_FUNCTION, "Module::FindSymbolsMatchingRegExAndType (regex = %s, type = %i)", regex.GetText(), symbol_type); diff --git a/lldb/source/Core/Stream.cpp b/lldb/source/Core/Stream.cpp index 15876d558ec..172be772792 100644 --- a/lldb/source/Core/Stream.cpp +++ b/lldb/source/Core/Stream.cpp @@ -9,6 +9,7 @@ #include "lldb/Core/Stream.h" #include "lldb/Host/Endian.h" +#include "lldb/Host/PosixApi.h" #include <stddef.h> #include <stdio.h> #include <string.h> diff --git a/lldb/source/Host/common/NativeRegisterContext.cpp b/lldb/source/Host/common/NativeRegisterContext.cpp index e67c07964a4..5ed0a436233 100644 --- a/lldb/source/Host/common/NativeRegisterContext.cpp +++ b/lldb/source/Host/common/NativeRegisterContext.cpp @@ -14,6 +14,7 @@ #include "lldb/Host/common/NativeProcessProtocol.h" #include "lldb/Host/common/NativeThreadProtocol.h" +#include "lldb/Host/PosixApi.h" using namespace lldb; using namespace lldb_private; diff --git a/lldb/source/Host/common/SocketAddress.cpp b/lldb/source/Host/common/SocketAddress.cpp index 1dc43ea6294..74138007c4b 100644 --- a/lldb/source/Host/common/SocketAddress.cpp +++ b/lldb/source/Host/common/SocketAddress.cpp @@ -14,15 +14,15 @@ // C Includes #if !defined(_WIN32) #include <arpa/inet.h> -#else -#include "lldb/Host/windows/win32.h" #endif + #include <assert.h> #include <string.h> // C++ Includes // Other libraries and framework includes // Project includes +#include "lldb/Host/PosixApi.h" // WindowsXP needs an inet_ntop implementation #ifdef _WIN32 diff --git a/lldb/source/Host/common/Symbols.cpp b/lldb/source/Host/common/Symbols.cpp index 60e1dc6bf99..a6ecaf22024 100644 --- a/lldb/source/Host/common/Symbols.cpp +++ b/lldb/source/Host/common/Symbols.cpp @@ -169,7 +169,7 @@ LocateExecutableSymbolFileDsym (const ModuleSpec &module_spec) const ArchSpec *arch = module_spec.GetArchitecturePtr(); const UUID *uuid = module_spec.GetUUIDPtr(); - Timer scoped_timer (__PRETTY_FUNCTION__, + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "LocateExecutableSymbolFileDsym (file = %s, arch = %s, uuid = %p)", exec_fspec ? exec_fspec->GetFilename().AsCString ("<NULL>") : "<NULL>", arch ? arch->GetArchitectureName() : "<NULL>", @@ -198,7 +198,7 @@ Symbols::LocateExecutableObjectFile (const ModuleSpec &module_spec) const FileSpec *exec_fspec = module_spec.GetFileSpecPtr(); const ArchSpec *arch = module_spec.GetArchitecturePtr(); const UUID *uuid = module_spec.GetUUIDPtr(); - Timer scoped_timer (__PRETTY_FUNCTION__, + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "LocateExecutableObjectFile (file = %s, arch = %s, uuid = %p)", exec_fspec ? exec_fspec->GetFilename().AsCString ("<NULL>") : "<NULL>", arch ? arch->GetArchitectureName() : "<NULL>", diff --git a/lldb/source/Host/common/Terminal.cpp b/lldb/source/Host/common/Terminal.cpp index 9f3abb75e91..c59766a7edb 100644 --- a/lldb/source/Host/common/Terminal.cpp +++ b/lldb/source/Host/common/Terminal.cpp @@ -8,6 +8,8 @@ //===----------------------------------------------------------------------===// #include "lldb/Host/Terminal.h" + +#include "lldb/Host/PosixApi.h" #include "llvm/ADT/STLExtras.h" #include <fcntl.h> diff --git a/lldb/source/Host/windows/FileSystem.cpp b/lldb/source/Host/windows/FileSystem.cpp index 3e881f5d9b2..a3e0e4f82d1 100644 --- a/lldb/source/Host/windows/FileSystem.cpp +++ b/lldb/source/Host/windows/FileSystem.cpp @@ -112,7 +112,7 @@ Error FileSystem::SetFilePermissions(const FileSpec &file_spec, uint32_t file_permissions) { Error error; - error.SetErrorStringWithFormat("%s is not supported on this host", __PRETTY_FUNCTION__); + error.SetErrorStringWithFormat("%s is not supported on this host", LLVM_PRETTY_FUNCTION); return error; } diff --git a/lldb/source/Host/windows/Windows.cpp b/lldb/source/Host/windows/Windows.cpp index 2aebb10bcdd..a1ee5d6e313 100644 --- a/lldb/source/Host/windows/Windows.cpp +++ b/lldb/source/Host/windows/Windows.cpp @@ -10,7 +10,7 @@ // This file provides Windows support functions #include "lldb/Host/windows/windows.h" -#include "lldb/Host/windows/win32.h" +#include "lldb/Host/PosixApi.h" #include "llvm/Support/ConvertUTF.h" diff --git a/lldb/source/Initialization/SystemInitializerCommon.cpp b/lldb/source/Initialization/SystemInitializerCommon.cpp index 258f9c8872e..604432be059 100644 --- a/lldb/source/Initialization/SystemInitializerCommon.cpp +++ b/lldb/source/Initialization/SystemInitializerCommon.cpp @@ -79,7 +79,7 @@ SystemInitializerCommon::Initialize() Log::Initialize(); HostInfo::Initialize(); - Timer scoped_timer(__PRETTY_FUNCTION__, __PRETTY_FUNCTION__); + Timer scoped_timer(LLVM_PRETTY_FUNCTION, LLVM_PRETTY_FUNCTION); llvm::install_fatal_error_handler(fatal_error_handler, 0); @@ -115,7 +115,7 @@ SystemInitializerCommon::Initialize() void SystemInitializerCommon::Terminate() { - Timer scoped_timer(__PRETTY_FUNCTION__, __PRETTY_FUNCTION__); + Timer scoped_timer(LLVM_PRETTY_FUNCTION, LLVM_PRETTY_FUNCTION); ObjectContainerBSDArchive::Terminate(); ObjectFileELF::Terminate(); ObjectFilePECOFF::Terminate(); diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 5d5669f73cb..164881824fd 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -179,7 +179,7 @@ CommandInterpreter::GetSpaceReplPrompts () const void CommandInterpreter::Initialize () { - Timer scoped_timer (__PRETTY_FUNCTION__, __PRETTY_FUNCTION__); + Timer scoped_timer (LLVM_PRETTY_FUNCTION, LLVM_PRETTY_FUNCTION); CommandReturnObject result; @@ -424,7 +424,7 @@ CommandInterpreter::ProcessEmbeddedScriptCommands (const char *arg) void CommandInterpreter::LoadCommandDictionary () { - Timer scoped_timer (__PRETTY_FUNCTION__, __PRETTY_FUNCTION__); + Timer scoped_timer (LLVM_PRETTY_FUNCTION, LLVM_PRETTY_FUNCTION); lldb::ScriptLanguage script_language = m_debugger.GetScriptLanguage(); @@ -1558,7 +1558,7 @@ CommandInterpreter::HandleCommand (const char *command_line, if (log) log->Printf ("Processing command: %s", command_line); - Timer scoped_timer (__PRETTY_FUNCTION__, "Handling command: %s.", command_line); + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "Handling command: %s.", command_line); if (!no_context_switching) UpdateExecutionContext (override_context); diff --git a/lldb/source/Interpreter/OptionValueBoolean.cpp b/lldb/source/Interpreter/OptionValueBoolean.cpp index dae1f4b7a76..4ba03d250ac 100644 --- a/lldb/source/Interpreter/OptionValueBoolean.cpp +++ b/lldb/source/Interpreter/OptionValueBoolean.cpp @@ -15,6 +15,7 @@ // Project includes #include "lldb/Core/Stream.h" #include "lldb/Core/StringList.h" +#include "lldb/Host/PosixApi.h" #include "lldb/Interpreter/Args.h" #include "llvm/ADT/STLExtras.h" diff --git a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp index 884078b2717..a5c57cf0d8e 100644 --- a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp +++ b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp @@ -16,6 +16,7 @@ #include "lldb/Core/ConstString.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/Stream.h" +#include "lldb/Host/PosixApi.h" #include "lldb/Interpreter/OptionValueArray.h" #include "lldb/Interpreter/OptionValueDictionary.h" #include "lldb/Symbol/UnwindPlan.h" diff --git a/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp b/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp index 7b4b6aa0100..f558948e0d0 100644 --- a/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp +++ b/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp @@ -28,6 +28,7 @@ #include "lldb/Core/PluginManager.h" #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Stream.h" +#include "lldb/Host/PosixApi.h" #include "lldb/Symbol/UnwindPlan.h" #include "llvm/ADT/STLExtras.h" diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp index 2160274f2b3..53ac2a6536e 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -1919,7 +1919,7 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapIfNeeded() { Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_TYPES)); - Timer scoped_timer (__PRETTY_FUNCTION__, __PRETTY_FUNCTION__); + Timer scoped_timer (LLVM_PRETTY_FUNCTION, LLVM_PRETTY_FUNCTION); // Else we need to check with our process to see when the map was updated. Process *process = GetProcess(); diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp index 984a9ece12e..21435a99636 100644 --- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp +++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp @@ -357,7 +357,7 @@ ObjectContainerBSDArchive::CreateInstance data.SetData (data_sp, data_offset, length); if (file && data_sp && ObjectContainerBSDArchive::MagicBytesMatch(data)) { - Timer scoped_timer (__PRETTY_FUNCTION__, + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "ObjectContainerBSDArchive::CreateInstance (module = %s, file = %p, file_offset = 0x%8.8" PRIx64 ", file_size = 0x%8.8" PRIx64 ")", module_sp->GetFileSpec().GetPath().c_str(), static_cast<const void*>(file), diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index e6af68fdb01..6a372e42bea 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -747,7 +747,7 @@ ObjectFileELF::GetModuleSpecifications (const lldb_private::FileSpec& file, if (!gnu_debuglink_crc) { - lldb_private::Timer scoped_timer (__PRETTY_FUNCTION__, + lldb_private::Timer scoped_timer (LLVM_PRETTY_FUNCTION, "Calculating module crc32 %s with size %" PRIu64 " KiB", file.GetLastPathComponent().AsCString(), (file.GetByteSize()-file_offset)/1024); diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index 6c72ef8b1f5..789d404dc8f 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -2238,7 +2238,7 @@ ObjectFileMachO::GetSharedCacheUUID (FileSpec dyld_shared_cache, const ByteOrder size_t ObjectFileMachO::ParseSymtab () { - Timer scoped_timer(__PRETTY_FUNCTION__, + Timer scoped_timer(LLVM_PRETTY_FUNCTION, "ObjectFileMachO::ParseSymtab () module = %s", m_file.GetFilename().AsCString("")); ModuleSP module_sp (GetModule()); diff --git a/lldb/source/Plugins/Platform/Android/AdbClient.cpp b/lldb/source/Plugins/Platform/Android/AdbClient.cpp index 1b07ddba59f..05008169a5b 100644 --- a/lldb/source/Plugins/Platform/Android/AdbClient.cpp +++ b/lldb/source/Plugins/Platform/Android/AdbClient.cpp @@ -22,6 +22,7 @@ #include "lldb/Core/StreamString.h" #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/FileSpec.h" +#include "lldb/Host/PosixApi.h" #include <limits.h> diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp index 3051e7ddf0b..bb0dfcfdb35 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp @@ -243,7 +243,7 @@ CommunicationKDP::WaitForPacketWithTimeoutMicroSecondsNoLock (DataExtractor &pac if (log) log->Printf ("%s: Read (buffer, (sizeof(buffer), timeout_usec = 0x%x, status = %s, error = %s) => bytes_read = %" PRIu64, - __PRETTY_FUNCTION__, + LLVM_PRETTY_FUNCTION, timeout_usec, Communication::ConnectionStatusAsCString (status), error.AsCString(), diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index cd7bceeef1e..14fe8773597 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -391,7 +391,7 @@ GDBRemoteCommunication::WaitForPacketWithTimeoutMicroSecondsNoLock (StringExtrac if (log) log->Printf ("%s: Read (buffer, (sizeof(buffer), timeout_usec = 0x%x, status = %s, error = %s) => bytes_read = %" PRIu64, - __PRETTY_FUNCTION__, + LLVM_PRETTY_FUNCTION, timeout_usec, Communication::ConnectionStatusAsCString (status), error.AsCString(), diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index 0025161988c..23075e1bf55 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -989,7 +989,7 @@ protected: void ScriptInterpreterPython::ExecuteInterpreterLoop () { - Timer scoped_timer (__PRETTY_FUNCTION__, __PRETTY_FUNCTION__); + Timer scoped_timer (LLVM_PRETTY_FUNCTION, LLVM_PRETTY_FUNCTION); Debugger &debugger = GetCommandInterpreter().GetDebugger(); @@ -2025,7 +2025,7 @@ ScriptInterpreterPython::GetScriptedSummary(const char *python_function_name, ll std::string &retval) { - Timer scoped_timer (__PRETTY_FUNCTION__, __PRETTY_FUNCTION__); + Timer scoped_timer (LLVM_PRETTY_FUNCTION, LLVM_PRETTY_FUNCTION); if (!valobj.get()) { @@ -3191,7 +3191,7 @@ ScriptInterpreterPython::InitializePrivate () g_initialized = true; - Timer scoped_timer (__PRETTY_FUNCTION__, __PRETTY_FUNCTION__); + Timer scoped_timer (LLVM_PRETTY_FUNCTION, LLVM_PRETTY_FUNCTION); // RAII-based initialization which correctly handles multiple-initialization, version- // specific differences among Python 2 and Python 3, and saving and restoring various diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/lldb-python.h b/lldb/source/Plugins/ScriptInterpreter/Python/lldb-python.h index 013492c39bf..55878a88600 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/lldb-python.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/lldb-python.h @@ -15,6 +15,12 @@ #ifdef LLDB_DISABLE_PYTHON // Python is disabled in this build #else +#include "llvm/Support/Compiler.h" +#if defined(LLVM_ON_WIN32) +// If anyone #includes Host/PosixApi.h later, it will try to typedef pid_t. We need to ensure +// this doesn't happen. +#define NO_PID_T +#endif #if defined(__linux__) // features.h will define _POSIX_C_SOURCE if _GNU_SOURCE is defined. This value // may be different from the value that Python defines it to be which results diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp index 381b096c474..6ef0d0ac045 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp @@ -157,7 +157,7 @@ DWARFCompileUnit::ExtractDIEsIfNeeded (bool cu_die_only) if ((cu_die_only && initial_die_array_size > 0) || initial_die_array_size > 1) return 0; // Already parsed - Timer scoped_timer (__PRETTY_FUNCTION__, + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "%8.8x: DWARFCompileUnit::ExtractDIEsIfNeeded( cu_die_only = %i )", m_offset, cu_die_only); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp index 60e5c6ed62f..51eac8bd075 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp @@ -134,8 +134,8 @@ DWARFDebugAranges::AppendRange (dw_offset_t offset, dw_addr_t low_pc, dw_addr_t void DWARFDebugAranges::Sort (bool minimize) { - Timer scoped_timer(__PRETTY_FUNCTION__, "%s this = %p", - __PRETTY_FUNCTION__, static_cast<void*>(this)); + Timer scoped_timer(LLVM_PRETTY_FUNCTION, "%s this = %p", + LLVM_PRETTY_FUNCTION, static_cast<void*>(this)); Log *log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_ARANGES)); size_t orig_arange_size = 0; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp index 417f2cd79bd..36e3ebc8770 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp @@ -14,6 +14,7 @@ #include "lldb/Core/RegularExpression.h" #include "lldb/Core/Stream.h" +#include "lldb/Host/PosixApi.h" #include "lldb/Symbol/ObjectFile.h" #include "DWARFDebugAranges.h" diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp index 84c2142e841..180e47df6fd 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp @@ -529,7 +529,7 @@ DWARFDebugLine::ParseStatementTable const dw_offset_t debug_line_offset = *offset_ptr; - Timer scoped_timer (__PRETTY_FUNCTION__, + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "DWARFDebugLine::ParseStatementTable (.debug_line[0x%8.8x])", debug_line_offset); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp index 547bd0cd1a5..63fcebef1cf 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp @@ -31,7 +31,7 @@ DWARFDebugPubnames::DWARFDebugPubnames() : bool DWARFDebugPubnames::Extract(const DWARFDataExtractor& data) { - Timer scoped_timer (__PRETTY_FUNCTION__, + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "DWARFDebugPubnames::Extract (byte_size = %" PRIu64 ")", (uint64_t)data.GetByteSize()); Log *log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_PUBNAMES)); @@ -64,7 +64,7 @@ DWARFDebugPubnames::Extract(const DWARFDataExtractor& data) bool DWARFDebugPubnames::GeneratePubnames(SymbolFileDWARF* dwarf2Data) { - Timer scoped_timer (__PRETTY_FUNCTION__, + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "DWARFDebugPubnames::GeneratePubnames (data = %p)", static_cast<void*>(dwarf2Data)); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index bf27ccba427..eb23f4204c2 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -800,8 +800,8 @@ SymbolFileDWARF::DebugInfo() { if (m_info.get() == NULL) { - Timer scoped_timer(__PRETTY_FUNCTION__, "%s this = %p", - __PRETTY_FUNCTION__, static_cast<void*>(this)); + Timer scoped_timer(LLVM_PRETTY_FUNCTION, "%s this = %p", + LLVM_PRETTY_FUNCTION, static_cast<void*>(this)); if (get_debug_info_data().GetByteSize() > 0) { m_info.reset(new DWARFDebugInfo()); @@ -846,8 +846,8 @@ SymbolFileDWARF::DebugRanges() { if (m_ranges.get() == NULL) { - Timer scoped_timer(__PRETTY_FUNCTION__, "%s this = %p", - __PRETTY_FUNCTION__, static_cast<void*>(this)); + Timer scoped_timer(LLVM_PRETTY_FUNCTION, "%s this = %p", + LLVM_PRETTY_FUNCTION, static_cast<void*>(this)); if (get_debug_ranges_data().GetByteSize() > 0) { m_ranges.reset(new DWARFDebugRanges()); @@ -1921,7 +1921,7 @@ SymbolFileDWARF::GetGlobalAranges() uint32_t SymbolFileDWARF::ResolveSymbolContext (const Address& so_addr, uint32_t resolve_scope, SymbolContext& sc) { - Timer scoped_timer(__PRETTY_FUNCTION__, + Timer scoped_timer(LLVM_PRETTY_FUNCTION, "SymbolFileDWARF::ResolveSymbolContext (so_addr = { section = %p, offset = 0x%" PRIx64 " }, resolve_scope = 0x%8.8x)", static_cast<void*>(so_addr.GetSection().get()), so_addr.GetOffset(), resolve_scope); @@ -2182,7 +2182,7 @@ SymbolFileDWARF::Index () if (m_indexed) return; m_indexed = true; - Timer scoped_timer (__PRETTY_FUNCTION__, + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "SymbolFileDWARF::Index (%s)", GetObjectFile()->GetFileSpec().GetFilename().AsCString("<Unknown>")); @@ -2719,7 +2719,7 @@ SymbolFileDWARF::FindFunctions (const ConstString &name, bool append, SymbolContextList& sc_list) { - Timer scoped_timer (__PRETTY_FUNCTION__, + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "SymbolFileDWARF::FindFunctions (name = '%s')", name.AsCString()); @@ -3034,7 +3034,7 @@ SymbolFileDWARF::FindFunctions (const ConstString &name, uint32_t SymbolFileDWARF::FindFunctions(const RegularExpression& regex, bool include_inlines, bool append, SymbolContextList& sc_list) { - Timer scoped_timer (__PRETTY_FUNCTION__, + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "SymbolFileDWARF::FindFunctions (regex = '%s')", regex.GetText()); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp index ca819624c71..39354fcdf6f 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -1099,7 +1099,7 @@ SymbolFileDWARFDebugMap::FindFunctions(const ConstString &name, bool append, SymbolContextList& sc_list) { - Timer scoped_timer (__PRETTY_FUNCTION__, + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "SymbolFileDWARFDebugMap::FindFunctions (name = %s)", name.GetCString()); @@ -1124,7 +1124,7 @@ SymbolFileDWARFDebugMap::FindFunctions(const ConstString &name, uint32_t SymbolFileDWARFDebugMap::FindFunctions (const RegularExpression& regex, bool include_inlines, bool append, SymbolContextList& sc_list) { - Timer scoped_timer (__PRETTY_FUNCTION__, + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "SymbolFileDWARFDebugMap::FindFunctions (regex = '%s')", regex.GetText()); @@ -1152,7 +1152,7 @@ SymbolFileDWARFDebugMap::GetTypes (SymbolContextScope *sc_scope, uint32_t type_mask, TypeList &type_list) { - Timer scoped_timer (__PRETTY_FUNCTION__, + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "SymbolFileDWARFDebugMap::GetTypes (type_mask = 0x%8.8x)", type_mask); diff --git a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp index 3cd1b68d7b0..9b32484be87 100644 --- a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp +++ b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp @@ -107,7 +107,7 @@ SymbolVendorELF::CreateInstance (const lldb::ModuleSP &module_sp, lldb_private:: if (file_spec_list.IsEmpty()) return NULL; - Timer scoped_timer (__PRETTY_FUNCTION__, + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "SymbolVendorELF::CreateInstance (module = %s)", module_sp->GetFileSpec().GetPath().c_str()); diff --git a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp index 7086120f975..94a37f8d2dd 100644 --- a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp +++ b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp @@ -132,7 +132,7 @@ SymbolVendorMacOSX::CreateInstance (const lldb::ModuleSP &module_sp, lldb_privat if (obj_name != obj_file_macho) return NULL; - Timer scoped_timer (__PRETTY_FUNCTION__, + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "SymbolVendorMacOSX::CreateInstance (module = %s)", module_sp->GetFileSpec().GetPath().c_str()); SymbolVendorMacOSX* symbol_vendor = new SymbolVendorMacOSX(module_sp); diff --git a/lldb/source/Symbol/DWARFCallFrameInfo.cpp b/lldb/source/Symbol/DWARFCallFrameInfo.cpp index 6a4004bb790..5318327318e 100644 --- a/lldb/source/Symbol/DWARFCallFrameInfo.cpp +++ b/lldb/source/Symbol/DWARFCallFrameInfo.cpp @@ -314,7 +314,7 @@ DWARFCallFrameInfo::GetFDEIndex () if (m_fde_index_initialized) // if two threads hit the locker return; - Timer scoped_timer (__PRETTY_FUNCTION__, "%s - %s", __PRETTY_FUNCTION__, m_objfile.GetFileSpec().GetFilename().AsCString("")); + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "%s - %s", LLVM_PRETTY_FUNCTION, m_objfile.GetFileSpec().GetFilename().AsCString("")); bool clear_address_zeroth_bit = false; ArchSpec arch; diff --git a/lldb/source/Symbol/ObjectFile.cpp b/lldb/source/Symbol/ObjectFile.cpp index 62cde26c702..18da7ef2d81 100644 --- a/lldb/source/Symbol/ObjectFile.cpp +++ b/lldb/source/Symbol/ObjectFile.cpp @@ -38,7 +38,7 @@ ObjectFile::FindPlugin (const lldb::ModuleSP &module_sp, if (module_sp) { - Timer scoped_timer (__PRETTY_FUNCTION__, + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "ObjectFile::FindPlugin (module = %s, file = %p, file_offset = 0x%8.8" PRIx64 ", file_size = 0x%8.8" PRIx64 ")", module_sp->GetFileSpec().GetPath().c_str(), static_cast<const void*>(file), @@ -161,7 +161,7 @@ ObjectFile::FindPlugin (const lldb::ModuleSP &module_sp, if (module_sp) { - Timer scoped_timer (__PRETTY_FUNCTION__, + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "ObjectFile::FindPlugin (module = %s, process = %p, header_addr = 0x%" PRIx64 ")", module_sp->GetFileSpec().GetPath().c_str(), static_cast<void*>(process_sp.get()), header_addr); diff --git a/lldb/source/Symbol/Symtab.cpp b/lldb/source/Symbol/Symtab.cpp index b11b731014d..ca88ebe9c26 100644 --- a/lldb/source/Symbol/Symtab.cpp +++ b/lldb/source/Symbol/Symtab.cpp @@ -264,7 +264,7 @@ Symtab::InitNameIndexes() if (!m_name_indexes_computed) { m_name_indexes_computed = true; - Timer scoped_timer (__PRETTY_FUNCTION__, "%s", __PRETTY_FUNCTION__); + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "%s", LLVM_PRETTY_FUNCTION); // Create the name index vector to be able to quickly search by name const size_t num_symbols = m_symbols.size(); #if 1 @@ -471,7 +471,7 @@ Symtab::AppendSymbolNamesToMap (const IndexCollection &indexes, { if (add_demangled || add_mangled) { - Timer scoped_timer (__PRETTY_FUNCTION__, "%s", __PRETTY_FUNCTION__); + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "%s", LLVM_PRETTY_FUNCTION); std::lock_guard<std::recursive_mutex> guard(m_mutex); // Create the name index vector to be able to quickly search by name @@ -632,7 +632,7 @@ Symtab::SortSymbolIndexesByValue (std::vector<uint32_t>& indexes, bool remove_du { std::lock_guard<std::recursive_mutex> guard(m_mutex); - Timer scoped_timer (__PRETTY_FUNCTION__,__PRETTY_FUNCTION__); + Timer scoped_timer (LLVM_PRETTY_FUNCTION,LLVM_PRETTY_FUNCTION); // No need to sort if we have zero or one items... if (indexes.size() <= 1) return; @@ -657,7 +657,7 @@ Symtab::AppendSymbolIndexesWithName (const ConstString& symbol_name, std::vector { std::lock_guard<std::recursive_mutex> guard(m_mutex); - Timer scoped_timer (__PRETTY_FUNCTION__, "%s", __PRETTY_FUNCTION__); + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "%s", LLVM_PRETTY_FUNCTION); if (symbol_name) { const char *symbol_cstr = symbol_name.GetCString(); @@ -674,7 +674,7 @@ Symtab::AppendSymbolIndexesWithName (const ConstString& symbol_name, Debug symbo { std::lock_guard<std::recursive_mutex> guard(m_mutex); - Timer scoped_timer (__PRETTY_FUNCTION__, "%s", __PRETTY_FUNCTION__); + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "%s", LLVM_PRETTY_FUNCTION); if (symbol_name) { const size_t old_size = indexes.size(); @@ -810,7 +810,7 @@ Symtab::FindAllSymbolsWithNameAndType (const ConstString &name, SymbolType symbo { std::lock_guard<std::recursive_mutex> guard(m_mutex); - Timer scoped_timer (__PRETTY_FUNCTION__, "%s", __PRETTY_FUNCTION__); + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "%s", LLVM_PRETTY_FUNCTION); // Initialize all of the lookup by name indexes before converting NAME // to a uniqued string NAME_STR below. if (!m_name_indexes_computed) @@ -830,7 +830,7 @@ Symtab::FindAllSymbolsWithNameAndType (const ConstString &name, SymbolType symbo { std::lock_guard<std::recursive_mutex> guard(m_mutex); - Timer scoped_timer (__PRETTY_FUNCTION__, "%s", __PRETTY_FUNCTION__); + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "%s", LLVM_PRETTY_FUNCTION); // Initialize all of the lookup by name indexes before converting NAME // to a uniqued string NAME_STR below. if (!m_name_indexes_computed) @@ -859,7 +859,7 @@ Symtab::FindFirstSymbolWithNameAndType (const ConstString &name, SymbolType symb { std::lock_guard<std::recursive_mutex> guard(m_mutex); - Timer scoped_timer (__PRETTY_FUNCTION__, "%s", __PRETTY_FUNCTION__); + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "%s", LLVM_PRETTY_FUNCTION); if (!m_name_indexes_computed) InitNameIndexes(); diff --git a/lldb/source/Target/FileAction.cpp b/lldb/source/Target/FileAction.cpp index 21c37e8e6f8..06d0529fe3e 100644 --- a/lldb/source/Target/FileAction.cpp +++ b/lldb/source/Target/FileAction.cpp @@ -9,11 +9,8 @@ #include <fcntl.h> -#if defined(_WIN32) -#include "lldb/Host/Windows/win32.h" // For O_NOCTTY -#endif - #include "lldb/Core/Stream.h" +#include "lldb/Host/PosixApi.h" #include "lldb/Target/FileAction.h" using namespace lldb_private; diff --git a/lldb/source/Target/PathMappingList.cpp b/lldb/source/Target/PathMappingList.cpp index 2372c2f9dd9..7bb86d9d895 100644 --- a/lldb/source/Target/PathMappingList.cpp +++ b/lldb/source/Target/PathMappingList.cpp @@ -17,6 +17,7 @@ #include "lldb/Core/Error.h" #include "lldb/Core/Stream.h" #include "lldb/Host/FileSpec.h" +#include "lldb/Host/PosixApi.h" #include "lldb/Target/PathMappingList.h" using namespace lldb; diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp index f537f70452f..8236a66691c 100644 --- a/lldb/source/Target/Platform.cpp +++ b/lldb/source/Target/Platform.cpp @@ -914,7 +914,7 @@ Platform::MakeDirectory(const FileSpec &file_spec, uint32_t permissions) else { Error error; - error.SetErrorStringWithFormat("remote platform %s doesn't support %s", GetPluginName().GetCString(), __PRETTY_FUNCTION__); + error.SetErrorStringWithFormat("remote platform %s doesn't support %s", GetPluginName().GetCString(), LLVM_PRETTY_FUNCTION); return error; } } @@ -927,7 +927,7 @@ Platform::GetFilePermissions(const FileSpec &file_spec, uint32_t &file_permissio else { Error error; - error.SetErrorStringWithFormat("remote platform %s doesn't support %s", GetPluginName().GetCString(), __PRETTY_FUNCTION__); + error.SetErrorStringWithFormat("remote platform %s doesn't support %s", GetPluginName().GetCString(), LLVM_PRETTY_FUNCTION); return error; } } @@ -940,7 +940,7 @@ Platform::SetFilePermissions(const FileSpec &file_spec, uint32_t file_permission else { Error error; - error.SetErrorStringWithFormat("remote platform %s doesn't support %s", GetPluginName().GetCString(), __PRETTY_FUNCTION__); + error.SetErrorStringWithFormat("remote platform %s doesn't support %s", GetPluginName().GetCString(), LLVM_PRETTY_FUNCTION); return error; } } diff --git a/lldb/source/Target/ProcessInfo.cpp b/lldb/source/Target/ProcessInfo.cpp index 214db9ed3d4..b57fd23ea2e 100644 --- a/lldb/source/Target/ProcessInfo.cpp +++ b/lldb/source/Target/ProcessInfo.cpp @@ -7,15 +7,16 @@ // //===----------------------------------------------------------------------===// +#include "lldb/Target/ProcessInfo.h" + // C Includes // C++ Includes #include <climits> // Other libraries and framework includes // Project includes -#include "lldb/Target/ProcessInfo.h" - #include "lldb/Core/Stream.h" +#include "lldb/Host/PosixApi.h" using namespace lldb; using namespace lldb_private; diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index f53e66a7ea0..ead555a757e 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -1239,7 +1239,7 @@ Target::SetExecutableModule (ModuleSP& executable_sp, bool get_dependent_files) if (executable_sp) { - Timer scoped_timer (__PRETTY_FUNCTION__, + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "Target::SetExecutableModule (executable = '%s')", executable_sp->GetFileSpec().GetPath().c_str()); diff --git a/lldb/source/Target/TargetList.cpp b/lldb/source/Target/TargetList.cpp index 34954467691..6e7577206af 100644 --- a/lldb/source/Target/TargetList.cpp +++ b/lldb/source/Target/TargetList.cpp @@ -386,7 +386,7 @@ TargetList::CreateTargetInternal (Debugger &debugger, lldb::TargetSP &target_sp, bool is_dummy_target) { - Timer scoped_timer (__PRETTY_FUNCTION__, + Timer scoped_timer (LLVM_PRETTY_FUNCTION, "TargetList::CreateTarget (file = '%s', arch = '%s')", user_exe_path, specified_arch.GetArchitectureName()); diff --git a/lldb/source/Target/ThreadPlan.cpp b/lldb/source/Target/ThreadPlan.cpp index bf9a05497c7..f86d10dca34 100644 --- a/lldb/source/Target/ThreadPlan.cpp +++ b/lldb/source/Target/ThreadPlan.cpp @@ -241,14 +241,14 @@ ThreadPlanNull::ValidatePlan (Stream *error) { #ifdef LLDB_CONFIGURATION_DEBUG fprintf(stderr, "error: %s called on thread that has been destroyed (tid = 0x%" PRIx64 ", ptid = 0x%" PRIx64 ")", - __PRETTY_FUNCTION__, + LLVM_PRETTY_FUNCTION, m_thread.GetID(), m_thread.GetProtocolID()); #else Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD)); if (log) log->Error("%s called on thread that has been destroyed (tid = 0x%" PRIx64 ", ptid = 0x%" PRIx64 ")", - __PRETTY_FUNCTION__, + LLVM_PRETTY_FUNCTION, m_thread.GetID(), m_thread.GetProtocolID()); #endif @@ -260,14 +260,14 @@ ThreadPlanNull::ShouldStop (Event *event_ptr) { #ifdef LLDB_CONFIGURATION_DEBUG fprintf(stderr, "error: %s called on thread that has been destroyed (tid = 0x%" PRIx64 ", ptid = 0x%" PRIx64 ")", - __PRETTY_FUNCTION__, + LLVM_PRETTY_FUNCTION, m_thread.GetID(), m_thread.GetProtocolID()); #else Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD)); if (log) log->Error("%s called on thread that has been destroyed (tid = 0x%" PRIx64 ", ptid = 0x%" PRIx64 ")", - __PRETTY_FUNCTION__, + LLVM_PRETTY_FUNCTION, m_thread.GetID(), m_thread.GetProtocolID()); #endif @@ -279,14 +279,14 @@ ThreadPlanNull::WillStop () { #ifdef LLDB_CONFIGURATION_DEBUG fprintf(stderr, "error: %s called on thread that has been destroyed (tid = 0x%" PRIx64 ", ptid = 0x%" PRIx64 ")", - __PRETTY_FUNCTION__, + LLVM_PRETTY_FUNCTION, m_thread.GetID(), m_thread.GetProtocolID()); #else Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD)); if (log) log->Error("%s called on thread that has been destroyed (tid = 0x%" PRIx64 ", ptid = 0x%" PRIx64 ")", - __PRETTY_FUNCTION__, + LLVM_PRETTY_FUNCTION, m_thread.GetID(), m_thread.GetProtocolID()); #endif @@ -298,14 +298,14 @@ ThreadPlanNull::DoPlanExplainsStop (Event *event_ptr) { #ifdef LLDB_CONFIGURATION_DEBUG fprintf(stderr, "error: %s called on thread that has been destroyed (tid = 0x%" PRIx64 ", ptid = 0x%" PRIx64 ")", - __PRETTY_FUNCTION__, + LLVM_PRETTY_FUNCTION, m_thread.GetID(), m_thread.GetProtocolID()); #else Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD)); if (log) log->Error("%s called on thread that has been destroyed (tid = 0x%" PRIx64 ", ptid = 0x%" PRIx64 ")", - __PRETTY_FUNCTION__, + LLVM_PRETTY_FUNCTION, m_thread.GetID(), m_thread.GetProtocolID()); #endif @@ -319,14 +319,14 @@ ThreadPlanNull::MischiefManaged () // The null plan is never done. #ifdef LLDB_CONFIGURATION_DEBUG fprintf(stderr, "error: %s called on thread that has been destroyed (tid = 0x%" PRIx64 ", ptid = 0x%" PRIx64 ")", - __PRETTY_FUNCTION__, + LLVM_PRETTY_FUNCTION, m_thread.GetID(), m_thread.GetProtocolID()); #else Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD)); if (log) log->Error("%s called on thread that has been destroyed (tid = 0x%" PRIx64 ", ptid = 0x%" PRIx64 ")", - __PRETTY_FUNCTION__, + LLVM_PRETTY_FUNCTION, m_thread.GetID(), m_thread.GetProtocolID()); #endif @@ -339,14 +339,14 @@ ThreadPlanNull::GetPlanRunState () // Not sure what to return here. This is a dead thread. #ifdef LLDB_CONFIGURATION_DEBUG fprintf(stderr, "error: %s called on thread that has been destroyed (tid = 0x%" PRIx64 ", ptid = 0x%" PRIx64 ")", - __PRETTY_FUNCTION__, + LLVM_PRETTY_FUNCTION, m_thread.GetID(), m_thread.GetProtocolID()); #else Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD)); if (log) log->Error("%s called on thread that has been destroyed (tid = 0x%" PRIx64 ", ptid = 0x%" PRIx64 ")", - __PRETTY_FUNCTION__, + LLVM_PRETTY_FUNCTION, m_thread.GetID(), m_thread.GetProtocolID()); #endif diff --git a/lldb/source/Target/ThreadPlanPython.cpp b/lldb/source/Target/ThreadPlanPython.cpp index 470e7f6b1cb..39a8d77d43a 100644 --- a/lldb/source/Target/ThreadPlanPython.cpp +++ b/lldb/source/Target/ThreadPlanPython.cpp @@ -83,7 +83,7 @@ ThreadPlanPython::ShouldStop (Event *event_ptr) Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD)); if (log) log->Printf ("%s called on Python Thread Plan: %s )", - __PRETTY_FUNCTION__, m_class_name.c_str()); + LLVM_PRETTY_FUNCTION, m_class_name.c_str()); bool should_stop = true; if (m_implementation_sp) @@ -106,7 +106,7 @@ ThreadPlanPython::IsPlanStale() Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD)); if (log) log->Printf ("%s called on Python Thread Plan: %s )", - __PRETTY_FUNCTION__, m_class_name.c_str()); + LLVM_PRETTY_FUNCTION, m_class_name.c_str()); bool is_stale = true; if (m_implementation_sp) @@ -129,7 +129,7 @@ ThreadPlanPython::DoPlanExplainsStop (Event *event_ptr) Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD)); if (log) log->Printf ("%s called on Python Thread Plan: %s )", - __PRETTY_FUNCTION__, m_class_name.c_str()); + LLVM_PRETTY_FUNCTION, m_class_name.c_str()); bool explains_stop = true; if (m_implementation_sp) @@ -152,7 +152,7 @@ ThreadPlanPython::MischiefManaged () Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD)); if (log) log->Printf ("%s called on Python Thread Plan: %s )", - __PRETTY_FUNCTION__, m_class_name.c_str()); + LLVM_PRETTY_FUNCTION, m_class_name.c_str()); bool mischief_managed = true; if (m_implementation_sp) { @@ -170,7 +170,7 @@ ThreadPlanPython::GetPlanRunState () Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD)); if (log) log->Printf ("%s called on Python Thread Plan: %s )", - __PRETTY_FUNCTION__, + LLVM_PRETTY_FUNCTION, m_class_name.c_str()); lldb::StateType run_state = eStateRunning; if (m_implementation_sp) @@ -207,6 +207,6 @@ ThreadPlanPython::WillStop () Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD)); if (log) log->Printf ("%s called on Python Thread Plan: %s )", - __PRETTY_FUNCTION__, m_class_name.c_str()); + LLVM_PRETTY_FUNCTION, m_class_name.c_str()); return true; } diff --git a/lldb/source/Utility/PseudoTerminal.cpp b/lldb/source/Utility/PseudoTerminal.cpp index 94c75daa873..7a200f2a817 100644 --- a/lldb/source/Utility/PseudoTerminal.cpp +++ b/lldb/source/Utility/PseudoTerminal.cpp @@ -18,21 +18,9 @@ #include <sys/ioctl.h> #endif -#ifdef _WIN32 -#include "lldb/Host/windows/win32.h" -typedef uint32_t pid_t; -// empty functions -int posix_openpt(int flag) { return 0; } +#include "lldb/Host/PosixApi.h" -int strerror_r(int errnum, char *buf, size_t buflen) { return 0; } - -int unlockpt(int fd) { return 0; } -int grantpt(int fd) { return 0; } -char *ptsname(int fd) { return 0; } - -pid_t fork(void) { return 0; } -pid_t setsid(void) { return 0; } -#elif defined(__ANDROID_NDK__) +#if defined(__ANDROID_NDK__) int posix_openpt(int flags); #endif diff --git a/lldb/source/Utility/TimeSpecTimeout.h b/lldb/source/Utility/TimeSpecTimeout.h index 388ccc179c1..8f809ace3c9 100644 --- a/lldb/source/Utility/TimeSpecTimeout.h +++ b/lldb/source/Utility/TimeSpecTimeout.h @@ -10,6 +10,7 @@ #ifndef utility_TimeSpecTimeout_h_ #define utility_TimeSpecTimeout_h_ +#include "lldb/Host/PosixApi.h" #include "lldb/Host/TimeValue.h" namespace lldb_private { diff --git a/lldb/tools/debugserver/source/PThreadEvent.cpp b/lldb/tools/debugserver/source/PThreadEvent.cpp index b087bfc7d48..47e72756a96 100644 --- a/lldb/tools/debugserver/source/PThreadEvent.cpp +++ b/lldb/tools/debugserver/source/PThreadEvent.cpp @@ -28,14 +28,14 @@ PThreadEvent::PThreadEvent(uint32_t bits, uint32_t validBits) : PThreadEvent::~PThreadEvent() { - // DNBLogThreadedIf(LOG_EVENTS, "%p %s", this, __PRETTY_FUNCTION__); + // DNBLogThreadedIf(LOG_EVENTS, "%p %s", this, LLVM_PRETTY_FUNCTION); } uint32_t PThreadEvent::NewEventBit() { - // DNBLogThreadedIf(LOG_EVENTS, "%p %s", this, __PRETTY_FUNCTION__); + // DNBLogThreadedIf(LOG_EVENTS, "%p %s", this, LLVM_PRETTY_FUNCTION); PTHREAD_MUTEX_LOCKER (locker, m_mutex); uint32_t mask = 1; while (mask & m_validBits) @@ -60,7 +60,7 @@ PThreadEvent::FreeEventBits(const uint32_t mask) uint32_t PThreadEvent::GetEventBits() const { - // DNBLogThreadedIf(LOG_EVENTS, "%p %s", this, __PRETTY_FUNCTION__); + // DNBLogThreadedIf(LOG_EVENTS, "%p %s", this, LLVM_PRETTY_FUNCTION); PTHREAD_MUTEX_LOCKER (locker, m_mutex); uint32_t bits = m_bits; return bits; diff --git a/lldb/tools/debugserver/source/RNBRemote.cpp b/lldb/tools/debugserver/source/RNBRemote.cpp index 30b804316a1..a3c9db91680 100644 --- a/lldb/tools/debugserver/source/RNBRemote.cpp +++ b/lldb/tools/debugserver/source/RNBRemote.cpp @@ -183,14 +183,14 @@ RNBRemote::RNBRemote () : m_enable_compression_next_send_packet (false), m_compression_mode (compression_types::none) { - DNBLogThreadedIf (LOG_RNB_REMOTE, "%s", __PRETTY_FUNCTION__); + DNBLogThreadedIf (LOG_RNB_REMOTE, "%s", LLVM_PRETTY_FUNCTION); CreatePacketTable (); } RNBRemote::~RNBRemote() { - DNBLogThreadedIf (LOG_RNB_REMOTE, "%s", __PRETTY_FUNCTION__); + DNBLogThreadedIf (LOG_RNB_REMOTE, "%s", LLVM_PRETTY_FUNCTION); StopReadRemoteDataThread(); } |