Delete Host/windows/win32.h

It's always hard to remember when to include this file, and
when you do include it it's hard to remember what preprocessor
check it needs to be behind, and then you further have to remember
whether it's windows.h or win32.h which you need to include.

This patch changes the name to PosixApi.h, which is more appropriately
named, and makes it independent of any preprocessor setting.

There's still the issue of people not knowing when to include this,
because there's not a well-defined set of things it exposes other
than "whatever is missing on Windows", but at least this should
make it less painful to fix when problems arise.

This patch depends on LLVM revision r278170.

llvm-svn: 278177
This commit is contained in:
Zachary Turner 2016-08-09 23:06:08 +00:00
parent cef001aaaa
commit f343968f5d
62 changed files with 237 additions and 187 deletions

View file

@ -20,6 +20,7 @@
// Project includes
#include "lldb/lldb-private.h"
#include "lldb/Host/IOObject.h"
#include "lldb/Host/PosixApi.h"
namespace lldb_private {

View file

@ -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

View file

@ -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

View file

@ -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
// 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_

View file

@ -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"

View file

@ -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);
}
};
}

View file

@ -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,

View file

@ -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;

View file

@ -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

View file

@ -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();

View file

@ -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)

View file

@ -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;

View file

@ -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

View file

@ -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);

View file

@ -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;

View file

@ -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());

View file

@ -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 &regex, 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);

View file

@ -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>

View file

@ -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;

View file

@ -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

View file

@ -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>",

View file

@ -8,6 +8,8 @@
//===----------------------------------------------------------------------===//
#include "lldb/Host/Terminal.h"
#include "lldb/Host/PosixApi.h"
#include "llvm/ADT/STLExtras.h"
#include <fcntl.h>

View file

@ -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;
}

View file

@ -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"

View file

@ -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();

View file

@ -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);

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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();

View file

@ -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),

View file

@ -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);

View file

@ -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());

View file

@ -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>

View file

@ -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(),

View file

@ -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(),

View file

@ -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

View file

@ -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

View file

@ -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);

View file

@ -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;

View file

@ -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"

View file

@ -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);

View file

@ -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));

View file

@ -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());

View file

@ -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);

View file

@ -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());

View file

@ -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);

View file

@ -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;

View file

@ -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);

View file

@ -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();

View file

@ -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;

View file

@ -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;

View file

@ -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;
}
}

View file

@ -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;

View file

@ -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());

View file

@ -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());

View file

@ -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

View file

@ -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;
}

View file

@ -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

View file

@ -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 {

View file

@ -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;

View file

@ -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();
}