2011-03-22 09:34:44 +08:00
|
|
|
//===-- lldb-platform.cpp ---------------------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2011-03-23 08:09:55 +08:00
|
|
|
// C Includes
|
2011-03-22 09:34:44 +08:00
|
|
|
#include <errno.h>
|
2014-08-07 02:16:26 +08:00
|
|
|
#if defined(__APPLE__)
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#endif
|
2011-03-22 09:34:44 +08:00
|
|
|
#include <signal.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2015-03-25 20:51:31 +08:00
|
|
|
#include <sys/wait.h>
|
2011-03-22 09:34:44 +08:00
|
|
|
|
2011-03-23 08:09:55 +08:00
|
|
|
// C++ Includes
|
2015-07-07 02:05:19 +08:00
|
|
|
#include <fstream>
|
2011-03-23 08:09:55 +08:00
|
|
|
|
|
|
|
// Other libraries and framework includes
|
|
|
|
#include "lldb/Core/Error.h"
|
2014-10-07 05:22:36 +08:00
|
|
|
#include "lldb/Host/ConnectionFileDescriptor.h"
|
2015-07-07 02:05:19 +08:00
|
|
|
#include "lldb/Host/FileSpec.h"
|
|
|
|
#include "lldb/Host/FileSystem.h"
|
2014-08-07 02:16:26 +08:00
|
|
|
#include "lldb/Host/HostGetOpt.h"
|
2013-11-23 09:58:15 +08:00
|
|
|
#include "lldb/Host/OptionParser.h"
|
2015-03-25 20:51:31 +08:00
|
|
|
#include "lldb/Host/Socket.h"
|
2015-07-07 02:05:19 +08:00
|
|
|
#include "llvm/Support/FileSystem.h"
|
|
|
|
#include "llvm/Support/FileUtilities.h"
|
2015-05-27 21:34:04 +08:00
|
|
|
#include "LLDBServerUtilities.h"
|
2015-02-11 18:29:30 +08:00
|
|
|
#include "Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h"
|
2011-03-24 12:28:38 +08:00
|
|
|
#include "Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h"
|
2015-02-11 18:29:30 +08:00
|
|
|
|
2011-03-23 08:09:55 +08:00
|
|
|
using namespace lldb;
|
|
|
|
using namespace lldb_private;
|
2015-05-27 21:34:04 +08:00
|
|
|
using namespace lldb_private::lldb_server;
|
2015-03-31 17:52:22 +08:00
|
|
|
using namespace lldb_private::process_gdb_remote;
|
2015-05-27 21:34:04 +08:00
|
|
|
using namespace llvm;
|
2011-03-23 08:09:55 +08:00
|
|
|
|
2011-03-22 09:34:44 +08:00
|
|
|
//----------------------------------------------------------------------
|
2013-04-05 04:35:24 +08:00
|
|
|
// option descriptors for getopt_long_only()
|
2011-03-22 09:34:44 +08:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
2015-02-18 23:39:41 +08:00
|
|
|
static int g_debug = 0;
|
|
|
|
static int g_verbose = 0;
|
2015-03-25 20:51:31 +08:00
|
|
|
static int g_server = 0;
|
2011-03-22 09:34:44 +08:00
|
|
|
|
|
|
|
static struct option g_long_options[] =
|
|
|
|
{
|
|
|
|
{ "debug", no_argument, &g_debug, 1 },
|
|
|
|
{ "verbose", no_argument, &g_verbose, 1 },
|
2015-05-27 21:34:04 +08:00
|
|
|
{ "log-file", required_argument, NULL, 'l' },
|
|
|
|
{ "log-channels", required_argument, NULL, 'c' },
|
2011-03-23 08:09:55 +08:00
|
|
|
{ "listen", required_argument, NULL, 'L' },
|
2013-11-23 02:55:04 +08:00
|
|
|
{ "port-offset", required_argument, NULL, 'p' },
|
|
|
|
{ "gdbserver-port", required_argument, NULL, 'P' },
|
2013-11-21 09:44:58 +08:00
|
|
|
{ "min-gdbserver-port", required_argument, NULL, 'm' },
|
|
|
|
{ "max-gdbserver-port", required_argument, NULL, 'M' },
|
2015-07-07 02:05:19 +08:00
|
|
|
{ "port-file", required_argument, NULL, 'f' },
|
2015-03-25 20:51:31 +08:00
|
|
|
{ "server", no_argument, &g_server, 1 },
|
2011-03-22 09:34:44 +08:00
|
|
|
{ NULL, 0, NULL, 0 }
|
|
|
|
};
|
|
|
|
|
2013-11-21 09:44:58 +08:00
|
|
|
#if defined (__APPLE__)
|
|
|
|
#define LOW_PORT (IPPORT_RESERVED)
|
|
|
|
#define HIGH_PORT (IPPORT_HIFIRSTAUTO)
|
|
|
|
#else
|
|
|
|
#define LOW_PORT (1024u)
|
|
|
|
#define HIGH_PORT (49151u)
|
|
|
|
#endif
|
|
|
|
|
2011-03-22 09:34:44 +08:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// Watch for signals
|
|
|
|
//----------------------------------------------------------------------
|
2015-02-18 23:39:41 +08:00
|
|
|
static void
|
2011-03-22 09:34:44 +08:00
|
|
|
signal_handler(int signo)
|
|
|
|
{
|
|
|
|
switch (signo)
|
|
|
|
{
|
2013-08-27 07:57:52 +08:00
|
|
|
case SIGHUP:
|
|
|
|
// Use SIGINT first, if that does not work, use SIGHUP as a last resort.
|
|
|
|
// And we should not call exit() here because it results in the global destructors
|
|
|
|
// to be invoked and wreaking havoc on the threads still running.
|
2015-03-06 22:36:33 +08:00
|
|
|
Host::SystemLog(Host::eSystemLogWarning, "SIGHUP received, exiting lldb-server...\n");
|
2013-08-27 07:57:52 +08:00
|
|
|
abort();
|
|
|
|
break;
|
2011-03-22 09:34:44 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-27 07:57:52 +08:00
|
|
|
static void
|
2015-02-18 23:39:41 +08:00
|
|
|
display_usage (const char *progname, const char *subcommand)
|
2013-08-27 07:57:52 +08:00
|
|
|
{
|
2015-07-07 02:05:19 +08:00
|
|
|
fprintf(stderr, "Usage:\n %s %s [--log-file log-file-name] [--log-channels log-channel-list] [--port-file port-file-path] --server --listen port\n", progname, subcommand);
|
2013-08-27 07:57:52 +08:00
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
|
2015-07-07 02:05:19 +08:00
|
|
|
static Error
|
|
|
|
save_port_to_file(const uint16_t port, const FileSpec &port_file_spec)
|
|
|
|
{
|
2015-07-15 02:54:52 +08:00
|
|
|
FileSpec temp_file_spec(port_file_spec.GetDirectory().AsCString(), false);
|
|
|
|
auto error = FileSystem::MakeDirectory(temp_file_spec, eFilePermissionsDirectoryDefault);
|
2015-07-07 02:05:19 +08:00
|
|
|
if (error.Fail())
|
2015-07-15 02:54:52 +08:00
|
|
|
return Error("Failed to create directory %s: %s", temp_file_spec.GetCString(), error.AsCString());
|
2015-07-07 02:05:19 +08:00
|
|
|
|
|
|
|
llvm::SmallString<PATH_MAX> temp_file_path;
|
2015-07-15 02:54:52 +08:00
|
|
|
temp_file_spec.AppendPathComponent("port-file.%%%%%%");
|
|
|
|
auto err_code = llvm::sys::fs::createUniqueFile(temp_file_spec.GetCString(), temp_file_path);
|
2015-07-07 02:05:19 +08:00
|
|
|
if (err_code)
|
|
|
|
return Error("Failed to create temp file: %s", err_code.message().c_str());
|
|
|
|
|
|
|
|
llvm::FileRemover tmp_file_remover(temp_file_path.c_str());
|
|
|
|
|
|
|
|
{
|
|
|
|
std::ofstream temp_file(temp_file_path.c_str(), std::ios::out);
|
|
|
|
if (!temp_file.is_open())
|
|
|
|
return Error("Failed to open temp file %s", temp_file_path.c_str());
|
|
|
|
temp_file << port;
|
|
|
|
}
|
|
|
|
|
|
|
|
err_code = llvm::sys::fs::rename(temp_file_path.c_str(), port_file_spec.GetPath().c_str());
|
|
|
|
if (err_code)
|
|
|
|
return Error("Failed to rename file %s to %s: %s",
|
|
|
|
temp_file_path.c_str(), port_file_spec.GetPath().c_str(), err_code.message().c_str());
|
|
|
|
|
|
|
|
tmp_file_remover.releaseFile();
|
|
|
|
return Error();
|
|
|
|
}
|
|
|
|
|
2011-03-22 09:34:44 +08:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// main
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
int
|
2015-02-18 23:39:41 +08:00
|
|
|
main_platform (int argc, char *argv[])
|
2011-03-22 09:34:44 +08:00
|
|
|
{
|
2013-08-27 07:57:52 +08:00
|
|
|
const char *progname = argv[0];
|
2015-02-18 23:39:41 +08:00
|
|
|
const char *subcommand = argv[1];
|
|
|
|
argc--;
|
|
|
|
argv++;
|
2013-11-23 09:58:15 +08:00
|
|
|
signal (SIGPIPE, SIG_IGN);
|
2013-08-27 07:57:52 +08:00
|
|
|
signal (SIGHUP, signal_handler);
|
2011-03-22 09:34:44 +08:00
|
|
|
int long_option_index = 0;
|
2011-04-05 02:18:57 +08:00
|
|
|
Error error;
|
2011-06-17 09:22:15 +08:00
|
|
|
std::string listen_host_port;
|
2011-11-01 07:51:19 +08:00
|
|
|
int ch;
|
2013-12-03 03:35:49 +08:00
|
|
|
|
2015-05-27 21:34:04 +08:00
|
|
|
std::string log_file;
|
|
|
|
StringRef log_channels; // e.g. "lldb process threads:gdb-remote default:linux all"
|
2015-07-07 02:05:19 +08:00
|
|
|
|
2015-02-11 18:29:30 +08:00
|
|
|
GDBRemoteCommunicationServerPlatform::PortMap gdbserver_portmap;
|
2013-11-21 09:44:58 +08:00
|
|
|
int min_gdbserver_port = 0;
|
|
|
|
int max_gdbserver_port = 0;
|
2013-11-23 02:55:04 +08:00
|
|
|
uint16_t port_offset = 0;
|
2015-07-07 02:05:19 +08:00
|
|
|
|
|
|
|
FileSpec port_file;
|
2013-11-21 09:44:58 +08:00
|
|
|
bool show_usage = false;
|
|
|
|
int option_error = 0;
|
2015-03-25 20:51:31 +08:00
|
|
|
int socket_error = -1;
|
2011-04-05 02:18:57 +08:00
|
|
|
|
2013-11-23 09:58:15 +08:00
|
|
|
std::string short_options(OptionParser::GetShortOptionString(g_long_options));
|
|
|
|
|
2013-11-23 02:55:04 +08:00
|
|
|
#if __GLIBC__
|
|
|
|
optind = 0;
|
|
|
|
#else
|
|
|
|
optreset = 1;
|
|
|
|
optind = 1;
|
|
|
|
#endif
|
|
|
|
|
2013-11-23 09:58:15 +08:00
|
|
|
while ((ch = getopt_long_only(argc, argv, short_options.c_str(), g_long_options, &long_option_index)) != -1)
|
2011-03-22 09:34:44 +08:00
|
|
|
{
|
|
|
|
switch (ch)
|
|
|
|
{
|
|
|
|
case 0: // Any optional that auto set themselves will return 0
|
|
|
|
break;
|
|
|
|
|
2011-03-23 08:09:55 +08:00
|
|
|
case 'L':
|
2011-06-17 09:22:15 +08:00
|
|
|
listen_host_port.append (optarg);
|
2011-03-23 08:09:55 +08:00
|
|
|
break;
|
2013-08-27 07:57:52 +08:00
|
|
|
|
2015-05-27 21:34:04 +08:00
|
|
|
case 'l': // Set Log File
|
|
|
|
if (optarg && optarg[0])
|
|
|
|
log_file.assign(optarg);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'c': // Log Channels
|
|
|
|
if (optarg && optarg[0])
|
|
|
|
log_channels = StringRef(optarg);
|
|
|
|
break;
|
|
|
|
|
2015-07-07 02:05:19 +08:00
|
|
|
case 'f': // Port file
|
|
|
|
if (optarg && optarg[0])
|
|
|
|
port_file.SetFile(optarg, false);
|
|
|
|
break;
|
|
|
|
|
2013-11-21 09:44:58 +08:00
|
|
|
case 'p':
|
2013-11-23 02:55:04 +08:00
|
|
|
{
|
|
|
|
char *end = NULL;
|
|
|
|
long tmp_port_offset = strtoul(optarg, &end, 0);
|
|
|
|
if (end && *end == '\0')
|
|
|
|
{
|
|
|
|
if (LOW_PORT <= tmp_port_offset && tmp_port_offset <= HIGH_PORT)
|
|
|
|
{
|
|
|
|
port_offset = (uint16_t)tmp_port_offset;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fprintf (stderr, "error: port offset %li is not in the valid user port range of %u - %u\n", tmp_port_offset, LOW_PORT, HIGH_PORT);
|
|
|
|
option_error = 5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fprintf (stderr, "error: invalid port offset string %s\n", optarg);
|
|
|
|
option_error = 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'P':
|
2013-11-21 09:44:58 +08:00
|
|
|
case 'm':
|
|
|
|
case 'M':
|
|
|
|
{
|
|
|
|
char *end = NULL;
|
|
|
|
long portnum = strtoul(optarg, &end, 0);
|
|
|
|
if (end && *end == '\0')
|
|
|
|
{
|
|
|
|
if (LOW_PORT <= portnum && portnum <= HIGH_PORT)
|
|
|
|
{
|
2013-11-23 02:55:04 +08:00
|
|
|
if (ch == 'P')
|
2013-11-21 09:44:58 +08:00
|
|
|
gdbserver_portmap[(uint16_t)portnum] = LLDB_INVALID_PROCESS_ID;
|
|
|
|
else if (ch == 'm')
|
|
|
|
min_gdbserver_port = portnum;
|
|
|
|
else
|
|
|
|
max_gdbserver_port = portnum;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fprintf (stderr, "error: port number %li is not in the valid user port range of %u - %u\n", portnum, LOW_PORT, HIGH_PORT);
|
|
|
|
option_error = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fprintf (stderr, "error: invalid port number string %s\n", optarg);
|
|
|
|
option_error = 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2013-12-03 03:35:49 +08:00
|
|
|
|
2013-08-27 07:57:52 +08:00
|
|
|
case 'h': /* fall-through is intentional */
|
|
|
|
case '?':
|
2013-11-21 09:44:58 +08:00
|
|
|
show_usage = true;
|
2013-08-27 07:57:52 +08:00
|
|
|
break;
|
2011-03-22 09:34:44 +08:00
|
|
|
}
|
|
|
|
}
|
2013-12-03 03:35:49 +08:00
|
|
|
|
2015-05-27 21:34:04 +08:00
|
|
|
if (!LLDBServerUtilities::SetupLogging(log_file, log_channels, 0))
|
|
|
|
return -1;
|
|
|
|
|
2013-11-21 09:44:58 +08:00
|
|
|
// Make a port map for a port range that was specified.
|
|
|
|
if (min_gdbserver_port < max_gdbserver_port)
|
|
|
|
{
|
|
|
|
for (uint16_t port = min_gdbserver_port; port < max_gdbserver_port; ++port)
|
|
|
|
gdbserver_portmap[port] = LLDB_INVALID_PROCESS_ID;
|
|
|
|
}
|
|
|
|
else if (min_gdbserver_port != max_gdbserver_port)
|
|
|
|
{
|
|
|
|
fprintf (stderr, "error: --min-gdbserver-port (%u) is greater than --max-gdbserver-port (%u)\n", min_gdbserver_port, max_gdbserver_port);
|
|
|
|
option_error = 3;
|
|
|
|
}
|
|
|
|
|
2013-08-27 07:57:52 +08:00
|
|
|
// Print usage and exit if no listening port is specified.
|
|
|
|
if (listen_host_port.empty())
|
2013-11-21 09:44:58 +08:00
|
|
|
show_usage = true;
|
|
|
|
|
|
|
|
if (show_usage || option_error)
|
|
|
|
{
|
2015-02-18 23:39:41 +08:00
|
|
|
display_usage(progname, subcommand);
|
2013-11-21 09:44:58 +08:00
|
|
|
exit(option_error);
|
|
|
|
}
|
2011-03-22 09:34:44 +08:00
|
|
|
|
2015-03-25 20:51:31 +08:00
|
|
|
std::unique_ptr<Socket> listening_socket_up;
|
|
|
|
Socket *socket = nullptr;
|
|
|
|
const bool children_inherit_listen_socket = false;
|
2015-03-31 08:27:10 +08:00
|
|
|
|
|
|
|
// the test suite makes many connections in parallel, let's not miss any.
|
|
|
|
// The highest this should get reasonably is a function of the number
|
|
|
|
// of target CPUs. For now, let's just use 100
|
|
|
|
const int backlog = 100;
|
|
|
|
error = Socket::TcpListen(listen_host_port.c_str(), children_inherit_listen_socket, socket, NULL, backlog);
|
2015-03-25 20:51:31 +08:00
|
|
|
if (error.Fail())
|
|
|
|
{
|
|
|
|
printf("error: %s\n", error.AsCString());
|
|
|
|
exit(socket_error);
|
|
|
|
}
|
|
|
|
listening_socket_up.reset(socket);
|
2015-05-26 11:08:05 +08:00
|
|
|
printf ("Listening for a connection from %u...\n", listening_socket_up->GetLocalPortNumber());
|
2015-07-07 02:05:19 +08:00
|
|
|
if (port_file)
|
|
|
|
{
|
|
|
|
error = save_port_to_file(listening_socket_up->GetLocalPortNumber(), port_file);
|
|
|
|
if (error.Fail())
|
|
|
|
{
|
|
|
|
fprintf(stderr, "failed to write port to %s: %s", port_file.GetPath().c_str(), error.AsCString());
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
2011-03-22 09:34:44 +08:00
|
|
|
|
2013-08-27 07:57:52 +08:00
|
|
|
do {
|
2015-02-11 18:29:30 +08:00
|
|
|
GDBRemoteCommunicationServerPlatform platform;
|
2013-11-21 09:44:58 +08:00
|
|
|
|
2013-11-23 02:55:04 +08:00
|
|
|
if (port_offset > 0)
|
2015-02-11 18:29:30 +08:00
|
|
|
platform.SetPortOffset(port_offset);
|
2013-11-23 02:55:04 +08:00
|
|
|
|
2013-11-21 09:44:58 +08:00
|
|
|
if (!gdbserver_portmap.empty())
|
|
|
|
{
|
2015-02-11 18:29:30 +08:00
|
|
|
platform.SetPortMap(std::move(gdbserver_portmap));
|
2013-11-21 09:44:58 +08:00
|
|
|
}
|
|
|
|
|
2015-03-25 20:51:31 +08:00
|
|
|
const bool children_inherit_accept_socket = true;
|
|
|
|
socket = nullptr;
|
|
|
|
error = listening_socket_up->BlockingAccept(listen_host_port.c_str(), children_inherit_accept_socket, socket);
|
|
|
|
if (error.Fail())
|
|
|
|
{
|
|
|
|
printf ("error: %s\n", error.AsCString());
|
|
|
|
exit(socket_error);
|
|
|
|
}
|
|
|
|
printf ("Connection established.\n");
|
|
|
|
if (g_server)
|
2011-03-23 08:09:55 +08:00
|
|
|
{
|
2015-03-25 20:51:31 +08:00
|
|
|
// Collect child zombie processes.
|
|
|
|
while (waitpid(-1, nullptr, WNOHANG) > 0);
|
|
|
|
if (fork())
|
2011-03-24 12:28:38 +08:00
|
|
|
{
|
2015-03-31 08:24:51 +08:00
|
|
|
// Parent doesn't need a connection to the lldb client
|
|
|
|
delete socket;
|
|
|
|
socket = nullptr;
|
|
|
|
|
2015-03-25 20:51:31 +08:00
|
|
|
// Parent will continue to listen for new connections.
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Child process will handle the connection and exit.
|
|
|
|
g_server = 0;
|
|
|
|
// Listening socket is owned by parent process.
|
|
|
|
listening_socket_up.release();
|
2011-03-23 08:09:55 +08:00
|
|
|
}
|
2015-03-25 20:51:31 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// If not running as a server, this process will not accept
|
|
|
|
// connections while a connection is active.
|
|
|
|
listening_socket_up.reset();
|
|
|
|
}
|
|
|
|
platform.SetConnection (new ConnectionFileDescriptor(socket));
|
2013-08-27 07:57:52 +08:00
|
|
|
|
2015-03-25 20:51:31 +08:00
|
|
|
if (platform.IsConnected())
|
|
|
|
{
|
|
|
|
// After we connected, we need to get an initial ack from...
|
Introduce a MainLoop class and switch llgs to use it
Summary:
This is the first part of our effort to make llgs single threaded. Currently, llgs consists of
about three threads and the synchronisation between them is a major source of latency when
debugging linux and android applications.
In order to be able to go single threaded, we must have the ability to listen for events from
multiple sources (primarily, client commands coming over the network and debug events from the
inferior) and perform necessary actions. For this reason I introduce the concept of a MainLoop.
A main loop has the ability to register callback's which will be invoked upon receipt of certain
events. MainLoopPosix has the ability to listen for file descriptors and signals.
For the moment, I have merely made the GDBRemoteCommunicationServerLLGS class use MainLoop
instead of waiting on the network socket directly, but the other threads still remain. In the
followup patches I indend to migrate NativeProcessLinux to this class and remove the remaining
threads.
Reviewers: ovyalov, clayborg, amccarth, zturner, emaste
Subscribers: tberghammer, lldb-commits
Differential Revision: http://reviews.llvm.org/D11066
llvm-svn: 242018
2015-07-13 18:44:55 +08:00
|
|
|
if (platform.HandshakeWithClient())
|
2011-07-07 09:59:51 +08:00
|
|
|
{
|
2015-03-25 20:51:31 +08:00
|
|
|
bool interrupt = false;
|
|
|
|
bool done = false;
|
|
|
|
while (!interrupt && !done)
|
2013-08-27 07:57:52 +08:00
|
|
|
{
|
2015-03-25 20:51:31 +08:00
|
|
|
if (platform.GetPacketAndSendResponse (UINT32_MAX, error, interrupt, done) != GDBRemoteCommunication::PacketResult::Success)
|
|
|
|
break;
|
2013-08-27 07:57:52 +08:00
|
|
|
}
|
2015-03-25 20:51:31 +08:00
|
|
|
|
|
|
|
if (error.Fail())
|
2013-08-27 07:57:52 +08:00
|
|
|
{
|
2015-03-25 20:51:31 +08:00
|
|
|
fprintf(stderr, "error: %s\n", error.AsCString());
|
2013-08-27 07:57:52 +08:00
|
|
|
}
|
2011-07-07 09:59:51 +08:00
|
|
|
}
|
2015-03-25 20:51:31 +08:00
|
|
|
else
|
|
|
|
{
|
|
|
|
fprintf(stderr, "error: handshake with client failed\n");
|
|
|
|
}
|
2011-03-23 08:09:55 +08:00
|
|
|
}
|
2015-03-25 20:51:31 +08:00
|
|
|
} while (g_server);
|
2011-03-22 09:34:44 +08:00
|
|
|
|
2015-03-06 22:36:33 +08:00
|
|
|
fprintf(stderr, "lldb-server exiting...\n");
|
2013-08-27 07:57:52 +08:00
|
|
|
|
2011-03-22 09:34:44 +08:00
|
|
|
return 0;
|
|
|
|
}
|