aboutsummaryrefslogtreecommitdiff
path: root/include/lldb/Target/Platform.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/lldb/Target/Platform.h')
-rw-r--r--include/lldb/Target/Platform.h30
1 files changed, 17 insertions, 13 deletions
diff --git a/include/lldb/Target/Platform.h b/include/lldb/Target/Platform.h
index 8b14cc2a0ece..f4596bd00f0b 100644
--- a/include/lldb/Target/Platform.h
+++ b/include/lldb/Target/Platform.h
@@ -28,7 +28,7 @@
// TODO pull NativeDelegate class out of NativeProcessProtocol so we
// can just forward ref the NativeDelegate rather than include it here.
-#include "../../../source/Host/common/NativeProcessProtocol.h"
+#include "lldb/Host/common/NativeProcessProtocol.h"
namespace lldb_private {
@@ -380,6 +380,12 @@ namespace lldb_private {
LaunchProcess (ProcessLaunchInfo &launch_info);
//------------------------------------------------------------------
+ /// Kill process on a platform.
+ //------------------------------------------------------------------
+ virtual Error
+ KillProcess (const lldb::pid_t pid);
+
+ //------------------------------------------------------------------
/// Lets a platform answer if it is compatible with a given
/// architecture and the target triple contained within.
//------------------------------------------------------------------
@@ -569,7 +575,7 @@ namespace lldb_private {
// Appends the platform-specific options required to find the modules for the current platform.
virtual void
- AddClangModuleCompilationOptions (std::vector<std::string> &options);
+ AddClangModuleCompilationOptions (Target *target, std::vector<std::string> &options);
ConstString
GetWorkingDirectory ();
@@ -952,8 +958,7 @@ namespace lldb_private {
uint32_t m_update_os_version;
ArchSpec m_system_arch; // The architecture of the kernel or the remote platform
typedef std::map<uint32_t, ConstString> IDToNameMap;
- Mutex m_uid_map_mutex;
- Mutex m_gid_map_mutex;
+ Mutex m_mutex; // Mutex for modifying Platform data structures that should only be used for non-reentrant code
IDToNameMap m_uid_map;
IDToNameMap m_gid_map;
size_t m_max_uid_name_len;
@@ -967,7 +972,6 @@ namespace lldb_private {
std::string m_local_cache_directory;
std::vector<ConstString> m_trap_handlers;
bool m_calculated_trap_handlers;
- Mutex m_trap_handler_mutex;
//------------------------------------------------------------------
/// Ask the Platform subclass to fill in the list of trap handler names
@@ -988,7 +992,7 @@ namespace lldb_private {
const char *
GetCachedUserName (uint32_t uid)
{
- Mutex::Locker locker (m_uid_map_mutex);
+ Mutex::Locker locker (m_mutex);
IDToNameMap::iterator pos = m_uid_map.find (uid);
if (pos != m_uid_map.end())
{
@@ -1004,7 +1008,7 @@ namespace lldb_private {
const char *
SetCachedUserName (uint32_t uid, const char *name, size_t name_len)
{
- Mutex::Locker locker (m_uid_map_mutex);
+ Mutex::Locker locker (m_mutex);
ConstString const_name (name);
m_uid_map[uid] = const_name;
if (m_max_uid_name_len < name_len)
@@ -1016,7 +1020,7 @@ namespace lldb_private {
void
SetUserNameNotFound (uint32_t uid)
{
- Mutex::Locker locker (m_uid_map_mutex);
+ Mutex::Locker locker (m_mutex);
m_uid_map[uid] = ConstString();
}
@@ -1024,14 +1028,14 @@ namespace lldb_private {
void
ClearCachedUserNames ()
{
- Mutex::Locker locker (m_uid_map_mutex);
+ Mutex::Locker locker (m_mutex);
m_uid_map.clear();
}
const char *
GetCachedGroupName (uint32_t gid)
{
- Mutex::Locker locker (m_gid_map_mutex);
+ Mutex::Locker locker (m_mutex);
IDToNameMap::iterator pos = m_gid_map.find (gid);
if (pos != m_gid_map.end())
{
@@ -1047,7 +1051,7 @@ namespace lldb_private {
const char *
SetCachedGroupName (uint32_t gid, const char *name, size_t name_len)
{
- Mutex::Locker locker (m_gid_map_mutex);
+ Mutex::Locker locker (m_mutex);
ConstString const_name (name);
m_gid_map[gid] = const_name;
if (m_max_gid_name_len < name_len)
@@ -1059,14 +1063,14 @@ namespace lldb_private {
void
SetGroupNameNotFound (uint32_t gid)
{
- Mutex::Locker locker (m_gid_map_mutex);
+ Mutex::Locker locker (m_mutex);
m_gid_map[gid] = ConstString();
}
void
ClearCachedGroupNames ()
{
- Mutex::Locker locker (m_gid_map_mutex);
+ Mutex::Locker locker (m_mutex);
m_gid_map.clear();
}