LLDB mainline
lldb-types.h
Go to the documentation of this file.
1//===-- lldb-types.h --------------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_LLDB_TYPES_H
10#define LLDB_LLDB_TYPES_H
11
13#include "lldb/lldb-forward.h"
14
15#include <cstdint>
16
17// All host systems must define:
18// lldb::rwlock_t The type representing a read/write lock on the host
19// lldb::process_t The type representing a process on the host
20// lldb::thread_t The native thread type for spawned threads on the
21// host
22// lldb::file_t The type representing a file on the host
23// lldb::socket_t The type representing a socket on the host
24// lldb::thread_arg_t The type of the one and only thread creation
25// argument for the host system
26// lldb::thread_result_t The type that gets returned when a thread finishes
27// lldb::thread_func_t The function prototype used to spawn a thread on the
28// host system.
29// lldb::pipe_t The type representing a pipe on the host
30//
31// Additionally, lldb defines a few macros based on these definitions:
32// LLDB_INVALID_PROCESS The value of an invalid lldb::process_t
33// LLDB_INVALID_HOST_THREAD The value of an invalid lldb::thread_t
34// LLDB_INVALID_PIPE The value of an invalid lldb::pipe_t
35
36#ifdef _WIN32
37
38#include <process.h>
39
40namespace lldb {
41typedef void *rwlock_t;
42typedef void *process_t; // Process type is HANDLE
43typedef void *thread_t; // Host thread type
44typedef void *file_t; // Host file type
45typedef unsigned int __w64 socket_t; // Host socket type
46typedef void *thread_arg_t; // Host thread argument type
47typedef unsigned thread_result_t; // Host thread result type
48typedef thread_result_t (*thread_func_t)(void *); // Host thread function type
49typedef void *pipe_t; // Host pipe type is HANDLE
50
51#else
52
53#include <pthread.h>
54
55namespace lldb {
56typedef pthread_rwlock_t rwlock_t;
57typedef uint64_t process_t; // Process type is just a pid.
58typedef pthread_t thread_t; // Host thread type
59typedef int file_t; // Host file type
60typedef int socket_t; // Host socket type
61typedef void *thread_arg_t; // Host thread argument type
62typedef void *thread_result_t; // Host thread result type
63typedef void *(*thread_func_t)(void *); // Host thread function type
64typedef int pipe_t; // Host pipe type
65
66#endif // _WIN32
67
68#define LLDB_INVALID_PROCESS ((lldb::process_t)-1)
69#define LLDB_INVALID_HOST_THREAD ((lldb::thread_t)NULL)
70#define LLDB_INVALID_PIPE ((lldb::pipe_t)-1)
71#define LLDB_INVALID_CALLBACK_TOKEN ((lldb::callback_token_t) - 1)
72
73typedef void (*LogOutputCallback)(const char *, void *baton);
74typedef bool (*CommandOverrideCallback)(void *baton, const char **argv);
75typedef bool (*ExpressionCancelCallback)(lldb::ExpressionEvaluationPhase phase,
76 void *baton);
77
78typedef void *ScriptObjectPtr;
79
80typedef uint64_t addr_t;
81typedef int32_t callback_token_t;
82typedef uint64_t user_id_t;
83typedef uint64_t pid_t;
84typedef uint64_t tid_t;
85typedef uint64_t offset_t;
86typedef int32_t break_id_t;
87typedef int32_t watch_id_t;
88typedef uint32_t wp_resource_id_t;
90typedef uint64_t queue_id_t;
91typedef uint32_t cpu_id_t; // CPU core id
92
93} // namespace lldb
94
95#endif // LLDB_LLDB_TYPES_H
Definition: SBAddress.h:15
int file_t
Definition: lldb-types.h:59
void * thread_arg_t
Definition: lldb-types.h:61
ExpressionEvaluationPhase
Expression Evaluation Stages.
void * opaque_compiler_type_t
Definition: lldb-types.h:89
int pipe_t
Definition: lldb-types.h:64
void * ScriptObjectPtr
Definition: lldb-types.h:78
void * thread_result_t
Definition: lldb-types.h:62
uint64_t offset_t
Definition: lldb-types.h:85
int32_t break_id_t
Definition: lldb-types.h:86
pthread_t thread_t
Definition: lldb-types.h:58
uint64_t pid_t
Definition: lldb-types.h:83
uint32_t cpu_id_t
Definition: lldb-types.h:91
int32_t watch_id_t
Definition: lldb-types.h:87
int socket_t
Definition: lldb-types.h:60
int32_t callback_token_t
Definition: lldb-types.h:81
uint64_t user_id_t
Definition: lldb-types.h:82
uint64_t addr_t
Definition: lldb-types.h:80
pthread_rwlock_t rwlock_t
Definition: lldb-types.h:56
uint64_t tid_t
Definition: lldb-types.h:84
uint64_t queue_id_t
Definition: lldb-types.h:90
uint64_t process_t
Definition: lldb-types.h:57
uint32_t wp_resource_id_t
Definition: lldb-types.h:88