summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-07-19 07:03:07 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-07-19 07:03:07 +0000
commita884e649599e13d58ce6d2b2a0ce8091ceb48dac (patch)
treef527514e113dd4f771eef3d39e5a5d2da36b8552 /include
parente75e363cb71a7339552b9d943e78ac62b737379b (diff)
downloadsrc-test2-a884e649599e13d58ce6d2b2a0ce8091ceb48dac.tar.gz
src-test2-a884e649599e13d58ce6d2b2a0ce8091ceb48dac.zip
Notes
Diffstat (limited to 'include')
-rw-r--r--include/lldb/Host/MainLoop.h2
-rw-r--r--include/lldb/Host/PosixApi.h2
-rw-r--r--include/lldb/Host/SocketAddress.h5
-rw-r--r--include/lldb/Host/common/NativeProcessProtocol.h7
-rw-r--r--include/lldb/Host/common/NativeThreadProtocol.h6
-rw-r--r--include/lldb/Interpreter/CommandInterpreter.h2
-rw-r--r--include/lldb/Utility/DataExtractor.h1
-rw-r--r--include/lldb/lldb-private-forward.h4
-rw-r--r--include/lldb/lldb-types.h24
9 files changed, 16 insertions, 37 deletions
diff --git a/include/lldb/Host/MainLoop.h b/include/lldb/Host/MainLoop.h
index a722348b8843..5ac145ff865b 100644
--- a/include/lldb/Host/MainLoop.h
+++ b/include/lldb/Host/MainLoop.h
@@ -12,8 +12,8 @@
#include "lldb/Host/Config.h"
#include "lldb/Host/MainLoopBase.h"
-
#include "llvm/ADT/DenseMap.h"
+#include <csignal>
#if !HAVE_PPOLL && !HAVE_SYS_EVENT_H
#define SIGNAL_POLLING_UNSUPPORTED 1
diff --git a/include/lldb/Host/PosixApi.h b/include/lldb/Host/PosixApi.h
index 02324307dc9e..d5c48dd6d170 100644
--- a/include/lldb/Host/PosixApi.h
+++ b/include/lldb/Host/PosixApi.h
@@ -16,6 +16,8 @@
#if defined(_WIN32)
#include "lldb/Host/windows/PosixApi.h"
+#else
+#include <unistd.h>
#endif
#endif
diff --git a/include/lldb/Host/SocketAddress.h b/include/lldb/Host/SocketAddress.h
index 8e9026ba962c..ebc6f4e57ee8 100644
--- a/include/lldb/Host/SocketAddress.h
+++ b/include/lldb/Host/SocketAddress.h
@@ -152,6 +152,11 @@ public:
bool IsAnyAddr() const;
//------------------------------------------------------------------
+ // Returns true if the socket is INADDR_LOOPBACK
+ //------------------------------------------------------------------
+ bool IsLocalhost() const;
+
+ //------------------------------------------------------------------
// Direct access to all of the sockaddr structures
//------------------------------------------------------------------
struct sockaddr &sockaddr() {
diff --git a/include/lldb/Host/common/NativeProcessProtocol.h b/include/lldb/Host/common/NativeProcessProtocol.h
index 5f2157510c0a..9671d710fc02 100644
--- a/include/lldb/Host/common/NativeProcessProtocol.h
+++ b/include/lldb/Host/common/NativeProcessProtocol.h
@@ -33,8 +33,7 @@ class ResumeActionList;
//------------------------------------------------------------------
// NativeProcessProtocol
//------------------------------------------------------------------
-class NativeProcessProtocol
- : public std::enable_shared_from_this<NativeProcessProtocol> {
+class NativeProcessProtocol {
friend class SoftwareBreakpoint;
public:
@@ -268,7 +267,7 @@ public:
/// A NativeProcessProtocol shared pointer if the operation succeeded or
/// an error object if it failed.
//------------------------------------------------------------------
- virtual llvm::Expected<NativeProcessProtocolSP>
+ virtual llvm::Expected<std::unique_ptr<NativeProcessProtocol>>
Launch(ProcessLaunchInfo &launch_info, NativeDelegate &native_delegate,
MainLoop &mainloop) const = 0;
@@ -292,7 +291,7 @@ public:
/// A NativeProcessProtocol shared pointer if the operation succeeded or
/// an error object if it failed.
//------------------------------------------------------------------
- virtual llvm::Expected<NativeProcessProtocolSP>
+ virtual llvm::Expected<std::unique_ptr<NativeProcessProtocol>>
Attach(lldb::pid_t pid, NativeDelegate &native_delegate,
MainLoop &mainloop) const = 0;
};
diff --git a/include/lldb/Host/common/NativeThreadProtocol.h b/include/lldb/Host/common/NativeThreadProtocol.h
index 2e6c96a34cf5..d96f71311185 100644
--- a/include/lldb/Host/common/NativeThreadProtocol.h
+++ b/include/lldb/Host/common/NativeThreadProtocol.h
@@ -23,7 +23,7 @@ namespace lldb_private {
class NativeThreadProtocol
: public std::enable_shared_from_this<NativeThreadProtocol> {
public:
- NativeThreadProtocol(NativeProcessProtocol *process, lldb::tid_t tid);
+ NativeThreadProtocol(NativeProcessProtocol &process, lldb::tid_t tid);
virtual ~NativeThreadProtocol() {}
@@ -46,7 +46,7 @@ public:
lldb::tid_t GetID() const { return m_tid; }
- NativeProcessProtocolSP GetProcess();
+ NativeProcessProtocol &GetProcess() { return m_process; }
// ---------------------------------------------------------------------
// Thread-specific watchpoints
@@ -64,7 +64,7 @@ public:
virtual Status RemoveHardwareBreakpoint(lldb::addr_t addr) = 0;
protected:
- NativeProcessProtocolWP m_process_wp;
+ NativeProcessProtocol &m_process;
lldb::tid_t m_tid;
};
}
diff --git a/include/lldb/Interpreter/CommandInterpreter.h b/include/lldb/Interpreter/CommandInterpreter.h
index f47411079a3a..73bd7d6e6220 100644
--- a/include/lldb/Interpreter/CommandInterpreter.h
+++ b/include/lldb/Interpreter/CommandInterpreter.h
@@ -539,7 +539,7 @@ private:
std::string m_repeat_command; // Stores the command that will be executed for
// an empty command string.
lldb::ScriptInterpreterSP m_script_interpreter_sp;
- std::mutex m_script_interpreter_mutex;
+ std::recursive_mutex m_script_interpreter_mutex;
lldb::IOHandlerSP m_command_io_handler_sp;
char m_comment_char;
bool m_batch_command_mode;
diff --git a/include/lldb/Utility/DataExtractor.h b/include/lldb/Utility/DataExtractor.h
index 58240d9a5268..4ef78c1af492 100644
--- a/include/lldb/Utility/DataExtractor.h
+++ b/include/lldb/Utility/DataExtractor.h
@@ -15,6 +15,7 @@
#include "lldb/lldb-forward.h" // for DataBufferSP
#include "lldb/lldb-types.h"
+#include <cassert>
#include <stdint.h>
#include <string.h>
diff --git a/include/lldb/lldb-private-forward.h b/include/lldb/lldb-private-forward.h
index 69a231132982..296facb1a0bd 100644
--- a/include/lldb/lldb-private-forward.h
+++ b/include/lldb/lldb-private-forward.h
@@ -30,10 +30,6 @@ class UnixSignals;
// SP/WP decls.
// ---------------------------------------------------------------
typedef std::shared_ptr<NativeBreakpoint> NativeBreakpointSP;
-typedef std::shared_ptr<lldb_private::NativeProcessProtocol>
- NativeProcessProtocolSP;
-typedef std::weak_ptr<lldb_private::NativeProcessProtocol>
- NativeProcessProtocolWP;
typedef std::shared_ptr<lldb_private::NativeRegisterContext>
NativeRegisterContextSP;
typedef std::shared_ptr<lldb_private::NativeThreadProtocol>
diff --git a/include/lldb/lldb-types.h b/include/lldb/lldb-types.h
index 07e9f5ac7161..fc445f55a9e5 100644
--- a/include/lldb/lldb-types.h
+++ b/include/lldb/lldb-types.h
@@ -13,16 +13,10 @@
#include "lldb/lldb-enumerations.h"
#include "lldb/lldb-forward.h"
-#include <assert.h>
-#include <signal.h>
#include <stdint.h>
//----------------------------------------------------------------------
// All host systems must define:
-// lldb::condition_t The native condition type (or a substitute class)
-// for conditions on the host system.
-// lldb::mutex_t The native mutex type for mutex objects on the host
-// system.
// lldb::thread_t The native thread type for spawned threads on the
// system
// lldb::thread_arg_t The type of the one any only thread creation
@@ -34,32 +28,22 @@
// #define LLDB_INVALID_PROCESS_ID ...
// #define LLDB_INVALID_THREAD_ID ...
// #define LLDB_INVALID_HOST_THREAD ...
-// #define IS_VALID_LLDB_HOST_THREAD ...
//----------------------------------------------------------------------
// TODO: Add a bunch of ifdefs to determine the host system and what
// things should be defined. Currently MacOSX is being assumed by default
// since that is what lldb was first developed for.
-#ifndef _MSC_VER
-#include <stdbool.h>
-#include <unistd.h>
-#endif
-
#ifdef _WIN32
#include <process.h>
namespace lldb {
-typedef void *mutex_t;
-typedef void *condition_t;
typedef void *rwlock_t;
typedef void *process_t; // Process type is HANDLE
typedef void *thread_t; // Host thread type
typedef void *file_t; // Host file type
-typedef void *pipe_t; // Host pipe type
typedef unsigned int __w64 socket_t; // Host socket type
-typedef uint32_t thread_key_t;
typedef void *thread_arg_t; // Host thread argument type
typedef unsigned thread_result_t; // Host thread result type
typedef thread_result_t (*thread_func_t)(void *); // Host thread function type
@@ -73,15 +57,11 @@ namespace lldb {
//----------------------------------------------------------------------
// MacOSX Types
//----------------------------------------------------------------------
-typedef ::pthread_mutex_t mutex_t;
-typedef pthread_cond_t condition_t;
typedef pthread_rwlock_t rwlock_t;
typedef uint64_t process_t; // Process type is just a pid.
typedef pthread_t thread_t; // Host thread type
typedef int file_t; // Host file type
-typedef int pipe_t; // Host pipe type
typedef int socket_t; // Host socket type
-typedef pthread_key_t thread_key_t;
typedef void *thread_arg_t; // Host thread argument type
typedef void *thread_result_t; // Host thread result type
typedef void *(*thread_func_t)(void *); // Host thread function type
@@ -100,10 +80,6 @@ typedef bool (*ExpressionCancelCallback)(ExpressionEvaluationPhase phase,
#define LLDB_INVALID_PROCESS ((lldb::process_t)-1)
#define LLDB_INVALID_HOST_THREAD ((lldb::thread_t)NULL)
-#define IS_VALID_LLDB_HOST_THREAD(t) ((t) != LLDB_INVALID_HOST_THREAD)
-
-#define LLDB_INVALID_HOST_TIME \
- { 0, 0 }
namespace lldb {
typedef uint64_t addr_t;