1//===-- CommandObjectDisassemble.h ------------------------------*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef liblldb_CommandObjectDisassemble_h_
11#define liblldb_CommandObjectDisassemble_h_
12
13// C Includes
14// C++ Includes
15// Other libraries and framework includes
16// Project includes
17#include "lldb/Core/ArchSpec.h"
18#include "lldb/Interpreter/CommandObject.h"
19#include "lldb/Interpreter/Options.h"
20
21namespace lldb_private {
22
23//-------------------------------------------------------------------------
24// CommandObjectDisassemble
25//-------------------------------------------------------------------------
26
27class CommandObjectDisassemble : public CommandObjectParsed
28{
29public:
30    class CommandOptions : public Options
31    {
32    public:
33
34        CommandOptions (CommandInterpreter &interpreter);
35
36        virtual
37        ~CommandOptions ();
38
39        virtual Error
40        SetOptionValue (uint32_t option_idx, const char *option_arg);
41
42        void
43        OptionParsingStarting ();
44
45        const OptionDefinition*
46        GetDefinitions ();
47
48        const char *
49        GetPluginName ()
50        {
51            if (plugin_name.empty())
52                return NULL;
53            return plugin_name.c_str();
54        }
55
56        const char *
57        GetFlavorString ()
58        {
59            if (flavor_string.empty() || flavor_string == "default")
60                return NULL;
61            return flavor_string.c_str();
62        }
63
64        virtual Error
65        OptionParsingFinished ();
66
67        bool show_mixed; // Show mixed source/assembly
68        bool show_bytes;
69        uint32_t num_lines_context;
70        uint32_t num_instructions;
71        bool raw;
72        std::string func_name;
73        bool current_function;
74        lldb::addr_t start_addr;
75        lldb::addr_t end_addr;
76        bool at_pc;
77        bool frame_line;
78        std::string plugin_name;
79        std::string flavor_string;
80        ArchSpec arch;
81        bool some_location_specified; // If no location was specified, we'll select "at_pc".  This should be set
82                                      // in SetOptionValue if anything the selects a location is set.
83        lldb::addr_t symbol_containing_addr;
84        static OptionDefinition g_option_table[];
85    };
86
87    CommandObjectDisassemble (CommandInterpreter &interpreter);
88
89    virtual
90    ~CommandObjectDisassemble ();
91
92    virtual
93    Options *
94    GetOptions ()
95    {
96        return &m_options;
97    }
98
99protected:
100    virtual bool
101    DoExecute (Args& command,
102             CommandReturnObject &result);
103
104    CommandOptions m_options;
105
106};
107
108} // namespace lldb_private
109
110#endif  // liblldb_CommandObjectDisassemble_h_
111