File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
lldb/tools/lldb-dap/Handler Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,22 @@ void DisassembleRequestHandler::operator()(
116116
117117 const auto inst_count =
118118 GetInteger<int64_t >(arguments, " instructionCount" ).value_or (0 );
119- lldb::SBInstructionList insts = dap.target .ReadInstructions (addr, inst_count);
119+
120+ std::string flavor_string{};
121+ const auto target_triple = llvm::StringRef (dap.target .GetTriple ());
122+ if (target_triple.starts_with (" x86_64" ) || target_triple.starts_with (" x86" )) {
123+ const lldb::SBStructuredData flavor =
124+ dap.debugger .GetSetting (" target.x86-disassembly-flavor" );
125+
126+ const size_t str_length = flavor.GetStringValue (nullptr , 0 );
127+ if (str_length != 0 ) {
128+ flavor_string.resize (str_length + 1 );
129+ flavor.GetStringValue (flavor_string.data (), flavor_string.length ());
130+ }
131+ }
132+
133+ lldb::SBInstructionList insts =
134+ dap.target .ReadInstructions (addr, inst_count, flavor_string.c_str ());
120135
121136 if (!insts.IsValid ()) {
122137 response[" success" ] = false ;
You can’t perform that action at this time.
0 commit comments