Added a speed test to the GDBRemoteCommunicationClient and
GDBRemoteCommunicationServer classes. This involved adding a new packet
named "qSpeedTest" which can test the speed of a packet send/response pairs
using a wide variety of send/recv packet sizes.
Added a few new connection classes: one for shared memory, and one for using
mach messages (Apple only). The mach message stuff is experimental and not
working yet, but added so I don't lose the code. The shared memory stuff
uses pretty standard calls to setup shared memory.
llvm-svn: 128837
diff --git a/lldb/tools/lldb-platform/lldb-platform.cpp b/lldb/tools/lldb-platform/lldb-platform.cpp
index 8e4174e..be83597 100644
--- a/lldb/tools/lldb-platform/lldb-platform.cpp
+++ b/lldb/tools/lldb-platform/lldb-platform.cpp
@@ -21,6 +21,7 @@
// Other libraries and framework includes
#include "lldb/Core/Error.h"
#include "lldb/Core/ConnectionFileDescriptor.h"
+#include "lldb/Core/ConnectionMachPort.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/StreamFile.h"
#include "GDBRemoteCommunicationServer.h"
@@ -70,11 +71,50 @@
int long_option_index = 0;
StreamSP log_stream_sp;
Args log_args;
+ Error error;
std::string listen_host_post;
char ch;
Debugger::Initialize();
-
+// ConnectionMachPort a;
+// ConnectionMachPort b;
+//
+// lldb::ConnectionStatus status;
+// const char *bootstrap_service_name = "HelloWorld";
+// status = a.BootstrapCheckIn(bootstrap_service_name, &error);
+//
+// if (status != eConnectionStatusSuccess)
+// {
+// fprintf(stderr, "%s", error.AsCString());
+// return 1;
+// }
+// status = b.BootstrapLookup (bootstrap_service_name, &error);
+// if (status != eConnectionStatusSuccess)
+// {
+// fprintf(stderr, "%s", error.AsCString());
+// return 2;
+// }
+//
+// if (a.Write ("hello", 5, status, &error) == 5)
+// {
+// char buf[32];
+// memset(buf, 0, sizeof(buf));
+// if (b.Read (buf, 5, status, &error))
+// {
+// printf("read returned bytes: %s", buf);
+// }
+// else
+// {
+// fprintf(stderr, "%s", error.AsCString());
+// return 4;
+// }
+// }
+// else
+// {
+// fprintf(stderr, "%s", error.AsCString());
+// return 3;
+// }
+
while ((ch = getopt_long(argc, argv, "l:f:L:", g_long_options, &long_option_index)) != -1)
{
// DNBLogDebug("option: ch == %c (0x%2.2x) --%s%c%s\n",
@@ -141,7 +181,6 @@
GDBRemoteCommunicationServer gdb_server;
- Error error;
if (!listen_host_post.empty())
{
std::auto_ptr<ConnectionFileDescriptor> conn_ap(new ConnectionFileDescriptor());