Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Side by Side Diff: runtime/bin/main.cc

Issue 1981453002: Improve the help message for --observe to be more explicit. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_tools_api.h" 10 #include "include/dart_tools_api.h"
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 static bool ProcessEnableVmServiceOption(const char* option_value, 377 static bool ProcessEnableVmServiceOption(const char* option_value,
378 CommandLineOptions* vm_options) { 378 CommandLineOptions* vm_options) {
379 ASSERT(option_value != NULL); 379 ASSERT(option_value != NULL);
380 380
381 if (!ExtractPortAndIP(option_value, 381 if (!ExtractPortAndIP(option_value,
382 &vm_service_server_port, 382 &vm_service_server_port,
383 &vm_service_server_ip, 383 &vm_service_server_ip,
384 DEFAULT_VM_SERVICE_SERVER_PORT, 384 DEFAULT_VM_SERVICE_SERVER_PORT,
385 DEFAULT_VM_SERVICE_SERVER_IP)) { 385 DEFAULT_VM_SERVICE_SERVER_IP)) {
386 Log::PrintErr("unrecognized --enable-vm-service option syntax. " 386 Log::PrintErr("unrecognized --enable-vm-service option syntax. "
387 "Use --enable-vm-service[:<port number>[/<IPv4 address>]]\n"); 387 "Use --enable-vm-service[=<port number>[/<IPv4 address>]]\n");
388 return false; 388 return false;
389 } 389 }
390 390
391 return true; 391 return true;
392 } 392 }
393 393
394 394
395 static bool ProcessObserveOption(const char* option_value, 395 static bool ProcessObserveOption(const char* option_value,
396 CommandLineOptions* vm_options) { 396 CommandLineOptions* vm_options) {
397 ASSERT(option_value != NULL); 397 ASSERT(option_value != NULL);
398 398
399 if (!ExtractPortAndIP(option_value, 399 if (!ExtractPortAndIP(option_value,
400 &vm_service_server_port, 400 &vm_service_server_port,
401 &vm_service_server_ip, 401 &vm_service_server_ip,
402 DEFAULT_VM_SERVICE_SERVER_PORT, 402 DEFAULT_VM_SERVICE_SERVER_PORT,
403 DEFAULT_VM_SERVICE_SERVER_IP)) { 403 DEFAULT_VM_SERVICE_SERVER_IP)) {
404 Log::PrintErr("unrecognized --observe option syntax. " 404 Log::PrintErr("unrecognized --observe option syntax. "
405 "Use --observe[:<port number>[/<IPv4 address>]]\n"); 405 "Use --observe[=<port number>[/<IPv4 address>]]\n");
406 return false; 406 return false;
407 } 407 }
408 408
409 // These options should also be documented in the help message.
409 vm_options->AddArgument("--pause-isolates-on-exit"); 410 vm_options->AddArgument("--pause-isolates-on-exit");
410 vm_options->AddArgument("--pause-isolates-on-unhandled-exceptions"); 411 vm_options->AddArgument("--pause-isolates-on-unhandled-exceptions");
411 vm_options->AddArgument("--warn-on-pause-with-no-debugger"); 412 vm_options->AddArgument("--warn-on-pause-with-no-debugger");
412 return true; 413 return true;
413 } 414 }
414 415
415 416
416 static bool ProcessTraceLoadingOption(const char* arg, 417 static bool ProcessTraceLoadingOption(const char* arg,
417 CommandLineOptions* vm_options) { 418 CommandLineOptions* vm_options) {
418 if (*arg != '\0') { 419 if (*arg != '\0') {
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 "--checked or -c\n" 849 "--checked or -c\n"
849 " Insert runtime type checks and enable assertions (checked mode).\n" 850 " Insert runtime type checks and enable assertions (checked mode).\n"
850 "--help or -h\n" 851 "--help or -h\n"
851 " Display this message (add -v or --verbose for information about\n" 852 " Display this message (add -v or --verbose for information about\n"
852 " all VM options).\n" 853 " all VM options).\n"
853 "--package-root=<path> or -p<path>\n" 854 "--package-root=<path> or -p<path>\n"
854 " Where to find packages, that is, \"package:...\" imports.\n" 855 " Where to find packages, that is, \"package:...\" imports.\n"
855 "--packages=<path>\n" 856 "--packages=<path>\n"
856 " Where to find a package spec file.\n" 857 " Where to find a package spec file.\n"
857 "--observe[=<port>[/<bind-address>]]\n" 858 "--observe[=<port>[/<bind-address>]]\n"
858 " The observe flag is used to run a program with a default set of options\n" 859 " The observe flag is a convenience flag used to run a program with a\n"
859 " for debugging under Observatory. With the default options, Observatory\n" 860 " set of options which are often useful for debugging under Observatory.\n"
860 " will be available at http://127.0.0.1:8181/ (default port is 8181,\n" 861 " These default options are:\n"
861 " default bind address is 127.0.0.1). Isolates will pause at exit and\n" 862 " --enable-vm-service[=<port>[/<bind-address>]]\n"
862 " when they throw unhandled exceptions.\n" 863 " --pause-isolates-on-exit\n"
864 " --pause-isolates-on-unhandled-exceptions\n"
865 " --warn-on-pause-with-no-debugger\n"
866 " Please see these options (--help --verbose) for further documentation.\n"
863 "--version\n" 867 "--version\n"
864 " Print the VM version.\n"); 868 " Print the VM version.\n");
865 } else { 869 } else {
866 Log::PrintErr( 870 Log::PrintErr(
867 "Supported options:\n" 871 "Supported options:\n"
868 "--checked or -c\n" 872 "--checked or -c\n"
869 " Insert runtime type checks and enable assertions (checked mode).\n" 873 " Insert runtime type checks and enable assertions (checked mode).\n"
870 "--help or -h\n" 874 "--help or -h\n"
871 " Display this message (add -v or --verbose for information about\n" 875 " Display this message (add -v or --verbose for information about\n"
872 " all VM options).\n" 876 " all VM options).\n"
873 "--package-root=<path> or -p<path>\n" 877 "--package-root=<path> or -p<path>\n"
874 " Where to find packages, that is, \"package:...\" imports.\n" 878 " Where to find packages, that is, \"package:...\" imports.\n"
875 "--packages=<path>\n" 879 "--packages=<path>\n"
876 " Where to find a package spec file.\n" 880 " Where to find a package spec file.\n"
877 "--observe[=<port>[/<bind-address>]]\n" 881 "--observe[=<port>[/<bind-address>]]\n"
878 " The observe flag is used to run a program with a default set of options\n" 882 " The observe flag is a convenience flag used to run a program with a\n"
879 " for debugging under Observatory. With the default options, Observatory\n" 883 " set of options which are often useful for debugging under Observatory.\n"
880 " will be available at http://127.0.0.1:8181/ (default port is 8181,\n" 884 " These default options are:\n"
881 " default bind address is 127.0.0.1). Isolates will pause at exit and\n" 885 " --enable-vm-service[=<port>[/<bind-address>]]\n"
882 " when they throw unhandled exceptions.\n" 886 " --pause-isolates-on-exit\n"
887 " --pause-isolates-on-unhandled-exceptions\n"
888 " --warn-on-pause-with-no-debugger\n"
889 " Please see these options for further documentation.\n"
883 "--version\n" 890 "--version\n"
884 " Print the VM version.\n" 891 " Print the VM version.\n"
885 "\n" 892 "\n"
886 "--snapshot=<file_name>\n" 893 "--snapshot=<file_name>\n"
887 " loads Dart script and generates a snapshot in the specified file\n" 894 " loads Dart script and generates a snapshot in the specified file\n"
888 "\n" 895 "\n"
889 "--trace-loading\n" 896 "--trace-loading\n"
890 " enables tracing of library and script loading\n" 897 " enables tracing of library and script loading\n"
891 "\n" 898 "\n"
892 "--enable-vm-service[:<port>[/<bind-address>]]\n" 899 "--enable-vm-service[=<port>[/<bind-address>]]\n"
893 " enables the VM service and listens on specified port for connections\n" 900 " enables the VM service and listens on specified port for connections\n"
894 " (default port number is 8181, default bind address is 127.0.0.1).\n" 901 " (default port number is 8181, default bind address is 127.0.0.1).\n"
895 "\n" 902 "\n"
896 "The following options are only used for VM development and may\n" 903 "The following options are only used for VM development and may\n"
897 "be changed in any future version:\n"); 904 "be changed in any future version:\n");
898 const char* print_flags = "--print_flags"; 905 const char* print_flags = "--print_flags";
899 Dart_SetVMFlags(1, &print_flags); 906 Dart_SetVMFlags(1, &print_flags);
900 } 907 }
901 } 908 }
902 909
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
1722 Platform::Exit(Process::GlobalExitCode()); 1729 Platform::Exit(Process::GlobalExitCode());
1723 } 1730 }
1724 1731
1725 } // namespace bin 1732 } // namespace bin
1726 } // namespace dart 1733 } // namespace dart
1727 1734
1728 int main(int argc, char** argv) { 1735 int main(int argc, char** argv) {
1729 dart::bin::main(argc, argv); 1736 dart::bin::main(argc, argv);
1730 UNREACHABLE(); 1737 UNREACHABLE();
1731 } 1738 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698