Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a 'dwarfdebug' AOT option to emit DWARF debug info even if the 'n…

…odebug' AOT option is used.
  • Loading branch information...
commit 1a441364a6c23a5a0976c555f695b0a46fd25b66 1 parent 9e3e694
@vargaz vargaz authored
Showing with 16 additions and 1 deletion.
  1. +6 −0 man/mono.1
  2. +10 −1 mono/mini/aot-compiler.c
View
6 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.
View
11 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);
Please sign in to comment.
Something went wrong with that request. Please try again.