| 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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 if (!ProcessPackageRootOption(argv[i] + strlen(kPackageRoot), | 429 if (!ProcessPackageRootOption(argv[i] + strlen(kPackageRoot), |
| 430 vm_options)) { | 430 vm_options)) { |
| 431 i++; | 431 i++; |
| 432 if ((argv[i] == NULL) || | 432 if ((argv[i] == NULL) || |
| 433 !ProcessPackageRootOption(argv[i], vm_options)) { | 433 !ProcessPackageRootOption(argv[i], vm_options)) { |
| 434 Log::PrintErr("Invalid option specification : '%s'\n", argv[i - 1]); | 434 Log::PrintErr("Invalid option specification : '%s'\n", argv[i - 1]); |
| 435 i++; | 435 i++; |
| 436 break; | 436 break; |
| 437 } | 437 } |
| 438 } | 438 } |
| 439 i++; |
| 440 continue; // '-p' is not a VM flag so don't add to vm options. |
| 439 } else if (strncmp(argv[i], kChecked, strlen(kChecked)) == 0) { | 441 } else if (strncmp(argv[i], kChecked, strlen(kChecked)) == 0) { |
| 440 vm_options->AddArgument("--checked"); | 442 vm_options->AddArgument("--checked"); |
| 443 i++; |
| 444 continue; // '-c' is not a VM flag so don't add to vm options. |
| 441 } else if (!IsValidFlag(argv[i], kPrefix, kPrefixLen)) { | 445 } else if (!IsValidFlag(argv[i], kPrefix, kPrefixLen)) { |
| 442 break; | 446 break; |
| 443 } | 447 } |
| 448 // The following two flags are processed by both the embedder and |
| 449 // the VM. |
| 444 const char* kPrintFlags1 = "--print-flags"; | 450 const char* kPrintFlags1 = "--print-flags"; |
| 445 const char* kPrintFlags2 = "--print_flags"; | 451 const char* kPrintFlags2 = "--print_flags"; |
| 452 const char* kVerboseDebug1 = "--verbose_debug"; |
| 453 const char* kVerboseDebug2 = "--verbose-debug"; |
| 446 if ((strncmp(argv[i], kPrintFlags1, strlen(kPrintFlags1)) == 0) || | 454 if ((strncmp(argv[i], kPrintFlags1, strlen(kPrintFlags1)) == 0) || |
| 447 (strncmp(argv[i], kPrintFlags2, strlen(kPrintFlags2)) == 0)) { | 455 (strncmp(argv[i], kPrintFlags2, strlen(kPrintFlags2)) == 0)) { |
| 448 *print_flags_seen = true; | 456 *print_flags_seen = true; |
| 449 } | 457 } else if ((strncmp(argv[i], |
| 450 const char* kVerboseDebug = "--verbose_debug"; | 458 kVerboseDebug1, |
| 451 if (strncmp(argv[i], kVerboseDebug, strlen(kVerboseDebug)) == 0) { | 459 strlen(kVerboseDebug1)) == 0) || |
| 460 (strncmp(argv[i], |
| 461 kVerboseDebug2, |
| 462 strlen(kVerboseDebug2)) == 0)) { |
| 452 *verbose_debug_seen = true; | 463 *verbose_debug_seen = true; |
| 453 } | 464 } |
| 454 vm_options->AddArgument(argv[i]); | 465 vm_options->AddArgument(argv[i]); |
| 455 i++; | 466 i++; |
| 456 } | 467 } |
| 457 } | 468 } |
| 458 | 469 |
| 459 // The arguments to the VM are at positions 1 through i-1 in argv. | 470 // The arguments to the VM are at positions 1 through i-1 in argv. |
| 460 Platform::SetExecutableArguments(i, argv); | 471 Platform::SetExecutableArguments(i, argv); |
| 461 | 472 |
| (...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1168 exit(Process::GlobalExitCode()); | 1179 exit(Process::GlobalExitCode()); |
| 1169 } | 1180 } |
| 1170 | 1181 |
| 1171 } // namespace bin | 1182 } // namespace bin |
| 1172 } // namespace dart | 1183 } // namespace dart |
| 1173 | 1184 |
| 1174 int main(int argc, char** argv) { | 1185 int main(int argc, char** argv) { |
| 1175 dart::bin::main(argc, argv); | 1186 dart::bin::main(argc, argv); |
| 1176 UNREACHABLE(); | 1187 UNREACHABLE(); |
| 1177 } | 1188 } |
| OLD | NEW |