From f3ebb89392163afba18f0f05634255adaf527294 Mon Sep 17 00:00:00 2001 From: Yuichiro MASUI Date: Wed, 27 Mar 2013 18:02:48 +0900 Subject: Added debug infomation section into .mrb file --- tools/mrbc/mrbc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tools/mrbc') diff --git a/tools/mrbc/mrbc.c b/tools/mrbc/mrbc.c index 6535d5636..e217ef30f 100644 --- a/tools/mrbc/mrbc.c +++ b/tools/mrbc/mrbc.c @@ -21,6 +21,7 @@ struct _args { char *ext; mrb_bool check_syntax : 1; mrb_bool verbose : 1; + mrb_bool debug_info : 1; }; static void @@ -31,6 +32,7 @@ usage(const char *name) "-c check syntax only", "-o place the output into ", "-v print version number, then trun on verbose mode", + "-g produce debugging information", "-B binary output in C language format", "--verbose run at verbose mode", "--version print the version", @@ -107,6 +109,9 @@ parse_args(mrb_state *mrb, int argc, char **argv, struct _args *args) mrb_show_version(mrb); args->verbose = 1; break; + case 'g': + args->debug_info = 1; + break; case '-': if (strcmp((*argv) + 2, "version") == 0) { mrb_show_version(mrb); @@ -209,10 +214,10 @@ main(int argc, char **argv) return EXIT_SUCCESS; } if (args.initname) { - n = mrb_dump_irep_cfunc(mrb, n, args.wfp, args.initname); + n = mrb_dump_irep_cfunc(mrb, n, args.debug_info, args.wfp, args.initname); } else { - n = mrb_dump_irep_binary(mrb, n, args.wfp); + n = mrb_dump_irep_binary(mrb, n, args.debug_info, args.wfp); } cleanup(mrb, &args); -- cgit v1.2.3