class OptionGroupPlatformRSync : public lldb_private::OptionGroup
{
public:
- OptionGroupPlatformRSync ();
-
- ~OptionGroupPlatformRSync() override;
-
+ OptionGroupPlatformRSync() = default;
+
+ ~OptionGroupPlatformRSync() override = default;
+
lldb_private::Error
SetOptionValue(CommandInterpreter &interpreter,
uint32_t option_idx,
std::string m_rsync_opts;
std::string m_rsync_prefix;
bool m_ignores_remote_hostname;
+
private:
DISALLOW_COPY_AND_ASSIGN(OptionGroupPlatformRSync);
};
class OptionGroupPlatformSSH : public lldb_private::OptionGroup
{
public:
- OptionGroupPlatformSSH ();
-
- ~OptionGroupPlatformSSH() override;
-
+ OptionGroupPlatformSSH() = default;
+
+ ~OptionGroupPlatformSSH() override = default;
+
lldb_private::Error
SetOptionValue(CommandInterpreter &interpreter,
uint32_t option_idx,
class OptionGroupPlatformCaching : public lldb_private::OptionGroup
{
public:
- OptionGroupPlatformCaching ();
-
- ~OptionGroupPlatformCaching() override;
-
+ OptionGroupPlatformCaching() = default;
+
+ ~OptionGroupPlatformCaching() override = default;
+
lldb_private::Error
SetOptionValue(CommandInterpreter &interpreter,
uint32_t option_idx,
//
//===----------------------------------------------------------------------===//
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
#include "lldb/Target/ABI.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/Value.h"
ABICreateInstance create_callback;
for (uint32_t idx = 0;
- (create_callback = PluginManager::GetABICreateCallbackAtIndex(idx)) != NULL;
+ (create_callback = PluginManager::GetABICreateCallbackAtIndex(idx)) != nullptr;
++idx)
{
abi_sp = create_callback(arch);
return abi_sp;
}
-//----------------------------------------------------------------------
-// Constructor
-//----------------------------------------------------------------------
-ABI::ABI()
-{
-}
+ABI::ABI() = default;
-//----------------------------------------------------------------------
-// Destructor
-//----------------------------------------------------------------------
-ABI::~ABI()
-{
-}
+ABI::~ABI() = default;
bool
ABI::GetRegisterInfoByName (const ConstString &name, RegisterInfo &info)
{
const char *unique_name_cstr = name.GetCString();
uint32_t i;
- for (i=0; i<count; ++i)
+ for (i = 0; i < count; ++i)
{
if (register_info_array[i].name == unique_name_cstr)
{
return true;
}
}
- for (i=0; i<count; ++i)
+ for (i = 0; i < count; ++i)
{
if (register_info_array[i].alt_name == unique_name_cstr)
{
const RegisterInfo *register_info_array = GetRegisterInfoArray (count);
if (register_info_array)
{
- for (uint32_t i=0; i<count; ++i)
+ for (uint32_t i = 0; i < count; ++i)
{
if (register_info_array[i].kinds[reg_kind] == reg_num)
{
ExpressionVariableSP clang_expr_variable_sp(persistent_expression_state->CreatePersistentVariable(return_valobj_sp));
- assert (clang_expr_variable_sp.get());
+ assert (clang_expr_variable_sp);
// Set flags and live data as appropriate
//
//===----------------------------------------------------------------------===//
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
#include "lldb/Target/ExecutionContext.h"
-
#include "lldb/Core/State.h"
#include "lldb/Target/ExecutionContextScope.h"
#include "lldb/Target/StackFrame.h"
m_frame_sp.reset();
}
-ExecutionContext::~ExecutionContext()
-{
-}
+ExecutionContext::~ExecutionContext() = default;
uint32_t
ExecutionContext::GetAddressByteSize() const
return m_frame_sp->GetRegisterContext().get();
else if (m_thread_sp)
return m_thread_sp->GetRegisterContext().get();
- return NULL;
+ return nullptr;
}
Target *
return m_target_sp.get();
if (m_process_sp)
return &m_process_sp->GetTarget();
- return NULL;
+ return nullptr;
}
Process *
return m_process_sp.get();
if (m_target_sp)
return m_target_sp->GetProcessSP().get();
- return NULL;
+ return nullptr;
}
ExecutionContextScope *
ExecutionContext::GetTargetRef () const
{
#if defined (LLDB_CONFIGURATION_DEBUG) || defined (LLDB_CONFIGURATION_RELEASE)
- assert (m_target_sp.get());
+ assert (m_target_sp);
#endif
return *m_target_sp;
}
ExecutionContext::GetProcessRef () const
{
#if defined (LLDB_CONFIGURATION_DEBUG) || defined (LLDB_CONFIGURATION_RELEASE)
- assert (m_process_sp.get());
+ assert (m_process_sp);
#endif
return *m_process_sp;
}
ExecutionContext::GetThreadRef () const
{
#if defined (LLDB_CONFIGURATION_DEBUG) || defined (LLDB_CONFIGURATION_RELEASE)
- assert (m_thread_sp.get());
+ assert (m_thread_sp);
#endif
return *m_thread_sp;
}
ExecutionContext::GetFrameRef () const
{
#if defined (LLDB_CONFIGURATION_DEBUG) || defined (LLDB_CONFIGURATION_RELEASE)
- assert (m_frame_sp.get());
+ assert (m_frame_sp);
#endif
return *m_frame_sp;
}
*this = exe_ctx;
}
-
ExecutionContextRef::ExecutionContextRef (Target *target, bool adopt_selected) :
m_target_wp(),
m_process_wp(),
SetTargetPtr (target, adopt_selected);
}
-
-
-
ExecutionContextRef::ExecutionContextRef (const ExecutionContextRef &rhs) :
m_target_wp (rhs.m_target_wp),
m_process_wp(rhs.m_process_wp),
ClearFrame();
}
-ExecutionContextRef::~ExecutionContextRef()
-{
-}
+ExecutionContextRef::~ExecutionContextRef() = default;
void
ExecutionContextRef::SetTargetSP (const lldb::TargetSP &target_sp)
m_process_wp.reset();
m_target_wp.reset();
}
-
}
void
}
}
- // Check that we aren't about to return an invalid thread sp. We might return a NULL thread_sp,
+ // Check that we aren't about to return an invalid thread sp. We might return a nullptr thread_sp,
// but don't return an invalid one.
if (thread_sp && !thread_sp->IsValid())
{
return ExecutionContext(this, thread_and_frame_only_if_stopped);
}
-
-
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
-//===----------------------------------------------------------------------===//
+//===---------------------------------------------------------------------===//
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
#include "lldb/lldb-private.h"
#include "lldb/Target/Process.h"
#include "lldb/Core/PluginManager.h"
void
InstrumentationRuntime::ModulesDidLoad(lldb_private::ModuleList &module_list, lldb_private::Process *process, InstrumentationRuntimeCollection &runtimes)
{
- InstrumentationRuntimeCreateInstance create_callback = NULL;
+ InstrumentationRuntimeCreateInstance create_callback = nullptr;
InstrumentationRuntimeGetType get_type_callback;
for (uint32_t idx = 0; ; ++idx)
{
create_callback = PluginManager::GetInstrumentationRuntimeCreateCallbackAtIndex(idx);
- if (create_callback == NULL)
+ if (create_callback == nullptr)
break;
get_type_callback = PluginManager::GetInstrumentationRuntimeGetTypeCallbackAtIndex(idx);
InstrumentationRuntimeType type = get_type_callback();
//
//===----------------------------------------------------------------------===//
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
#include "lldb/lldb-private.h"
#include "lldb/Target/JITLoader.h"
#include "lldb/Target/JITLoaderList.h"
void
JITLoader::LoadPlugins (Process *process, JITLoaderList &list)
{
- JITLoaderCreateInstance create_callback = NULL;
- for (uint32_t idx = 0; (create_callback = PluginManager::GetJITLoaderCreateCallbackAtIndex(idx)) != NULL; ++idx)
+ JITLoaderCreateInstance create_callback = nullptr;
+ for (uint32_t idx = 0; (create_callback = PluginManager::GetJITLoaderCreateCallbackAtIndex(idx)) != nullptr; ++idx)
{
JITLoaderSP instance_sp(create_callback(process, false));
if (instance_sp)
{
}
-JITLoader::~JITLoader()
-{
-}
+JITLoader::~JITLoader() = default;
ExceptionSearchFilter (const lldb::TargetSP &target_sp,
lldb::LanguageType language,
bool update_module_list = true) :
- SearchFilter (target_sp),
- m_language (language),
- m_language_runtime (NULL),
- m_filter_sp ()
+ SearchFilter(target_sp),
+ m_language(language),
+ m_language_runtime(nullptr),
+ m_filter_sp()
{
if (update_module_list)
UpdateModuleListIfNeeded ();
if (process_sp)
{
bool refreash_filter = !m_filter_sp;
- if (m_language_runtime == NULL)
+ if (m_language_runtime == nullptr)
{
m_language_runtime = process_sp->GetLanguageRuntime(m_language);
refreash_filter = true;
else
{
m_filter_sp.reset();
- m_language_runtime = NULL;
+ m_language_runtime = nullptr;
}
}
};
ExceptionBreakpointResolver (lldb::LanguageType language,
bool catch_bp,
bool throw_bp) :
- BreakpointResolver (NULL, BreakpointResolver::ExceptionResolver),
- m_language (language),
- m_language_runtime (NULL),
- m_catch_bp (catch_bp),
- m_throw_bp (throw_bp)
+ BreakpointResolver(nullptr, BreakpointResolver::ExceptionResolver),
+ m_language(language),
+ m_language_runtime(nullptr),
+ m_catch_bp(catch_bp),
+ m_throw_bp(throw_bp)
{
}
if (process_sp)
{
bool refreash_resolver = !m_actual_resolver_sp;
- if (m_language_runtime == NULL)
+ if (m_language_runtime == nullptr)
{
m_language_runtime = process_sp->GetLanguageRuntime(m_language);
refreash_resolver = true;
else
{
m_actual_resolver_sp.reset();
- m_language_runtime = NULL;
+ m_language_runtime = nullptr;
}
}
else
{
m_actual_resolver_sp.reset();
- m_language_runtime = NULL;
+ m_language_runtime = nullptr;
}
return (bool)m_actual_resolver_sp;
}
+
lldb::BreakpointResolverSP m_actual_resolver_sp;
lldb::LanguageType m_language;
LanguageRuntime *m_language_runtime;
LanguageRuntimeCreateInstance create_callback;
for (uint32_t idx = 0;
- (create_callback = PluginManager::GetLanguageRuntimeCreateCallbackAtIndex(idx)) != NULL;
+ (create_callback = PluginManager::GetLanguageRuntimeCreateCallbackAtIndex(idx)) != nullptr;
++idx)
{
language_runtime_ap.reset (create_callback(process, language));
- if (language_runtime_ap.get())
+ if (language_runtime_ap)
return language_runtime_ap.release();
}
- return NULL;
+ return nullptr;
}
LanguageRuntime::LanguageRuntime(Process *process) :
lldb::SearchFilterSP
LanguageRuntime::CreateExceptionSearchFilter ()
{
- return m_process->GetTarget().GetSearchFilterForModule(NULL);
+ return m_process->GetTarget().GetSearchFilterForModule(nullptr);
}
-//===-- MemoryHistory.cpp -------------------------*- C++ -*-===//
+//===-- MemoryHistory.cpp ---------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
//
//===----------------------------------------------------------------------===//
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
#include "lldb/Target/MemoryHistory.h"
-
#include "lldb/Core/PluginManager.h"
using namespace lldb;
lldb::MemoryHistorySP
MemoryHistory::FindPlugin (const ProcessSP process)
{
- MemoryHistoryCreateInstance create_callback = NULL;
+ MemoryHistoryCreateInstance create_callback = nullptr;
- for (uint32_t idx = 0; (create_callback = PluginManager::GetMemoryHistoryCreateCallbackAtIndex(idx)) != NULL; ++idx)
+ for (uint32_t idx = 0; (create_callback = PluginManager::GetMemoryHistoryCreateCallbackAtIndex(idx)) != nullptr; ++idx)
{
MemoryHistorySP memory_history_sp (create_callback (process));
- if (memory_history_sp.get())
+ if (memory_history_sp)
return memory_history_sp;
}
-//===-- OperatingSystem.cpp --------------------------------------------*- C++ -*-===//
+//===-- OperatingSystem.cpp -------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
//
//===----------------------------------------------------------------------===//
-
-#include "lldb/Target/OperatingSystem.h"
// C Includes
// C++ Includes
// Other libraries and framework includes
+// Project includes
+#include "lldb/Target/OperatingSystem.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Target/Thread.h"
using namespace lldb;
using namespace lldb_private;
-
OperatingSystem*
OperatingSystem::FindPlugin (Process *process, const char *plugin_name)
{
- OperatingSystemCreateInstance create_callback = NULL;
+ OperatingSystemCreateInstance create_callback = nullptr;
if (plugin_name)
{
ConstString const_plugin_name(plugin_name);
if (create_callback)
{
std::unique_ptr<OperatingSystem> instance_ap(create_callback(process, true));
- if (instance_ap.get())
+ if (instance_ap)
return instance_ap.release();
}
}
else
{
- for (uint32_t idx = 0; (create_callback = PluginManager::GetOperatingSystemCreateCallbackAtIndex(idx)) != NULL; ++idx)
+ for (uint32_t idx = 0; (create_callback = PluginManager::GetOperatingSystemCreateCallbackAtIndex(idx)) != nullptr; ++idx)
{
std::unique_ptr<OperatingSystem> instance_ap(create_callback(process, false));
- if (instance_ap.get())
+ if (instance_ap)
return instance_ap.release();
}
}
- return NULL;
+ return nullptr;
}
{
}
-OperatingSystem::~OperatingSystem()
-{
-}
-
+OperatingSystem::~OperatingSystem() = default;
bool
OperatingSystem::IsOperatingSystemPluginThread (const lldb::ThreadSP &thread_sp)
return thread_sp->IsOperatingSystemPluginThread();
return false;
}
-
//===----------------------------------------------------------------------===//
// C Includes
-#include <limits.h>
-#include <string.h>
-
// C++ Includes
+#include <climits>
+#include <cstring>
+
// Other libraries and framework includes
// Project includes
#include "lldb/Core/Error.h"
// PathMappingList constructor
//----------------------------------------------------------------------
PathMappingList::PathMappingList () :
- m_pairs (),
- m_callback (NULL),
- m_callback_baton (NULL),
- m_mod_id (0)
+ m_pairs(),
+ m_callback(nullptr),
+ m_callback_baton(nullptr),
+ m_mod_id(0)
{
}
{
}
-
PathMappingList::PathMappingList (const PathMappingList &rhs) :
- m_pairs (rhs.m_pairs),
- m_callback (NULL),
- m_callback_baton (NULL),
- m_mod_id (0)
+ m_pairs(rhs.m_pairs),
+ m_callback(nullptr),
+ m_callback_baton(nullptr),
+ m_mod_id(0)
{
-
}
const PathMappingList &
if (this != &rhs)
{
m_pairs = rhs.m_pairs;
- m_callback = NULL;
- m_callback_baton = NULL;
+ m_callback = nullptr;
+ m_callback_baton = nullptr;
m_mod_id = rhs.m_mod_id;
}
return *this;
}
-
-//----------------------------------------------------------------------
-// Destructor
-//----------------------------------------------------------------------
-PathMappingList::~PathMappingList ()
-{
-}
+PathMappingList::~PathMappingList() = default;
void
PathMappingList::Append (const ConstString &path,
bool
PathMappingList::RemapPath (const char *path, std::string &new_path) const
{
- if (m_pairs.empty() || path == NULL || path[0] == '\0')
+ if (m_pairs.empty() || path == nullptr || path[0] == '\0')
return false;
const_iterator pos, end = m_pairs.end();
return false;
}
-
-
uint32_t
PathMappingList::FindIndexForPath (const ConstString &path) const
{
}
return UINT32_MAX;
}
-
//
//===----------------------------------------------------------------------===//
-#include "lldb/Target/Platform.h"
-
// C Includes
-
// C++ Includes
#include <algorithm>
#include <fstream>
#include <vector>
// Other libraries and framework includes
+#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/Path.h"
+
// Project includes
+#include "lldb/Target/Platform.h"
#include "lldb/Breakpoint/BreakpointIDList.h"
#include "lldb/Core/DataBufferHeap.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/UnixSignals.h"
#include "lldb/Utility/Utils.h"
-#include "llvm/Support/FileSystem.h"
-#include "llvm/Support/Path.h"
-
#include "Utility/ModuleCache.h"
-
// Define these constants from POSIX mman.h rather than include the file
// so that they will be correct even when compiled on Linux.
#define MAP_PRIVATE 2
//PlatformSP
//Platform::FindPlugin (Process *process, const ConstString &plugin_name)
//{
-// PlatformCreateInstance create_callback = NULL;
+// PlatformCreateInstance create_callback = nullptr;
// if (plugin_name)
// {
// create_callback = PluginManager::GetPlatformCreateCallbackForPluginName (plugin_name);
// }
// else
// {
-// for (uint32_t idx = 0; (create_callback = PluginManager::GetPlatformCreateCallbackAtIndex(idx)) != NULL; ++idx)
+// for (uint32_t idx = 0; (create_callback = PluginManager::GetPlatformCreateCallbackAtIndex(idx)) != nullptr; ++idx)
// {
// PlatformSP platform_sp(create_callback(process, nullptr));
// if (platform_sp)
PlatformSP
Platform::Create (const ConstString &name, Error &error)
{
- PlatformCreateInstance create_callback = NULL;
+ PlatformCreateInstance create_callback = nullptr;
lldb::PlatformSP platform_sp;
if (name)
{
create_callback = PluginManager::GetPlatformCreateCallbackForPluginName (name);
if (create_callback)
- platform_sp = create_callback(true, NULL);
+ platform_sp = create_callback(true, nullptr);
else
error.SetErrorStringWithFormat ("unable to find a plug-in for the platform named \"%s\"", name.GetCString());
}
return platform_sp;
}
-
PlatformSP
Platform::Create (const ArchSpec &arch, ArchSpec *platform_arch_ptr, Error &error)
{
std::string specific_info(GetPlatformSpecificConnectionInformation());
- if (specific_info.empty() == false)
+ if (!specific_info.empty())
strm.Printf("Platform-specific connection: %s\n", specific_info.c_str());
}
-
bool
Platform::GetOSVersion (uint32_t &major,
uint32_t &minor,
default_compilation_options.end());
}
-
FileSpec
Platform::GetWorkingDirectory ()
{
}
}
-
struct RecurseCopyBaton
{
const FileSpec& dst;
Error error;
};
-
static FileSpec::EnumerateDirectoryResult
RecurseCopy_Callback (void *baton,
FileSpec::FileType file_type,
return FileSpec::eEnumerateDirectoryResultNext;
}
break;
+
case FileSpec::eFileTypeRegular:
{
// copy the file and keep going
return "127.0.0.1";
if (m_name.empty())
- return NULL;
+ return nullptr;
return m_name.c_str();
}
return SetCachedUserName (uid, name.c_str(), name.size());
}
#endif
- return NULL;
+ return nullptr;
}
const char *
return SetCachedGroupName (gid, name.c_str(), name.size());
}
#endif
- return NULL;
+ return nullptr;
}
bool
return false;
}
-
Error
Platform::ResolveExecutable (const ModuleSpec &module_spec,
lldb::ModuleSP &exe_module_sp,
{
if (module_spec.GetArchitecture().IsValid())
{
- error = ModuleList::GetSharedModule (module_spec,
- exe_module_sp,
- module_search_paths_ptr,
- NULL,
- NULL);
+ error = ModuleList::GetSharedModule(module_spec,
+ exe_module_sp,
+ module_search_paths_ptr,
+ nullptr,
+ nullptr);
}
else
{
ModuleSpec arch_module_spec(module_spec);
for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, arch_module_spec.GetArchitecture()); ++idx)
{
- error = ModuleList::GetSharedModule (arch_module_spec,
- exe_module_sp,
- module_search_paths_ptr,
- NULL,
- NULL);
+ error = ModuleList::GetSharedModule(arch_module_spec,
+ exe_module_sp,
+ module_search_paths_ptr,
+ nullptr,
+ nullptr);
// Did we find an executable using one of the
if (error.Success() && exe_module_sp)
break;
else
error.SetErrorString("unable to resolve symbol file");
return error;
-
-}
-
-
+}
bool
Platform::ResolveRemotePath (const FileSpec &platform_path,
return resolved_platform_path.ResolvePath();
}
-
const ArchSpec &
Platform::GetSystemArchitecture()
{
return m_system_arch;
}
-
Error
Platform::ConnectRemote (Args& args)
{
return match_count;
}
-
Error
Platform::LaunchProcess (ProcessLaunchInfo &launch_info)
{
lldb::ProcessSP
Platform::DebugProcess (ProcessLaunchInfo &launch_info,
Debugger &debugger,
- Target *target, // Can be NULL, if NULL create a new target, else use existing one
+ Target *target, // Can be nullptr, if nullptr create a new target, else use existing one
Error &error)
{
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PLATFORM));
return process_sp;
}
-
lldb::PlatformSP
Platform::GetPlatformForArchitecture (const ArchSpec &arch, ArchSpec *platform_arch_ptr)
{
return platform_sp;
}
-
//------------------------------------------------------------------
/// Lets a platform answer if it is compatible with a given
/// architecture and the target triple contained within.
}
lldb_private::Error
-Platform::RunShellCommand(const char *command, // Shouldn't be NULL
+Platform::RunShellCommand(const char *command, // Shouldn't be nullptr
const FileSpec &working_dir, // Pass empty FileSpec to use the current working directory
- int *status_ptr, // Pass NULL if you don't want the process exit status
- int *signo_ptr, // Pass NULL if you don't want the signal that caused the process to exit
- std::string *command_output, // Pass NULL if you don't want the command output
+ int *status_ptr, // Pass nullptr if you don't want the process exit status
+ int *signo_ptr, // Pass nullptr if you don't want the signal that caused the process to exit
+ std::string *command_output, // Pass nullptr if you don't want the command output
uint32_t timeout_sec) // Timeout in seconds to wait for shell program to finish
{
if (IsHost())
return Error("unimplemented");
}
-
bool
Platform::CalculateMD5 (const FileSpec& file_spec,
uint64_t &low,
static OptionDefinition
g_rsync_option_table[] =
{
- { LLDB_OPT_SET_ALL, false, "rsync" , 'r', OptionParser::eNoArgument, NULL, NULL, 0, eArgTypeNone , "Enable rsync." },
- { LLDB_OPT_SET_ALL, false, "rsync-opts" , 'R', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeCommandName , "Platform-specific options required for rsync to work." },
- { LLDB_OPT_SET_ALL, false, "rsync-prefix" , 'P', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeCommandName , "Platform-specific rsync prefix put before the remote path." },
- { LLDB_OPT_SET_ALL, false, "ignore-remote-hostname" , 'i', OptionParser::eNoArgument, NULL, NULL, 0, eArgTypeNone , "Do not automatically fill in the remote hostname when composing the rsync command." },
+ { LLDB_OPT_SET_ALL, false, "rsync" , 'r', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone , "Enable rsync." },
+ { LLDB_OPT_SET_ALL, false, "rsync-opts" , 'R', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeCommandName , "Platform-specific options required for rsync to work." },
+ { LLDB_OPT_SET_ALL, false, "rsync-prefix" , 'P', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeCommandName , "Platform-specific rsync prefix put before the remote path." },
+ { LLDB_OPT_SET_ALL, false, "ignore-remote-hostname" , 'i', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone , "Do not automatically fill in the remote hostname when composing the rsync command." },
};
static OptionDefinition
g_ssh_option_table[] =
{
- { LLDB_OPT_SET_ALL, false, "ssh" , 's', OptionParser::eNoArgument, NULL, NULL, 0, eArgTypeNone , "Enable SSH." },
- { LLDB_OPT_SET_ALL, false, "ssh-opts" , 'S', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeCommandName , "Platform-specific options required for SSH to work." },
+ { LLDB_OPT_SET_ALL, false, "ssh" , 's', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone , "Enable SSH." },
+ { LLDB_OPT_SET_ALL, false, "ssh-opts" , 'S', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeCommandName , "Platform-specific options required for SSH to work." },
};
static OptionDefinition
g_caching_option_table[] =
{
- { LLDB_OPT_SET_ALL, false, "local-cache-dir" , 'c', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypePath , "Path in which to store local copies of files." },
+ { LLDB_OPT_SET_ALL, false, "local-cache-dir" , 'c', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypePath , "Path in which to store local copies of files." },
};
-OptionGroupPlatformRSync::OptionGroupPlatformRSync ()
-{
-}
-
-OptionGroupPlatformRSync::~OptionGroupPlatformRSync ()
-{
-}
-
const lldb_private::OptionDefinition*
OptionGroupPlatformRSync::GetDefinitions ()
{
return lldb::BreakpointSP();
}
-OptionGroupPlatformSSH::OptionGroupPlatformSSH ()
-{
-}
-
-OptionGroupPlatformSSH::~OptionGroupPlatformSSH ()
-{
-}
-
const lldb_private::OptionDefinition*
OptionGroupPlatformSSH::GetDefinitions ()
{
return llvm::array_lengthof(g_ssh_option_table);
}
-OptionGroupPlatformCaching::OptionGroupPlatformCaching ()
-{
-}
-
-OptionGroupPlatformCaching::~OptionGroupPlatformCaching ()
-{
-}
-
const lldb_private::OptionDefinition*
OptionGroupPlatformCaching::GetDefinitions ()
{
//
//===----------------------------------------------------------------------===//
-#include "lldb/Host/Config.h"
+// C Includes
+// C++ Includes
+#include <climits>
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Host/Config.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Log.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Target/FileAction.h"
#include "lldb/Target/Target.h"
-#if !defined(_WIN32)
-#include <limits.h>
-#endif
-
using namespace lldb;
using namespace lldb_private;
// ProcessLaunchInfo member functions
//----------------------------------------------------------------------------
-ProcessLaunchInfo::ProcessLaunchInfo () :
+ProcessLaunchInfo::ProcessLaunchInfo() :
ProcessInfo(),
- m_working_dir (),
- m_plugin_name (),
- m_flags (0),
- m_file_actions (),
- m_pty (new lldb_utility::PseudoTerminal),
- m_resume_count (0),
- m_monitor_callback (NULL),
- m_monitor_callback_baton (NULL),
- m_monitor_signals (false),
- m_listener_sp (),
- m_hijack_listener_sp ()
+ m_working_dir(),
+ m_plugin_name(),
+ m_flags(0),
+ m_file_actions(),
+ m_pty(new lldb_utility::PseudoTerminal),
+ m_resume_count(0),
+ m_monitor_callback(nullptr),
+ m_monitor_callback_baton(nullptr),
+ m_monitor_signals(false),
+ m_listener_sp(),
+ m_hijack_listener_sp()
{
}
m_file_actions(),
m_pty(new lldb_utility::PseudoTerminal),
m_resume_count(0),
- m_monitor_callback(NULL),
- m_monitor_callback_baton(NULL),
+ m_monitor_callback(nullptr),
+ m_monitor_callback_baton(nullptr),
m_monitor_signals(false),
m_listener_sp (),
m_hijack_listener_sp()
{
if (idx < m_file_actions.size())
return &m_file_actions[idx];
- return NULL;
+ return nullptr;
}
const FileAction *
if (m_file_actions[idx].GetFD () == fd)
return &m_file_actions[idx];
}
- return NULL;
+ return nullptr;
}
const FileSpec &
const char *
ProcessLaunchInfo::GetProcessPluginName () const
{
- if (m_plugin_name.empty())
- return NULL;
- return m_plugin_name.c_str();
+ return (m_plugin_name.empty() ? nullptr : m_plugin_name.c_str());
}
void
// If nothing for stdin or stdout or stderr was specified, then check the process for any default
// settings that were set with "settings set"
- if (GetFileActionForFD(STDIN_FILENO) == NULL ||
- GetFileActionForFD(STDOUT_FILENO) == NULL ||
- GetFileActionForFD(STDERR_FILENO) == NULL)
+ if (GetFileActionForFD(STDIN_FILENO) == nullptr ||
+ GetFileActionForFD(STDOUT_FILENO) == nullptr ||
+ GetFileActionForFD(STDERR_FILENO) == nullptr)
{
if (log)
log->Printf ("ProcessLaunchInfo::%s at least one of stdin/stdout/stderr was not set, evaluating default handling",
{
// Only override with the target settings if we don't already have
// an action for in, out or error
- if (GetFileActionForFD(STDIN_FILENO) == NULL)
+ if (GetFileActionForFD(STDIN_FILENO) == nullptr)
in_file_spec = target->GetStandardInputPath();
- if (GetFileActionForFD(STDOUT_FILENO) == NULL)
+ if (GetFileActionForFD(STDOUT_FILENO) == nullptr)
out_file_spec = target->GetStandardOutputPath();
- if (GetFileActionForFD(STDERR_FILENO) == NULL)
+ if (GetFileActionForFD(STDERR_FILENO) == nullptr)
err_file_spec = target->GetStandardErrorPath();
}
// this will have to do for now.
open_flags |= O_CLOEXEC;
#endif
- if (m_pty->OpenFirstAvailableMaster(open_flags, NULL, 0))
+ if (m_pty->OpenFirstAvailableMaster(open_flags, nullptr, 0))
{
- const FileSpec slave_file_spec{m_pty->GetSlaveName(NULL, 0), false};
+ const FileSpec slave_file_spec{m_pty->GetSlaveName(nullptr, 0), false};
// Only use the slave tty if we don't have anything specified for
// input and don't have an action for stdin
- if (!in_file_spec && GetFileActionForFD(STDIN_FILENO) == NULL)
+ if (!in_file_spec && GetFileActionForFD(STDIN_FILENO) == nullptr)
{
AppendOpenFileAction(STDIN_FILENO, slave_file_spec, true, false);
}
// Only use the slave tty if we don't have anything specified for
// output and don't have an action for stdout
- if (!out_file_spec && GetFileActionForFD(STDOUT_FILENO) == NULL)
+ if (!out_file_spec && GetFileActionForFD(STDOUT_FILENO) == nullptr)
{
AppendOpenFileAction(STDOUT_FILENO, slave_file_spec, false, true);
}
// Only use the slave tty if we don't have anything specified for
// error and don't have an action for stderr
- if (!err_file_spec && GetFileActionForFD(STDERR_FILENO) == NULL)
+ if (!err_file_spec && GetFileActionForFD(STDERR_FILENO) == nullptr)
{
AppendOpenFileAction(STDERR_FILENO, slave_file_spec, false, true);
}
}
}
-
bool
ProcessLaunchInfo::ConvertArgumentsForLaunchingInShell (Error &error,
bool localhost,
std::string shell_executable = m_shell.GetPath();
const char **argv = GetArguments().GetConstArgumentVector ();
- if (argv == NULL || argv[0] == NULL)
+ if (argv == nullptr || argv[0] == nullptr)
return false;
Args shell_arguments;
std::string safe_arg;
}
else
{
- for (size_t i=0; argv[i] != NULL; ++i)
+ for (size_t i=0; argv[i] != nullptr; ++i)
{
const char *arg = Args::GetShellSafeArgument (argv[i], safe_arg);
shell_command.Printf(" %s", arg);
{
}
-//----------------------------------------------------------------------
-// Destructor
-//----------------------------------------------------------------------
-RegisterContext::~RegisterContext()
-{
-}
+RegisterContext::~RegisterContext() = default;
void
RegisterContext::InvalidateIfNeeded (bool force)
}
}
-
const RegisterInfo *
RegisterContext::GetRegisterInfoByName (const char *reg_name, uint32_t start_idx)
{
{
const RegisterInfo * reg_info = GetRegisterInfoAtIndex(reg);
- if ((reg_info->name != NULL && ::strcasecmp (reg_info->name, reg_name) == 0) ||
- (reg_info->alt_name != NULL && ::strcasecmp (reg_info->alt_name, reg_name) == 0))
+ if ((reg_info->name != nullptr && ::strcasecmp (reg_info->name, reg_name) == 0) ||
+ (reg_info->alt_name != nullptr && ::strcasecmp (reg_info->alt_name, reg_name) == 0))
{
return reg_info;
}
}
}
- return NULL;
+ return nullptr;
}
const RegisterInfo *
{
const uint32_t reg_num = ConvertRegisterKindToRegisterNumber(kind, num);
if (reg_num == LLDB_INVALID_REGNUM)
- return NULL;
+ return nullptr;
return GetRegisterInfoAtIndex (reg_num);
}
const RegisterInfo * reg_info = GetRegisterInfoAtIndex(reg);
if (reg_info)
return reg_info->name;
- return NULL;
+ return nullptr;
}
uint64_t
return ReadRegisterAsUnsigned (reg, fail_value);
}
-
uint64_t
RegisterContext::ReadRegisterAsUnsigned (uint32_t reg, uint64_t fail_value)
{
return false;
}
-
uint32_t
RegisterContext::NumSupportedHardwareWatchpoints ()
{
RegisterValue ®_value)
{
Error error;
- if (reg_info == NULL)
+ if (reg_info == nullptr)
{
error.SetErrorString ("invalid register info argument.");
return error;
}
-
// Moving from addr into a register
//
// Case 1: src_len == dst_len
uint32_t dst_len,
const RegisterValue ®_value)
{
-
uint8_t dst[RegisterValue::kMaxRegisterByteSize];
Error error;
error.SetErrorString("invalid process");
return error;
-
}
bool
return m_thread.CalculateTarget();
}
-
ProcessSP
RegisterContext::CalculateProcess ()
{
m_thread.CalculateExecutionContext (exe_ctx);
}
-
bool
RegisterContext::ConvertBetweenRegisterKinds (lldb::RegisterKind source_rk, uint32_t source_regnum, lldb::RegisterKind target_rk, uint32_t& target_regnum)
{
if (reg_info->kinds[source_rk] == source_regnum)
{
target_regnum = reg_info->kinds[target_rk];
- if (target_regnum == LLDB_INVALID_REGNUM)
- {
- return false;
- }
- else
- {
- return true;
- }
+ return (target_regnum != LLDB_INVALID_REGNUM);
}
}
return false;