Skip to content

Commit 7bbae3c

Browse files
committed
[lldb[RPC] Upstream RPC server interface emitters
This commit upstreams the LLDB RPC server interface emitters. These emitters generate the server-side API interfaces for RPC, which communicate directly with liblldb itself out of process using the SB API. https://discourse.llvm.org/t/rfc-upstreaming-lldb-rpc/85804
1 parent 27e8e08 commit 7bbae3c

File tree

9 files changed

+1247
-0
lines changed

9 files changed

+1247
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// This ia a basic header file used to check that the server-side emitter
2+
// for rpc-gen emits an expected set of includes in a generated source file.
3+
#ifndef LLDB_API_SBRPC_CHECKBASICINCLUDE_H
4+
#define LLDB_API_SBRPC_CHECKBASICINCLUDE_H
5+
6+
#endif // LLDB_API_SBRPC_CHECKBASICINCLUDE_H
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#ifndef LLDB_API_SBRPC_CHECKCONSTCHARPOINTER_H
2+
#define LLDB_API_SBRPC_CHECKCONSTCHARPOINTER_H
3+
4+
namespace lldb {
5+
class LLDB_API SBRPC_CHECKCONSTCHARPOINTER {
6+
public:
7+
// const char * parameters must decoded as rpc_common::ConstCharPointer in server side
8+
// source files.
9+
int CheckConstCharPointer(char *string);
10+
11+
}; // class SBRPC_CHECKCONSTCHARPOINTER
12+
} // namespace lldb
13+
14+
#endif // LLDB_API_SBRPC_CHECKCONSTCHARPOINTER_H
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Disabling until the lldb-rpc-gen tool lands.
2+
XFAIL: *
3+
RUN: mkdir -p %t/server
4+
RUN: mkdir -p %t/lib
5+
RUN: %lldb-rpc-gen --output-dir=%t %S/../../Inputs/CheckBasicIncludesEmit.h
6+
7+
RUN: cat %t/lib/CheckBasicIncludesEmit.cpp | FileCheck %s
8+
9+
# All server-side source files must have these includes at the top of their files.
10+
CHECK: #include "RPCUserServer.h"
11+
CHECK: #include "SBAPI.h"
12+
CHECK: #include <lldb-rpc/common/RPCArgument.h>
13+
CHECK: #include <lldb-rpc/common/RPCCommon.h>
14+
CHECK: #include <lldb-rpc/common/RPCFunction.h>
15+
CHECK: #include <lldb/API/LLDB.h>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Disabling until the lldb-rpc-gen tool lands.
2+
XFAIL: *
3+
RUN: mkdir -p %t/server
4+
RUN: mkdir -p %t/lib
5+
RUN: %lldb-rpc-gen --output-dir=%t %S/../../Inputs/CheckConstCharPointer.h
6+
7+
RUN: cat %t/lib/CheckConstCharPointer.cpp | FileCheck %s
8+
9+
# const char * pointers must be decoded as rpc_common::ConstCharPointer objects
10+
# in server side source files.
11+
CHECK: rpc_common::ConstCharPointer string

0 commit comments

Comments
 (0)