aboutsummaryrefslogtreecommitdiff
path: root/include/lldb/Target
diff options
context:
space:
mode:
Diffstat (limited to 'include/lldb/Target')
-rw-r--r--include/lldb/Target/FileAction.h2
-rw-r--r--include/lldb/Target/LanguageRuntime.h7
-rw-r--r--include/lldb/Target/NativeRegisterContext.h190
-rw-r--r--include/lldb/Target/NativeRegisterContextRegisterInfo.h44
-rw-r--r--include/lldb/Target/ObjCLanguageRuntime.h7
-rw-r--r--include/lldb/Target/Platform.h30
-rw-r--r--include/lldb/Target/Process.h6
7 files changed, 37 insertions, 249 deletions
diff --git a/include/lldb/Target/FileAction.h b/include/lldb/Target/FileAction.h
index 228a9e6098c1..4015cbb5ea89 100644
--- a/include/lldb/Target/FileAction.h
+++ b/include/lldb/Target/FileAction.h
@@ -1,4 +1,4 @@
-//===-- ProcessLaunchInfo.h -------------------------------------*- C++ -*-===//
+//===-- FileAction.h --------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
diff --git a/include/lldb/Target/LanguageRuntime.h b/include/lldb/Target/LanguageRuntime.h
index 0aaa67c2382c..d5ed81956475 100644
--- a/include/lldb/Target/LanguageRuntime.h
+++ b/include/lldb/Target/LanguageRuntime.h
@@ -102,6 +102,13 @@ public:
virtual lldb::SearchFilterSP
CreateExceptionSearchFilter ();
+
+ virtual bool
+ GetTypeBitSize (const ClangASTType& clang_type,
+ uint64_t &size)
+ {
+ return false;
+ }
protected:
//------------------------------------------------------------------
diff --git a/include/lldb/Target/NativeRegisterContext.h b/include/lldb/Target/NativeRegisterContext.h
deleted file mode 100644
index fa4ab013f234..000000000000
--- a/include/lldb/Target/NativeRegisterContext.h
+++ /dev/null
@@ -1,190 +0,0 @@
-//===-- NativeRegisterContext.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_NativeRegisterContext_h_
-#define liblldb_NativeRegisterContext_h_
-
-// C Includes
-// C++ Includes
-// Other libraries and framework includes
-// Project includes
-#include "lldb/lldb-private.h"
-
-namespace lldb_private {
-
-class NativeThreadProtocol;
-
-class NativeRegisterContext:
- public std::enable_shared_from_this<NativeRegisterContext>
-{
-public:
- //------------------------------------------------------------------
- // Constructors and Destructors
- //------------------------------------------------------------------
- NativeRegisterContext (NativeThreadProtocol &thread, uint32_t concrete_frame_idx);
-
- virtual
- ~NativeRegisterContext ();
-
- // void
- // InvalidateIfNeeded (bool force);
-
- //------------------------------------------------------------------
- // Subclasses must override these functions
- //------------------------------------------------------------------
- // virtual void
- // InvalidateAllRegisters () = 0;
-
- virtual uint32_t
- GetRegisterCount () const = 0;
-
- virtual const RegisterInfo *
- GetRegisterInfoAtIndex (uint32_t reg) const = 0;
-
- const char *
- GetRegisterSetNameForRegisterAtIndex (uint32_t reg_index) const;
-
- virtual uint32_t
- GetRegisterSetCount () const = 0;
-
- virtual const RegisterSet *
- GetRegisterSet (uint32_t set_index) const = 0;
-
- virtual Error
- ReadRegister (const RegisterInfo *reg_info, RegisterValue &reg_value) = 0;
-
- virtual Error
- WriteRegister (const RegisterInfo *reg_info, const RegisterValue &reg_value) = 0;
-
- virtual Error
- ReadAllRegisterValues (lldb::DataBufferSP &data_sp) = 0;
-
- virtual Error
- WriteAllRegisterValues (const lldb::DataBufferSP &data_sp) = 0;
-
- uint32_t
- ConvertRegisterKindToRegisterNumber (uint32_t kind, uint32_t num) const;
-
- //------------------------------------------------------------------
- // Subclasses can override these functions if desired
- //------------------------------------------------------------------
- virtual uint32_t
- NumSupportedHardwareBreakpoints ();
-
- virtual uint32_t
- SetHardwareBreakpoint (lldb::addr_t addr, size_t size);
-
- virtual bool
- ClearHardwareBreakpoint (uint32_t hw_idx);
-
- virtual uint32_t
- NumSupportedHardwareWatchpoints ();
-
- virtual uint32_t
- SetHardwareWatchpoint (lldb::addr_t addr, size_t size, uint32_t watch_flags);
-
- virtual bool
- ClearHardwareWatchpoint (uint32_t hw_index);
-
- virtual bool
- HardwareSingleStep (bool enable);
-
- virtual Error
- ReadRegisterValueFromMemory (const lldb_private::RegisterInfo *reg_info, lldb::addr_t src_addr, lldb::addr_t src_len, RegisterValue &reg_value);
-
- virtual Error
- WriteRegisterValueToMemory (const lldb_private::RegisterInfo *reg_info, lldb::addr_t dst_addr, lldb::addr_t dst_len, const RegisterValue &reg_value);
-
- //------------------------------------------------------------------
- // Subclasses should not override these
- //------------------------------------------------------------------
- virtual lldb::tid_t
- GetThreadID() const;
-
- virtual NativeThreadProtocol &
- GetThread ()
- {
- return m_thread;
- }
-
- const RegisterInfo *
- GetRegisterInfoByName (const char *reg_name, uint32_t start_idx = 0);
-
- const RegisterInfo *
- GetRegisterInfo (uint32_t reg_kind, uint32_t reg_num);
-
- lldb::addr_t
- GetPC (lldb::addr_t fail_value = LLDB_INVALID_ADDRESS);
-
- Error
- SetPC (lldb::addr_t pc);
-
- lldb::addr_t
- GetSP (lldb::addr_t fail_value = LLDB_INVALID_ADDRESS);
-
- Error
- SetSP (lldb::addr_t sp);
-
- lldb::addr_t
- GetFP (lldb::addr_t fail_value = LLDB_INVALID_ADDRESS);
-
- Error
- SetFP (lldb::addr_t fp);
-
- const char *
- GetRegisterName (uint32_t reg);
-
- lldb::addr_t
- GetReturnAddress (lldb::addr_t fail_value = LLDB_INVALID_ADDRESS);
-
- lldb::addr_t
- GetFlags (lldb::addr_t fail_value = 0);
-
- lldb::addr_t
- ReadRegisterAsUnsigned (uint32_t reg, lldb::addr_t fail_value);
-
- lldb::addr_t
- ReadRegisterAsUnsigned (const RegisterInfo *reg_info, lldb::addr_t fail_value);
-
- Error
- WriteRegisterFromUnsigned (uint32_t reg, uint64_t uval);
-
- Error
- WriteRegisterFromUnsigned (const RegisterInfo *reg_info, uint64_t uval);
-
- // uint32_t
- // GetStopID () const
- // {
- // return m_stop_id;
- // }
-
- // void
- // SetStopID (uint32_t stop_id)
- // {
- // m_stop_id = stop_id;
- // }
-
-protected:
- //------------------------------------------------------------------
- // Classes that inherit from RegisterContext can see and modify these
- //------------------------------------------------------------------
- NativeThreadProtocol &m_thread; // The thread that this register context belongs to.
- uint32_t m_concrete_frame_idx; // The concrete frame index for this register context
- // uint32_t m_stop_id; // The stop ID that any data in this context is valid for
-
-private:
- //------------------------------------------------------------------
- // For RegisterContext only
- //------------------------------------------------------------------
- DISALLOW_COPY_AND_ASSIGN (NativeRegisterContext);
-};
-
-} // namespace lldb_private
-
-#endif // liblldb_NativeRegisterContext_h_
diff --git a/include/lldb/Target/NativeRegisterContextRegisterInfo.h b/include/lldb/Target/NativeRegisterContextRegisterInfo.h
deleted file mode 100644
index 5631005ca56e..000000000000
--- a/include/lldb/Target/NativeRegisterContextRegisterInfo.h
+++ /dev/null
@@ -1,44 +0,0 @@
-//===-- NativeRegisterContextRegisterInfo.h ----------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef lldb_NativeRegisterContextRegisterInfo_h
-#define lldb_NativeRegisterContextRegisterInfo_h
-
-#include <memory>
-
-#include "NativeRegisterContext.h"
-#include "Plugins/Process/Utility/RegisterInfoInterface.h"
-
-namespace lldb_private
-{
- class NativeRegisterContextRegisterInfo: public NativeRegisterContext
- {
- public:
- ///
- /// Construct a NativeRegisterContextRegisterInfo, taking ownership
- /// of the register_info_interface pointer.
- ///
- NativeRegisterContextRegisterInfo (NativeThreadProtocol &thread,
- uint32_t concrete_frame_idx,
- RegisterInfoInterface *register_info_interface);
-
- uint32_t
- GetRegisterCount () const override;
-
- const RegisterInfo *
- GetRegisterInfoAtIndex (uint32_t reg_index) const override;
-
- const RegisterInfoInterface&
- GetRegisterInfoInterface () const;
-
- private:
- std::unique_ptr<RegisterInfoInterface> m_register_info_interface_up;
- };
-}
-#endif
diff --git a/include/lldb/Target/ObjCLanguageRuntime.h b/include/lldb/Target/ObjCLanguageRuntime.h
index a3fee91428fa..42a391478e3e 100644
--- a/include/lldb/Target/ObjCLanguageRuntime.h
+++ b/include/lldb/Target/ObjCLanguageRuntime.h
@@ -20,6 +20,7 @@
// Project includes
#include "lldb/lldb-private.h"
#include "lldb/Core/PluginInterface.h"
+#include "lldb/Core/ThreadSafeDenseMap.h"
#include "lldb/Symbol/ClangASTType.h"
#include "lldb/Symbol/DeclVendor.h"
#include "lldb/Symbol/Type.h"
@@ -514,6 +515,10 @@ public:
m_negative_complete_class_cache.clear();
}
+ virtual bool
+ GetTypeBitSize (const ClangASTType& clang_type,
+ uint64_t &size);
+
protected:
//------------------------------------------------------------------
// Classes that inherit from ObjCLanguageRuntime can see and modify these
@@ -610,11 +615,13 @@ private:
typedef std::multimap<uint32_t, ObjCISA> HashToISAMap;
typedef ISAToDescriptorMap::iterator ISAToDescriptorIterator;
typedef HashToISAMap::iterator HashToISAIterator;
+ typedef ThreadSafeDenseMap<void*, uint64_t> TypeSizeCache;
MsgImplMap m_impl_cache;
LazyBool m_has_new_literals_and_indexing;
ISAToDescriptorMap m_isa_to_descriptor;
HashToISAMap m_hash_to_isa_map;
+ TypeSizeCache m_type_size_cache;
protected:
uint32_t m_isa_to_descriptor_stop_id;
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();
}
diff --git a/include/lldb/Target/Process.h b/include/lldb/Target/Process.h
index e04de511c797..6608391b94fd 100644
--- a/include/lldb/Target/Process.h
+++ b/include/lldb/Target/Process.h
@@ -678,13 +678,16 @@ public:
bool
IsLastResumeForUserExpression () const
{
+ // If we haven't yet resumed the target, then it can't be for a user expression...
+ if (m_resume_id == 0)
+ return false;
+
return m_resume_id == m_last_user_expression_resume;
}
void
SetRunningUserExpression (bool on)
{
- // REMOVEME printf ("Setting running user expression %s at resume id %d - value: %d.\n", on ? "on" : "off", m_resume_id, m_running_user_expression);
if (on)
m_running_user_expression++;
else
@@ -3177,6 +3180,7 @@ protected:
lldb::IOHandlerSP m_process_input_reader;
Communication m_stdio_communication;
Mutex m_stdio_communication_mutex;
+ bool m_stdio_disable; /// Remember process launch setting
std::string m_stdout_data;
std::string m_stderr_data;
Mutex m_profile_data_comm_mutex;