| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdlib.h> | 5 #include <stdlib.h> |
| 6 #include <string.h> | 6 #include <string.h> |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include "include/dart_api.h" | 9 #include "include/dart_api.h" |
| 10 #include "include/dart_debugger_api.h" | 10 #include "include/dart_debugger_api.h" |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 } | 218 } |
| 219 if (vm_service_server_port < 0) { | 219 if (vm_service_server_port < 0) { |
| 220 Log::PrintErr("unrecognized --enable-vm-service option syntax. " | 220 Log::PrintErr("unrecognized --enable-vm-service option syntax. " |
| 221 "Use --enable-vm-service[:<port number>]\n"); | 221 "Use --enable-vm-service[:<port number>]\n"); |
| 222 return false; | 222 return false; |
| 223 } | 223 } |
| 224 start_vm_service = true; | 224 start_vm_service = true; |
| 225 return true; | 225 return true; |
| 226 } | 226 } |
| 227 | 227 |
| 228 bool trace_debug_protocol = false; |
| 229 static bool ProcessTraceDebugProtocolOption(const char* arg) { |
| 230 if (*arg != '\0') { |
| 231 return false; |
| 232 } |
| 233 trace_debug_protocol = true; |
| 234 return true; |
| 235 } |
| 236 |
| 237 |
| 228 static struct { | 238 static struct { |
| 229 const char* option_name; | 239 const char* option_name; |
| 230 bool (*process)(const char* option); | 240 bool (*process)(const char* option); |
| 231 } main_options[] = { | 241 } main_options[] = { |
| 232 // Standard options shared with dart2js. | 242 // Standard options shared with dart2js. |
| 233 { "--version", ProcessVersionOption }, | 243 { "--version", ProcessVersionOption }, |
| 234 { "--help", ProcessHelpOption }, | 244 { "--help", ProcessHelpOption }, |
| 235 { "-h", ProcessHelpOption }, | 245 { "-h", ProcessHelpOption }, |
| 236 { "--verbose", ProcessVerboseOption }, | 246 { "--verbose", ProcessVerboseOption }, |
| 237 { "-v", ProcessVerboseOption }, | 247 { "-v", ProcessVerboseOption }, |
| 238 { "--package-root=", ProcessPackageRootOption }, | 248 { "--package-root=", ProcessPackageRootOption }, |
| 239 // VM specific options to the standalone dart program. | 249 // VM specific options to the standalone dart program. |
| 240 { "--break-at=", ProcessBreakpointOption }, | 250 { "--break-at=", ProcessBreakpointOption }, |
| 241 { "--compile_all", ProcessCompileAllOption }, | 251 { "--compile_all", ProcessCompileAllOption }, |
| 242 { "--debug", ProcessDebugOption }, | 252 { "--debug", ProcessDebugOption }, |
| 243 { "--snapshot=", ProcessGenScriptSnapshotOption }, | 253 { "--snapshot=", ProcessGenScriptSnapshotOption }, |
| 244 { "--print-script", ProcessPrintScriptOption }, | 254 { "--print-script", ProcessPrintScriptOption }, |
| 245 { "--check-function-fingerprints", ProcessFingerprintedFunctions }, | 255 { "--check-function-fingerprints", ProcessFingerprintedFunctions }, |
| 246 { "--enable-vm-service", ProcessEnableVmServiceOption }, | 256 { "--enable-vm-service", ProcessEnableVmServiceOption }, |
| 257 { "--trace-debug-protocol", ProcessTraceDebugProtocolOption }, |
| 247 { NULL, NULL } | 258 { NULL, NULL } |
| 248 }; | 259 }; |
| 249 | 260 |
| 250 | 261 |
| 251 static bool ProcessMainOptions(const char* option) { | 262 static bool ProcessMainOptions(const char* option) { |
| 252 int i = 0; | 263 int i = 0; |
| 253 const char* name = main_options[0].option_name; | 264 const char* name = main_options[0].option_name; |
| 254 int option_length = strlen(option); | 265 int option_length = strlen(option); |
| 255 while (name != NULL) { | 266 while (name != NULL) { |
| 256 int length = strlen(name); | 267 int length = strlen(name); |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 | 944 |
| 934 return Process::GlobalExitCode(); | 945 return Process::GlobalExitCode(); |
| 935 } | 946 } |
| 936 | 947 |
| 937 } // namespace bin | 948 } // namespace bin |
| 938 } // namespace dart | 949 } // namespace dart |
| 939 | 950 |
| 940 int main(int argc, char** argv) { | 951 int main(int argc, char** argv) { |
| 941 return dart::bin::main(argc, argv); | 952 return dart::bin::main(argc, argv); |
| 942 } | 953 } |
| OLD | NEW |