Greg Clayton | b43767a | 2011-03-22 01:34:44 +0000 | [diff] [blame] | 1 | //===-- lldb-platform.cpp ---------------------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
Daniel Malea | 93a6430 | 2012-12-05 00:20:57 +0000 | [diff] [blame] | 10 | #include "lldb/lldb-python.h" |
| 11 | |
Greg Clayton | d314e81 | 2011-03-23 00:09:55 +0000 | [diff] [blame] | 12 | // C Includes |
Greg Clayton | b43767a | 2011-03-22 01:34:44 +0000 | [diff] [blame] | 13 | #include <errno.h> |
Zachary Turner | 9868892 | 2014-08-06 18:16:26 +0000 | [diff] [blame] | 14 | #if defined(__APPLE__) |
| 15 | #include <netinet/in.h> |
| 16 | #endif |
Greg Clayton | b43767a | 2011-03-22 01:34:44 +0000 | [diff] [blame] | 17 | #include <signal.h> |
| 18 | #include <stdint.h> |
| 19 | #include <stdio.h> |
| 20 | #include <stdlib.h> |
| 21 | #include <string.h> |
| 22 | |
Greg Clayton | d314e81 | 2011-03-23 00:09:55 +0000 | [diff] [blame] | 23 | // C++ Includes |
| 24 | |
| 25 | // Other libraries and framework includes |
| 26 | #include "lldb/Core/Error.h" |
Greg Clayton | 9b1e1cd | 2011-04-04 18:18:57 +0000 | [diff] [blame] | 27 | #include "lldb/Core/ConnectionMachPort.h" |
Greg Clayton | 1cb6496 | 2011-03-24 04:28:38 +0000 | [diff] [blame] | 28 | #include "lldb/Core/Debugger.h" |
| 29 | #include "lldb/Core/StreamFile.h" |
Zachary Turner | 93a66fc | 2014-10-06 21:22:36 +0000 | [diff] [blame] | 30 | #include "lldb/Host/ConnectionFileDescriptor.h" |
Zachary Turner | 9868892 | 2014-08-06 18:16:26 +0000 | [diff] [blame] | 31 | #include "lldb/Host/HostGetOpt.h" |
Greg Clayton | fb90931 | 2013-11-23 01:58:15 +0000 | [diff] [blame] | 32 | #include "lldb/Host/OptionParser.h" |
Greg Clayton | 5fb8f79 | 2013-12-02 19:35:49 +0000 | [diff] [blame] | 33 | #include "lldb/Interpreter/CommandInterpreter.h" |
| 34 | #include "lldb/Interpreter/CommandReturnObject.h" |
Tamas Berghammer | e13c273 | 2015-02-11 10:29:30 +0000 | [diff] [blame] | 35 | #include "Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h" |
Greg Clayton | 1cb6496 | 2011-03-24 04:28:38 +0000 | [diff] [blame] | 36 | #include "Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h" |
Tamas Berghammer | e13c273 | 2015-02-11 10:29:30 +0000 | [diff] [blame] | 37 | |
Greg Clayton | d314e81 | 2011-03-23 00:09:55 +0000 | [diff] [blame] | 38 | using namespace lldb; |
| 39 | using namespace lldb_private; |
| 40 | |
Greg Clayton | b43767a | 2011-03-22 01:34:44 +0000 | [diff] [blame] | 41 | //---------------------------------------------------------------------- |
Greg Clayton | b7ad58a | 2013-04-04 20:35:24 +0000 | [diff] [blame] | 42 | // option descriptors for getopt_long_only() |
Greg Clayton | b43767a | 2011-03-22 01:34:44 +0000 | [diff] [blame] | 43 | //---------------------------------------------------------------------- |
| 44 | |
Tamas Berghammer | c2c3d71 | 2015-02-18 15:39:41 +0000 | [diff] [blame] | 45 | static int g_debug = 0; |
| 46 | static int g_verbose = 0; |
| 47 | static int g_stay_alive = 0; |
Greg Clayton | b43767a | 2011-03-22 01:34:44 +0000 | [diff] [blame] | 48 | |
| 49 | static struct option g_long_options[] = |
| 50 | { |
| 51 | { "debug", no_argument, &g_debug, 1 }, |
| 52 | { "verbose", no_argument, &g_verbose, 1 }, |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 53 | { "stay-alive", no_argument, &g_stay_alive, 1 }, |
Greg Clayton | d314e81 | 2011-03-23 00:09:55 +0000 | [diff] [blame] | 54 | { "listen", required_argument, NULL, 'L' }, |
Greg Clayton | d4724cf | 2013-11-22 18:55:04 +0000 | [diff] [blame] | 55 | { "port-offset", required_argument, NULL, 'p' }, |
| 56 | { "gdbserver-port", required_argument, NULL, 'P' }, |
Greg Clayton | 29b8fc4 | 2013-11-21 01:44:58 +0000 | [diff] [blame] | 57 | { "min-gdbserver-port", required_argument, NULL, 'm' }, |
| 58 | { "max-gdbserver-port", required_argument, NULL, 'M' }, |
Greg Clayton | 5fb8f79 | 2013-12-02 19:35:49 +0000 | [diff] [blame] | 59 | { "lldb-command", required_argument, NULL, 'c' }, |
Greg Clayton | b43767a | 2011-03-22 01:34:44 +0000 | [diff] [blame] | 60 | { NULL, 0, NULL, 0 } |
| 61 | }; |
| 62 | |
Greg Clayton | 29b8fc4 | 2013-11-21 01:44:58 +0000 | [diff] [blame] | 63 | #if defined (__APPLE__) |
| 64 | #define LOW_PORT (IPPORT_RESERVED) |
| 65 | #define HIGH_PORT (IPPORT_HIFIRSTAUTO) |
| 66 | #else |
| 67 | #define LOW_PORT (1024u) |
| 68 | #define HIGH_PORT (49151u) |
| 69 | #endif |
| 70 | |
| 71 | |
Greg Clayton | b43767a | 2011-03-22 01:34:44 +0000 | [diff] [blame] | 72 | //---------------------------------------------------------------------- |
| 73 | // Watch for signals |
| 74 | //---------------------------------------------------------------------- |
Tamas Berghammer | c2c3d71 | 2015-02-18 15:39:41 +0000 | [diff] [blame] | 75 | static void |
Greg Clayton | b43767a | 2011-03-22 01:34:44 +0000 | [diff] [blame] | 76 | signal_handler(int signo) |
| 77 | { |
| 78 | switch (signo) |
| 79 | { |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 80 | case SIGHUP: |
| 81 | // Use SIGINT first, if that does not work, use SIGHUP as a last resort. |
| 82 | // And we should not call exit() here because it results in the global destructors |
| 83 | // to be invoked and wreaking havoc on the threads still running. |
Robert Flack | 8cc4cf1 | 2015-03-06 14:36:33 +0000 | [diff] [blame] | 84 | Host::SystemLog(Host::eSystemLogWarning, "SIGHUP received, exiting lldb-server...\n"); |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 85 | abort(); |
| 86 | break; |
Greg Clayton | b43767a | 2011-03-22 01:34:44 +0000 | [diff] [blame] | 87 | } |
| 88 | } |
| 89 | |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 90 | static void |
Tamas Berghammer | c2c3d71 | 2015-02-18 15:39:41 +0000 | [diff] [blame] | 91 | display_usage (const char *progname, const char *subcommand) |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 92 | { |
Tamas Berghammer | c2c3d71 | 2015-02-18 15:39:41 +0000 | [diff] [blame] | 93 | fprintf(stderr, "Usage:\n %s %s [--log-file log-file-path] [--log-flags flags] --listen port\n", progname, subcommand); |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 94 | exit(0); |
| 95 | } |
| 96 | |
Greg Clayton | b43767a | 2011-03-22 01:34:44 +0000 | [diff] [blame] | 97 | //---------------------------------------------------------------------- |
| 98 | // main |
| 99 | //---------------------------------------------------------------------- |
| 100 | int |
Tamas Berghammer | c2c3d71 | 2015-02-18 15:39:41 +0000 | [diff] [blame] | 101 | main_platform (int argc, char *argv[]) |
Greg Clayton | b43767a | 2011-03-22 01:34:44 +0000 | [diff] [blame] | 102 | { |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 103 | const char *progname = argv[0]; |
Tamas Berghammer | c2c3d71 | 2015-02-18 15:39:41 +0000 | [diff] [blame] | 104 | const char *subcommand = argv[1]; |
| 105 | argc--; |
| 106 | argv++; |
Greg Clayton | fb90931 | 2013-11-23 01:58:15 +0000 | [diff] [blame] | 107 | signal (SIGPIPE, SIG_IGN); |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 108 | signal (SIGHUP, signal_handler); |
Greg Clayton | b43767a | 2011-03-22 01:34:44 +0000 | [diff] [blame] | 109 | int long_option_index = 0; |
Greg Clayton | 9b1e1cd | 2011-04-04 18:18:57 +0000 | [diff] [blame] | 110 | Error error; |
Greg Clayton | 73bf5db | 2011-06-17 01:22:15 +0000 | [diff] [blame] | 111 | std::string listen_host_port; |
Greg Clayton | 9d3d688 | 2011-10-31 23:51:19 +0000 | [diff] [blame] | 112 | int ch; |
Greg Clayton | 5fb8f79 | 2013-12-02 19:35:49 +0000 | [diff] [blame] | 113 | |
| 114 | lldb::DebuggerSP debugger_sp = Debugger::CreateInstance (); |
| 115 | |
| 116 | debugger_sp->SetInputFileHandle(stdin, false); |
| 117 | debugger_sp->SetOutputFileHandle(stdout, false); |
| 118 | debugger_sp->SetErrorFileHandle(stderr, false); |
Greg Clayton | 1cb6496 | 2011-03-24 04:28:38 +0000 | [diff] [blame] | 119 | |
Tamas Berghammer | e13c273 | 2015-02-11 10:29:30 +0000 | [diff] [blame] | 120 | GDBRemoteCommunicationServerPlatform::PortMap gdbserver_portmap; |
Greg Clayton | 29b8fc4 | 2013-11-21 01:44:58 +0000 | [diff] [blame] | 121 | int min_gdbserver_port = 0; |
| 122 | int max_gdbserver_port = 0; |
Greg Clayton | d4724cf | 2013-11-22 18:55:04 +0000 | [diff] [blame] | 123 | uint16_t port_offset = 0; |
Greg Clayton | 29b8fc4 | 2013-11-21 01:44:58 +0000 | [diff] [blame] | 124 | |
Greg Clayton | 5fb8f79 | 2013-12-02 19:35:49 +0000 | [diff] [blame] | 125 | std::vector<std::string> lldb_commands; |
Greg Clayton | 29b8fc4 | 2013-11-21 01:44:58 +0000 | [diff] [blame] | 126 | bool show_usage = false; |
| 127 | int option_error = 0; |
Greg Clayton | 9b1e1cd | 2011-04-04 18:18:57 +0000 | [diff] [blame] | 128 | |
Greg Clayton | fb90931 | 2013-11-23 01:58:15 +0000 | [diff] [blame] | 129 | std::string short_options(OptionParser::GetShortOptionString(g_long_options)); |
| 130 | |
Greg Clayton | d4724cf | 2013-11-22 18:55:04 +0000 | [diff] [blame] | 131 | #if __GLIBC__ |
| 132 | optind = 0; |
| 133 | #else |
| 134 | optreset = 1; |
| 135 | optind = 1; |
| 136 | #endif |
| 137 | |
Greg Clayton | fb90931 | 2013-11-23 01:58:15 +0000 | [diff] [blame] | 138 | while ((ch = getopt_long_only(argc, argv, short_options.c_str(), g_long_options, &long_option_index)) != -1) |
Greg Clayton | b43767a | 2011-03-22 01:34:44 +0000 | [diff] [blame] | 139 | { |
Greg Clayton | b43767a | 2011-03-22 01:34:44 +0000 | [diff] [blame] | 140 | switch (ch) |
| 141 | { |
| 142 | case 0: // Any optional that auto set themselves will return 0 |
| 143 | break; |
| 144 | |
Greg Clayton | d314e81 | 2011-03-23 00:09:55 +0000 | [diff] [blame] | 145 | case 'L': |
Greg Clayton | 73bf5db | 2011-06-17 01:22:15 +0000 | [diff] [blame] | 146 | listen_host_port.append (optarg); |
Greg Clayton | d314e81 | 2011-03-23 00:09:55 +0000 | [diff] [blame] | 147 | break; |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 148 | |
Greg Clayton | 29b8fc4 | 2013-11-21 01:44:58 +0000 | [diff] [blame] | 149 | case 'p': |
Greg Clayton | d4724cf | 2013-11-22 18:55:04 +0000 | [diff] [blame] | 150 | { |
| 151 | char *end = NULL; |
| 152 | long tmp_port_offset = strtoul(optarg, &end, 0); |
| 153 | if (end && *end == '\0') |
| 154 | { |
| 155 | if (LOW_PORT <= tmp_port_offset && tmp_port_offset <= HIGH_PORT) |
| 156 | { |
| 157 | port_offset = (uint16_t)tmp_port_offset; |
| 158 | } |
| 159 | else |
| 160 | { |
| 161 | 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); |
| 162 | option_error = 5; |
| 163 | } |
| 164 | } |
| 165 | else |
| 166 | { |
| 167 | fprintf (stderr, "error: invalid port offset string %s\n", optarg); |
| 168 | option_error = 4; |
| 169 | } |
| 170 | } |
| 171 | break; |
| 172 | |
| 173 | case 'P': |
Greg Clayton | 29b8fc4 | 2013-11-21 01:44:58 +0000 | [diff] [blame] | 174 | case 'm': |
| 175 | case 'M': |
| 176 | { |
| 177 | char *end = NULL; |
| 178 | long portnum = strtoul(optarg, &end, 0); |
| 179 | if (end && *end == '\0') |
| 180 | { |
| 181 | if (LOW_PORT <= portnum && portnum <= HIGH_PORT) |
| 182 | { |
Greg Clayton | d4724cf | 2013-11-22 18:55:04 +0000 | [diff] [blame] | 183 | if (ch == 'P') |
Greg Clayton | 29b8fc4 | 2013-11-21 01:44:58 +0000 | [diff] [blame] | 184 | gdbserver_portmap[(uint16_t)portnum] = LLDB_INVALID_PROCESS_ID; |
| 185 | else if (ch == 'm') |
| 186 | min_gdbserver_port = portnum; |
| 187 | else |
| 188 | max_gdbserver_port = portnum; |
| 189 | } |
| 190 | else |
| 191 | { |
| 192 | fprintf (stderr, "error: port number %li is not in the valid user port range of %u - %u\n", portnum, LOW_PORT, HIGH_PORT); |
| 193 | option_error = 1; |
| 194 | } |
| 195 | } |
| 196 | else |
| 197 | { |
| 198 | fprintf (stderr, "error: invalid port number string %s\n", optarg); |
| 199 | option_error = 2; |
| 200 | } |
| 201 | } |
| 202 | break; |
| 203 | |
Greg Clayton | 5fb8f79 | 2013-12-02 19:35:49 +0000 | [diff] [blame] | 204 | case 'c': |
| 205 | lldb_commands.push_back(optarg); |
| 206 | break; |
| 207 | |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 208 | case 'h': /* fall-through is intentional */ |
| 209 | case '?': |
Greg Clayton | 29b8fc4 | 2013-11-21 01:44:58 +0000 | [diff] [blame] | 210 | show_usage = true; |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 211 | break; |
Greg Clayton | b43767a | 2011-03-22 01:34:44 +0000 | [diff] [blame] | 212 | } |
| 213 | } |
Greg Clayton | 5fb8f79 | 2013-12-02 19:35:49 +0000 | [diff] [blame] | 214 | |
Greg Clayton | 29b8fc4 | 2013-11-21 01:44:58 +0000 | [diff] [blame] | 215 | // Make a port map for a port range that was specified. |
| 216 | if (min_gdbserver_port < max_gdbserver_port) |
| 217 | { |
| 218 | for (uint16_t port = min_gdbserver_port; port < max_gdbserver_port; ++port) |
| 219 | gdbserver_portmap[port] = LLDB_INVALID_PROCESS_ID; |
| 220 | } |
| 221 | else if (min_gdbserver_port != max_gdbserver_port) |
| 222 | { |
| 223 | fprintf (stderr, "error: --min-gdbserver-port (%u) is greater than --max-gdbserver-port (%u)\n", min_gdbserver_port, max_gdbserver_port); |
| 224 | option_error = 3; |
| 225 | |
| 226 | } |
| 227 | |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 228 | // Print usage and exit if no listening port is specified. |
| 229 | if (listen_host_port.empty()) |
Greg Clayton | 29b8fc4 | 2013-11-21 01:44:58 +0000 | [diff] [blame] | 230 | show_usage = true; |
| 231 | |
| 232 | if (show_usage || option_error) |
| 233 | { |
Tamas Berghammer | c2c3d71 | 2015-02-18 15:39:41 +0000 | [diff] [blame] | 234 | display_usage(progname, subcommand); |
Greg Clayton | 29b8fc4 | 2013-11-21 01:44:58 +0000 | [diff] [blame] | 235 | exit(option_error); |
| 236 | } |
Greg Clayton | b43767a | 2011-03-22 01:34:44 +0000 | [diff] [blame] | 237 | |
Greg Clayton | 5fb8f79 | 2013-12-02 19:35:49 +0000 | [diff] [blame] | 238 | // Execute any LLDB commands that we were asked to evaluate. |
| 239 | for (const auto &lldb_command : lldb_commands) |
| 240 | { |
| 241 | lldb_private::CommandReturnObject result; |
| 242 | printf("(lldb) %s\n", lldb_command.c_str()); |
| 243 | debugger_sp->GetCommandInterpreter().HandleCommand(lldb_command.c_str(), eLazyBoolNo, result); |
| 244 | const char *output = result.GetOutputData(); |
| 245 | if (output && output[0]) |
| 246 | puts(output); |
| 247 | } |
| 248 | |
Greg Clayton | b43767a | 2011-03-22 01:34:44 +0000 | [diff] [blame] | 249 | |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 250 | do { |
Tamas Berghammer | e13c273 | 2015-02-11 10:29:30 +0000 | [diff] [blame] | 251 | GDBRemoteCommunicationServerPlatform platform; |
Greg Clayton | 29b8fc4 | 2013-11-21 01:44:58 +0000 | [diff] [blame] | 252 | |
Greg Clayton | d4724cf | 2013-11-22 18:55:04 +0000 | [diff] [blame] | 253 | if (port_offset > 0) |
Tamas Berghammer | e13c273 | 2015-02-11 10:29:30 +0000 | [diff] [blame] | 254 | platform.SetPortOffset(port_offset); |
Greg Clayton | d4724cf | 2013-11-22 18:55:04 +0000 | [diff] [blame] | 255 | |
Greg Clayton | 29b8fc4 | 2013-11-21 01:44:58 +0000 | [diff] [blame] | 256 | if (!gdbserver_portmap.empty()) |
| 257 | { |
Tamas Berghammer | e13c273 | 2015-02-11 10:29:30 +0000 | [diff] [blame] | 258 | platform.SetPortMap(std::move(gdbserver_portmap)); |
Greg Clayton | 29b8fc4 | 2013-11-21 01:44:58 +0000 | [diff] [blame] | 259 | } |
| 260 | |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 261 | if (!listen_host_port.empty()) |
Greg Clayton | d314e81 | 2011-03-23 00:09:55 +0000 | [diff] [blame] | 262 | { |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 263 | std::unique_ptr<ConnectionFileDescriptor> conn_ap(new ConnectionFileDescriptor()); |
| 264 | if (conn_ap.get()) |
Greg Clayton | d314e81 | 2011-03-23 00:09:55 +0000 | [diff] [blame] | 265 | { |
Greg Clayton | 00fe87b | 2013-12-05 22:58:22 +0000 | [diff] [blame] | 266 | std::string connect_url ("listen://"); |
| 267 | connect_url.append(listen_host_port.c_str()); |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 268 | |
Greg Clayton | 00fe87b | 2013-12-05 22:58:22 +0000 | [diff] [blame] | 269 | printf ("Listening for a connection from %s...\n", listen_host_port.c_str()); |
| 270 | if (conn_ap->Connect(connect_url.c_str(), &error) == eConnectionStatusSuccess) |
| 271 | { |
| 272 | printf ("Connection established.\n"); |
Tamas Berghammer | e13c273 | 2015-02-11 10:29:30 +0000 | [diff] [blame] | 273 | platform.SetConnection (conn_ap.release()); |
Greg Clayton | 00fe87b | 2013-12-05 22:58:22 +0000 | [diff] [blame] | 274 | } |
| 275 | else |
| 276 | { |
| 277 | printf ("error: %s\n", error.AsCString()); |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 278 | } |
| 279 | } |
| 280 | |
Tamas Berghammer | e13c273 | 2015-02-11 10:29:30 +0000 | [diff] [blame] | 281 | if (platform.IsConnected()) |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 282 | { |
| 283 | // After we connected, we need to get an initial ack from... |
Tamas Berghammer | e13c273 | 2015-02-11 10:29:30 +0000 | [diff] [blame] | 284 | if (platform.HandshakeWithClient(&error)) |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 285 | { |
| 286 | bool interrupt = false; |
| 287 | bool done = false; |
| 288 | while (!interrupt && !done) |
| 289 | { |
Tamas Berghammer | e13c273 | 2015-02-11 10:29:30 +0000 | [diff] [blame] | 290 | if (platform.GetPacketAndSendResponse (UINT32_MAX, error, interrupt, done) != GDBRemoteCommunication::PacketResult::Success) |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 291 | break; |
| 292 | } |
| 293 | |
| 294 | if (error.Fail()) |
| 295 | { |
| 296 | fprintf(stderr, "error: %s\n", error.AsCString()); |
| 297 | } |
| 298 | } |
| 299 | else |
| 300 | { |
| 301 | fprintf(stderr, "error: handshake with client failed\n"); |
| 302 | } |
Greg Clayton | d314e81 | 2011-03-23 00:09:55 +0000 | [diff] [blame] | 303 | } |
| 304 | } |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 305 | } while (g_stay_alive); |
Greg Clayton | b43767a | 2011-03-22 01:34:44 +0000 | [diff] [blame] | 306 | |
Robert Flack | 8cc4cf1 | 2015-03-06 14:36:33 +0000 | [diff] [blame] | 307 | fprintf(stderr, "lldb-server exiting...\n"); |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 308 | |
Greg Clayton | b43767a | 2011-03-22 01:34:44 +0000 | [diff] [blame] | 309 | return 0; |
| 310 | } |