diff options
-rw-r--r-- | man/mono.1 | 6 | ||||
-rw-r--r-- | mono/mini/aot-compiler.c | 11 |
2 files changed, 16 insertions, 1 deletions
diff --git a/man/mono.1 b/man/mono.1 index 1c2e054aee1..1afc37ea670 100644 --- a/man/mono.1 +++ b/man/mono.1 @@ -144,6 +144,12 @@ Defaults to 128. .I nodebug Instructs the AOT compiler to not output any debugging information. .TP +.I dwarfdebug +Instructs the AOT compiler to emit DWARF debugging information. When +used together with the nodebug option, only DWARF debugging +information is emitted, but not the information that can be used at +runtime. +.TP .I nrgctx-trampolines=[number] When compiling in full aot mode, the generic sharing trampolines must be precreated in the AOT image. You can add additional method trampolines with this argument. diff --git a/mono/mini/aot-compiler.c b/mono/mini/aot-compiler.c index edfd92b4a43..e18cc14c779 100644 --- a/mono/mini/aot-compiler.c +++ b/mono/mini/aot-compiler.c @@ -123,6 +123,7 @@ typedef struct MonoAotOptions { gboolean asm_only; gboolean asm_writer; gboolean nodebug; + gboolean dwarf_debug; gboolean soft_debug; gboolean log_generics; gboolean direct_pinvoke; @@ -5783,6 +5784,8 @@ mono_aot_parse_options (const char *aot_options, MonoAotOptions *opts) opts->asm_writer = TRUE; } else if (str_begins_with (arg, "nodebug")) { opts->nodebug = TRUE; + } else if (str_begins_with (arg, "dwarfdebug")) { + opts->dwarf_debug = TRUE; } else if (str_begins_with (arg, "nopagetrampolines")) { opts->use_trampolines_page = FALSE; } else if (str_begins_with (arg, "ntrampolines=")) { @@ -5842,6 +5845,7 @@ mono_aot_parse_options (const char *aot_options, MonoAotOptions *opts) printf (" asmonly\n"); printf (" asmwriter\n"); printf (" nodebug\n"); + printf (" dwarfdebug\n"); printf (" ntrampolines=\n"); printf (" nrgctx-trampolines=\n"); printf (" nimt-trampolines=\n"); @@ -8338,8 +8342,13 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options) } } - if (!acfg->aot_opts.nodebug) + if (!acfg->aot_opts.nodebug || acfg->aot_opts.dwarf_debug) { + if (acfg->aot_opts.dwarf_debug && mono_debug_format == MONO_DEBUG_FORMAT_NONE) { + fprintf (stderr, "The dwarf AOT option requires the --debug option.\n"); + return 1; + } acfg->dwarf = mono_dwarf_writer_create (acfg->w, NULL, 0, FALSE); + } img_writer_emit_start (acfg->w); |