# HG changeset patch # User lucy # Date 1574689671 -3600 # Node ID 13470cb3d9de8889e12359bdbd97f2a1c82f603c # Parent 623722a6aeb98e63ade808b1308d7973a57268ce 8234583: PrintAssemblyOptions isn't passed to hsdis library Reviewed-by: diff --git a/src/hotspot/share/compiler/disassembler.cpp b/src/hotspot/share/compiler/disassembler.cpp --- a/src/hotspot/share/compiler/disassembler.cpp +++ b/src/hotspot/share/compiler/disassembler.cpp @@ -414,12 +414,17 @@ _bytes_per_line = Disassembler::pd_instruction_alignment(); _print_file_name = true; + // parse the global option string + if ((options() == NULL) || (strlen(options()) == 0)) { + // We need to fill the options buffer for each newly created + // decode_env instance. The hsdis_* library looks for options + // in that buffer. + collect_options(Disassembler::pd_cpu_opts()); + collect_options(PrintAssemblyOptions); + } + if (_optionsParsed) return; // parse only once - // parse the global option string: - collect_options(Disassembler::pd_cpu_opts()); - collect_options(PrintAssemblyOptions); - if (strstr(options(), "print-raw")) { _print_raw = (strstr(options(), "xml") ? 2 : 1); }