summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2016-08-12 16:46:18 +0000
committerGreg Clayton <gclayton@apple.com>2016-08-12 16:46:18 +0000
commitc6c420fca14d9eac716c2099514bcfcaea94809c (patch)
tree22239e938218c4fa3d60d967aa4fff42936121eb /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
parent623c4c1572ab07864ad9efd37e672eca60707675 (diff)
downloadbcm5719-llvm-c6c420fca14d9eac716c2099514bcfcaea94809c.tar.gz
bcm5719-llvm-c6c420fca14d9eac716c2099514bcfcaea94809c.zip
Switch over to using socketpair for local debugserver connections as they are twice as fast as TCP sockets (on macOS at least).
This change opens a socket pair and passes the second socket pair file descriptor down to the debugserver binary using a new option: "--fd=N" where N is the file descriptor. This file descriptor gets passed via posix_spawn() so that there is no need to do any bind/listen or bind/accept calls and eliminates the hanshake unix socket that is used to pass the result of the actual port that ends up being used so it can save time on launch as well as being faster. This is currently only enabled on __APPLE__ builds. Other OSs should try modifying the #define from ProcessGDBRemote.cpp but the first person will need to port the --fd option over to lldb-server. Any OSs that enable USE_SOCKETPAIR_FOR_LOCAL_CONNECTION in their native builds can use the socket pair stuff. The #define is Apple only right now, but looks like: #if defined (__APPLE__) #define USE_SOCKETPAIR_FOR_LOCAL_CONNECTION 1 #endif <rdar://problem/27814880> llvm-svn: 278524
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
index 13325410e48..623f0d16653 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
@@ -162,7 +162,8 @@ public:
Platform *platform, // If non nullptr, then check with the platform for the GDB server binary if it can't be located
ProcessLaunchInfo &launch_info,
uint16_t *port,
- const Args& inferior_args = Args());
+ const Args *inferior_args,
+ int pass_comm_fd); // Communication file descriptor to pass during fork/exec to avoid having to connect/accept
void
DumpHistory(Stream &strm);
OpenPOWER on IntegriCloud