History

Add disable garbage collector flag

arr committed 9 years ago

Commit 27bffe61 parent dd16d0c1 file · +11 −2Browse files

Unified · Split

src/exec/main.cpp+11−2
@@ -258,11 +258,13 @@ void print_banner(const exec_options &options) · 257 unmodified lines
258258 void print_help()
259259 {
260260 std::cout
261− << "Usage: disvm-exec [-d[e|m|x]*] [-l[s|S|t|T|e|g|m]*] [-t <num>] [-q] [-h] <entry module> <args>*\n"
261+ << "Usage: disvm-exec [-d[e|m|x]*] [-l[s|S|t|T|e|g|m]*] [-gD] [-t <num>] [-q] [-h] <entry module> <args>*\n"
262262 " d - Enable debugger\n"
263263 " e - Break on entry\n"
264264 " m - Break on module load\n"
265265 " x - Break on exception (first chance)\n"
266+ " g - Garbage collector options\n"
267+ " D - Disable\n"
266268 " l - Enable logging in a component\n"
267269 " s - Scheduler\n"
268270 " S - Stack\n"
@@ -274,7 +276,7 @@ void print_help() · 5 unmodified lines
274276 " m - Memory allocations (noisy)\n"
275277 " q - Suppress banner and configuration\n"
276278 " t - Specify the number of system threads to use (0 < x <= 4)\n"
277− " h - Print help (alternative: '?')\n";
279+ " h - Print this help (alternative: '?')\n";
278280 }
279281
280282 void log_callback(const component_trace_t origin, const log_level_t level, const char *msg_fmt, std::va_list args)
@@ -335,6 +337,13 @@ void process_arg(char* arg, std::function<char *()> next, exec_options &options) · 54 unmodified lines
335337 }
336338 break;
337339
340+ case 'g':
341+ if (arg_len <= 2 || arg[2] != 'D')
342+ throw arg_exception_t{ "Invalid garbage collector option" };
343+
344+ options.vm_config.create_gc = disvm::runtime::create_no_op_gc;
345+ break;
346+
338347 case 't':
339348 {
340349 auto sys_threads_str = next();