]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/lldb-types.h
MFV r337586: lua: Update to 5.3.5
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / lldb-types.h
1 //===-- lldb-types.h --------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLDB_lldb_types_h_
11 #define LLDB_lldb_types_h_
12
13 #include "lldb/lldb-enumerations.h"
14 #include "lldb/lldb-forward.h"
15
16 #include <stdint.h>
17
18 //----------------------------------------------------------------------
19 // All host systems must define:
20 //  lldb::thread_t          The native thread type for spawned threads on the
21 //  system
22 //  lldb::thread_arg_t      The type of the one any only thread creation
23 //  argument for the host system
24 //  lldb::thread_result_t   The return type that gets returned when a thread
25 //  finishes.
26 //  lldb::thread_func_t     The function prototype used to spawn a thread on the
27 //  host system.
28 //  #define LLDB_INVALID_PROCESS_ID ...
29 //  #define LLDB_INVALID_THREAD_ID ...
30 //  #define LLDB_INVALID_HOST_THREAD ...
31 //----------------------------------------------------------------------
32
33 // TODO: Add a bunch of ifdefs to determine the host system and what
34 // things should be defined. Currently MacOSX is being assumed by default
35 // since that is what lldb was first developed for.
36
37 #ifdef _WIN32
38
39 #include <process.h>
40
41 namespace lldb {
42 typedef void *rwlock_t;
43 typedef void *process_t;             // Process type is HANDLE
44 typedef void *thread_t;              // Host thread type
45 typedef void *file_t;                // Host file type
46 typedef unsigned int __w64 socket_t; // Host socket type
47 typedef void *thread_arg_t;                       // Host thread argument type
48 typedef unsigned thread_result_t;                 // Host thread result type
49 typedef thread_result_t (*thread_func_t)(void *); // Host thread function type
50 }
51
52 #else
53
54 #include <pthread.h>
55
56 namespace lldb {
57 //----------------------------------------------------------------------
58 // MacOSX Types
59 //----------------------------------------------------------------------
60 typedef pthread_rwlock_t rwlock_t;
61 typedef uint64_t process_t; // Process type is just a pid.
62 typedef pthread_t thread_t; // Host thread type
63 typedef int file_t;         // Host file type
64 typedef int socket_t;       // Host socket type
65 typedef void *thread_arg_t;             // Host thread argument type
66 typedef void *thread_result_t;          // Host thread result type
67 typedef void *(*thread_func_t)(void *); // Host thread function type
68 } // namespace lldb
69
70 #endif
71
72 namespace lldb {
73 typedef void (*LogOutputCallback)(const char *, void *baton);
74 typedef bool (*CommandOverrideCallback)(void *baton, const char **argv);
75 typedef bool (*CommandOverrideCallbackWithResult)(
76     void *baton, const char **argv, lldb_private::CommandReturnObject &result);
77 typedef bool (*ExpressionCancelCallback)(ExpressionEvaluationPhase phase,
78                                          void *baton);
79 }
80
81 #define LLDB_INVALID_PROCESS ((lldb::process_t)-1)
82 #define LLDB_INVALID_HOST_THREAD ((lldb::thread_t)NULL)
83
84 namespace lldb {
85 typedef uint64_t addr_t;
86 typedef uint64_t user_id_t;
87 typedef uint64_t pid_t;
88 typedef uint64_t tid_t;
89 typedef uint64_t offset_t;
90 typedef int32_t break_id_t;
91 typedef int32_t watch_id_t;
92 typedef void *opaque_compiler_type_t;
93 typedef uint64_t queue_id_t;
94 }
95
96 #endif // LLDB_lldb_types_h_