Skip to content

Commit 0bdc52f

Browse files
committed
[lldb][lldb-dap] remove redundant code
1 parent 6d3872f commit 0bdc52f

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

lldb/source/Commands/CommandObjectDisassemble.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ void CommandObjectDisassemble::CommandOptions::OptionParsingStarting(
190190
// architecture. For now GetDisassemblyFlavor is really only valid for x86
191191
// (and for the llvm assembler plugin, but I'm papering over that since that
192192
// is the only disassembler plugin we have...
193-
// This logic is duplicated in `Handler/DisassembleRequestHandler`.
194193
if (target->GetArchitecture().GetTriple().getArch() == llvm::Triple::x86 ||
195194
target->GetArchitecture().GetTriple().getArch() ==
196195
llvm::Triple::x86_64) {

lldb/tools/lldb-dap/Handler/DisassembleRequestHandler.cpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -192,21 +192,6 @@ DisassembleRequestHandler::Run(const DisassembleArguments &args) const {
192192
return llvm::make_error<DAPError>(
193193
"Memory reference not found in the current binary.");
194194

195-
std::string flavor_string;
196-
const auto target_triple = llvm::StringRef(dap.target.GetTriple());
197-
// This handles both 32 and 64bit x86 architecture. The logic is duplicated in
198-
// `CommandObjectDisassemble::CommandOptions::OptionParsingStarting`
199-
if (target_triple.starts_with("x86")) {
200-
const lldb::SBStructuredData flavor =
201-
dap.debugger.GetSetting("target.x86-disassembly-flavor");
202-
203-
const size_t str_length = flavor.GetStringValue(nullptr, 0);
204-
if (str_length != 0) {
205-
flavor_string.resize(str_length + 1);
206-
flavor.GetStringValue(flavor_string.data(), flavor_string.length());
207-
}
208-
}
209-
210195
// Offset (in instructions) to be applied after the byte offset (if any)
211196
// before disassembling. Can be negative.
212197
int64_t instruction_offset = args.instructionOffset.value_or(0);
@@ -219,7 +204,7 @@ DisassembleRequestHandler::Run(const DisassembleArguments &args) const {
219204
"Unexpected error while disassembling instructions.");
220205

221206
lldb::SBInstructionList insts = dap.target.ReadInstructions(
222-
disassemble_start_addr, args.instructionCount, flavor_string.c_str());
207+
disassemble_start_addr, args.instructionCount);
223208
if (!insts.IsValid())
224209
return llvm::make_error<DAPError>(
225210
"Unexpected error while disassembling instructions.");

0 commit comments

Comments
 (0)