5#ifndef RUNTIME_BIN_MAIN_OPTIONS_H_
6#define RUNTIME_BIN_MAIN_OPTIONS_H_
20#define STRING_OPTIONS_LIST(V) \
21 V(packages, packages_file) \
22 V(snapshot, snapshot_filename) \
23 V(snapshot_depfile, snapshot_deps_filename) \
25 V(depfile_output_filename, depfile_output_filename) \
26 V(root_certs_file, root_certs_file) \
27 V(root_certs_cache, root_certs_cache) \
28 V(namespace, namespc) \
29 V(write_service_info, vm_write_service_info_filename)
33#define BOOL_OPTIONS_LIST(V) \
34 V(version, version_option) \
35 V(compile_all, compile_all) \
36 V(disable_service_origin_check, vm_service_dev_mode) \
37 V(disable_service_auth_codes, vm_service_auth_disabled) \
38 V(deterministic, deterministic) \
39 V(trace_loading, trace_loading) \
40 V(short_socket_read, short_socket_read) \
41 V(short_socket_write, short_socket_write) \
42 V(disable_exit, exit_disabled) \
43 V(preview_dart_2, nop_option) \
44 V(suppress_core_dump, suppress_core_dump) \
45 V(enable_service_port_fallback, enable_service_port_fallback) \
46 V(disable_dart_dev, disable_dart_dev) \
47 V(no_dds, disable_dds) \
48 V(long_ssl_cert_evaluation, long_ssl_cert_evaluation) \
49 V(bypass_trusting_system_roots, bypass_trusting_system_roots) \
50 V(delayed_filewatch_callback, delayed_filewatch_callback) \
51 V(mark_main_isolate_as_system_isolate, mark_main_isolate_as_system_isolate) \
52 V(no_serve_devtools, disable_devtools) \
53 V(serve_devtools, enable_devtools) \
54 V(no_serve_observatory, disable_observatory) \
55 V(serve_observatory, enable_observatory) \
56 V(print_dtd, print_dtd)
59#define SHORT_BOOL_OPTIONS_LIST(V) \
60 V(h, help, help_option) \
61 V(v, verbose, verbose_option)
63#define DEBUG_BOOL_OPTIONS_LIST(V) \
64 V(force_load_elf_from_memory, force_load_elf_from_memory)
71#define ENUM_OPTIONS_LIST(V) \
72 V(snapshot_kind, SnapshotKind, gen_snapshot_kind) \
73 V(verbosity, VerbosityLevel, verbosity)
76#define CB_OPTIONS_LIST(V) \
77 V(ProcessEnvironmentOption) \
78 V(ProcessEnableVmServiceOption) \
79 V(ProcessObserveOption) \
80 V(ProcessVMDebuggingOptions)
107 bool parsing_dart_vm_options,
111 bool* print_flags_seen,
112 bool* verbose_debug_seen);
114#define STRING_OPTION_GETTER(flag, variable) \
115 static const char* variable() { return variable##_; }
117#undef STRING_OPTION_GETTER
119#define BOOL_OPTION_GETTER(flag, variable) \
120 static bool variable() { return variable##_; }
125#undef BOOL_OPTION_GETTER
127#define SHORT_BOOL_OPTION_GETTER(short_name, long_name, variable) \
128 static bool variable() { return variable##_; }
130#undef SHORT_BOOL_OPTION_GETTER
132#define ENUM_OPTIONS_GETTER(flag, type, variable) \
133 static type variable() { return variable##_; }
135#undef ENUM_OPTIONS_GETTER
138#define CB_OPTIONS_DECL(callback) \
139 static bool callback(const char* arg, CommandLineOptions* vm_options);
141#undef CB_OPTIONS_DECL
156 mark_main_isolate_as_system_isolate_ =
state;
160 return VerbosityLevelToDartAPI(verbosity_);
162#if !defined(DART_PRECOMPILED_RUNTIME)
172#if defined(DART_PRECOMPILED_RUNTIME)
174 static char** GetEnvArguments(
int* argc);
178 static void DestroyEnvironment();
179#if defined(DART_PRECOMPILED_RUNTIME)
180 static void DestroyEnvArgv();
183#define STRING_OPTION_DECL(flag, variable) static const char* variable##_;
185#undef STRING_OPTION_DECL
187#define BOOL_OPTION_DECL(flag, variable) static bool variable##_;
192#undef BOOL_OPTION_DECL
194#define SHORT_BOOL_OPTION_DECL(short_name, long_name, variable) \
195 static bool variable##_;
197#undef SHORT_BOOL_OPTION_DECL
199#define ENUM_OPTION_DECL(flag, type, variable) static type variable##_;
201#undef ENUM_OPTION_DECL
205#if defined(DART_PRECOMPILED_RUNTIME)
206 static char** env_argv_;
207 static int env_argc_;
211#if !defined(DART_PRECOMPILED_RUNTIME)
232 static const char* vm_service_server_ip_;
233 static bool enable_vm_service_;
234 static int vm_service_server_port_;
235 static bool ExtractPortAndAddress(
const char* option_value,
239 const char* default_ip);
241#define OPTION_FRIEND(flag, variable) friend class OptionProcessor_##flag;
249#define SHORT_BOOL_OPTION_FRIEND(short_name, long_name, variable) \
250 friend class OptionProcessor_##long_name;
252#undef SHORT_BOOL_OPTION_FRIEND
254#define ENUM_OPTION_FRIEND(flag, type, variable) \
255 friend class OptionProcessor_##flag;
257#undef ENUM_OPTION_FRIEND
259 DISALLOW_ALLOCATION();
260 DISALLOW_IMPLICIT_CONSTRUCTORS(Options);
static bool preview_dart_2()
static void set_mark_main_isolate_as_system_isolate(bool state)
static void PrintVersion()
static void set_dfe(DFE *dfe)
static Dart_KernelCompilationVerbosityLevel verbosity_level()
static bool enable_vm_service()
static bool ParseArguments(int argc, char **argv, bool vm_run_app_snapshot, bool parsing_dart_vm_options, CommandLineOptions *vm_options, char **script_name, CommandLineOptions *dart_options, bool *print_flags_seen, bool *verbose_debug_seen)
static const char * vm_service_server_ip()
static int vm_service_server_port()
static dart::SimpleHashMap * environment()
Dart_KernelCompilationVerbosityLevel
@ Dart_KernelCompilationVerbosityLevel_Error
@ Dart_KernelCompilationVerbosityLevel_Warning
@ Dart_KernelCompilationVerbosityLevel_All
@ Dart_KernelCompilationVerbosityLevel_Info
#define DEBUG_BOOL_OPTIONS_LIST(V)
#define STRING_OPTION_DECL(flag, variable)
#define ENUM_OPTIONS_LIST(V)
#define SHORT_BOOL_OPTION_DECL(short_name, long_name, variable)
#define BOOL_OPTIONS_LIST(V)
#define ENUM_OPTIONS_GETTER(flag, type, variable)
#define SHORT_BOOL_OPTIONS_LIST(V)
#define ENUM_OPTION_FRIEND(flag, type, variable)
#define STRING_OPTION_GETTER(flag, variable)
#define CB_OPTIONS_DECL(callback)
#define BOOL_OPTION_DECL(flag, variable)
#define BOOL_OPTION_GETTER(flag, variable)
#define ENUM_OPTION_DECL(flag, type, variable)
#define CB_OPTIONS_LIST(V)
#define SHORT_BOOL_OPTION_GETTER(short_name, long_name, variable)
#define OPTION_FRIEND(flag, variable)
#define STRING_OPTIONS_LIST(V)
#define SHORT_BOOL_OPTION_FRIEND(short_name, long_name, variable)
static bool vm_run_app_snapshot
static constexpr const char * DEFAULT_VM_SERVICE_SERVER_IP
static constexpr int DEFAULT_VM_SERVICE_SERVER_PORT
static constexpr int INVALID_VM_SERVICE_SERVER_PORT