1 //===-- lldb-types.h --------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLDB_lldb_types_h_
11 #define LLDB_lldb_types_h_
13 #include "lldb/lldb-enumerations.h"
14 #include "lldb/lldb-forward.h"
20 //----------------------------------------------------------------------
21 // All host systems must define:
22 // lldb::condition_t The native condition type (or a substitute class)
23 // for conditions on the host system.
24 // lldb::mutex_t The native mutex type for mutex objects on the host
26 // lldb::thread_t The native thread type for spawned threads on the
28 // lldb::thread_arg_t The type of the one any only thread creation
29 // argument for the host system
30 // lldb::thread_result_t The return type that gets returned when a thread
32 // lldb::thread_func_t The function prototype used to spawn a thread on the
34 // #define LLDB_INVALID_PROCESS_ID ...
35 // #define LLDB_INVALID_THREAD_ID ...
36 // #define LLDB_INVALID_HOST_THREAD ...
37 // #define IS_VALID_LLDB_HOST_THREAD ...
38 //----------------------------------------------------------------------
40 // TODO: Add a bunch of ifdefs to determine the host system and what
41 // things should be defined. Currently MacOSX is being assumed by default
42 // since that is what lldb was first developed for.
54 typedef void *mutex_t;
55 typedef void *condition_t;
56 typedef void *rwlock_t;
57 typedef void *process_t; // Process type is HANDLE
58 typedef void *thread_t; // Host thread type
59 typedef void *file_t; // Host file type
60 typedef void *pipe_t; // Host pipe type
61 typedef unsigned int __w64 socket_t; // Host socket type
62 typedef uint32_t thread_key_t;
63 typedef void *thread_arg_t; // Host thread argument type
64 typedef unsigned thread_result_t; // Host thread result type
65 typedef thread_result_t (*thread_func_t)(void *); // Host thread function type
73 //----------------------------------------------------------------------
75 //----------------------------------------------------------------------
76 typedef ::pthread_mutex_t mutex_t;
77 typedef pthread_cond_t condition_t;
78 typedef pthread_rwlock_t rwlock_t;
79 typedef uint64_t process_t; // Process type is just a pid.
80 typedef pthread_t thread_t; // Host thread type
81 typedef int file_t; // Host file type
82 typedef int pipe_t; // Host pipe type
83 typedef int socket_t; // Host socket type
84 typedef pthread_key_t thread_key_t;
85 typedef void *thread_arg_t; // Host thread argument type
86 typedef void *thread_result_t; // Host thread result type
87 typedef void *(*thread_func_t)(void *); // Host thread function type
93 typedef void (*LogOutputCallback)(const char *, void *baton);
94 typedef bool (*CommandOverrideCallback)(void *baton, const char **argv);
95 typedef bool (*CommandOverrideCallbackWithResult)(
96 void *baton, const char **argv, lldb_private::CommandReturnObject &result);
97 typedef bool (*ExpressionCancelCallback)(ExpressionEvaluationPhase phase,
101 #define LLDB_INVALID_PROCESS ((lldb::process_t)-1)
102 #define LLDB_INVALID_HOST_THREAD ((lldb::thread_t)NULL)
103 #define IS_VALID_LLDB_HOST_THREAD(t) ((t) != LLDB_INVALID_HOST_THREAD)
105 #define LLDB_INVALID_HOST_TIME \
109 typedef uint64_t addr_t;
110 typedef uint64_t user_id_t;
111 typedef uint64_t pid_t;
112 typedef uint64_t tid_t;
113 typedef uint64_t offset_t;
114 typedef int32_t break_id_t;
115 typedef int32_t watch_id_t;
116 typedef void *opaque_compiler_type_t;
117 typedef uint64_t queue_id_t;
120 #endif // LLDB_lldb_types_h_