1254721Semaste//===-- CommandObjectDisassemble.h ------------------------------*- C++ -*-===// 2254721Semaste// 3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4353358Sdim// See https://llvm.org/LICENSE.txt for license information. 5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6254721Semaste// 7254721Semaste//===----------------------------------------------------------------------===// 8254721Semaste 9254721Semaste#ifndef liblldb_CommandObjectDisassemble_h_ 10254721Semaste#define liblldb_CommandObjectDisassemble_h_ 11254721Semaste 12254721Semaste#include "lldb/Interpreter/CommandObject.h" 13254721Semaste#include "lldb/Interpreter/Options.h" 14327952Sdim#include "lldb/Utility/ArchSpec.h" 15254721Semaste 16254721Semastenamespace lldb_private { 17254721Semaste 18254721Semaste// CommandObjectDisassemble 19254721Semaste 20314564Sdimclass CommandObjectDisassemble : public CommandObjectParsed { 21254721Semastepublic: 22314564Sdim class CommandOptions : public Options { 23314564Sdim public: 24314564Sdim CommandOptions(); 25254721Semaste 26314564Sdim ~CommandOptions() override; 27254721Semaste 28321369Sdim Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, 29321369Sdim ExecutionContext *execution_context) override; 30254721Semaste 31314564Sdim void OptionParsingStarting(ExecutionContext *execution_context) override; 32254721Semaste 33314564Sdim llvm::ArrayRef<OptionDefinition> GetDefinitions() override; 34254721Semaste 35314564Sdim const char *GetPluginName() { 36314564Sdim return (plugin_name.empty() ? nullptr : plugin_name.c_str()); 37314564Sdim } 38254721Semaste 39314564Sdim const char *GetFlavorString() { 40314564Sdim if (flavor_string.empty() || flavor_string == "default") 41314564Sdim return nullptr; 42314564Sdim return flavor_string.c_str(); 43314564Sdim } 44254721Semaste 45321369Sdim Status OptionParsingFinished(ExecutionContext *execution_context) override; 46254721Semaste 47314564Sdim bool show_mixed; // Show mixed source/assembly 48314564Sdim bool show_bytes; 49314564Sdim uint32_t num_lines_context; 50314564Sdim uint32_t num_instructions; 51314564Sdim bool raw; 52314564Sdim std::string func_name; 53314564Sdim bool current_function; 54314564Sdim lldb::addr_t start_addr; 55314564Sdim lldb::addr_t end_addr; 56314564Sdim bool at_pc; 57314564Sdim bool frame_line; 58314564Sdim std::string plugin_name; 59314564Sdim std::string flavor_string; 60314564Sdim ArchSpec arch; 61314564Sdim bool some_location_specified; // If no location was specified, we'll select 62314564Sdim // "at_pc". This should be set 63314564Sdim // in SetOptionValue if anything the selects a location is set. 64314564Sdim lldb::addr_t symbol_containing_addr; 65314564Sdim }; 66254721Semaste 67314564Sdim CommandObjectDisassemble(CommandInterpreter &interpreter); 68254721Semaste 69314564Sdim ~CommandObjectDisassemble() override; 70314564Sdim 71314564Sdim Options *GetOptions() override { return &m_options; } 72314564Sdim 73254721Semasteprotected: 74314564Sdim bool DoExecute(Args &command, CommandReturnObject &result) override; 75254721Semaste 76314564Sdim CommandOptions m_options; 77254721Semaste}; 78254721Semaste 79254721Semaste} // namespace lldb_private 80254721Semaste 81296417Sdim#endif // liblldb_CommandObjectDisassemble_h_ 82