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/Interpreter/CommandObject.h"
18 #include "lldb/Interpreter/Options.h"
19 
20 namespace lldb_private {
21 
22 //-------------------------------------------------------------------------
23 // CommandObjectDisassemble
24 //-------------------------------------------------------------------------
25 
26 class CommandObjectDisassemble : public CommandObject
27 {
28 public:
29     class CommandOptions : public Options
30     {
31     public:
32 
33         CommandOptions (CommandInterpreter &interpreter);
34 
35         virtual
36         ~CommandOptions ();
37 
38         virtual Error
39         SetOptionValue (uint32_t option_idx, const char *option_arg);
40 
41         void
42         OptionParsingStarting ();
43 
44         const OptionDefinition*
45         GetDefinitions ();
46 
47         const char *
48         GetPluginName ()
49         {
50             if (plugin_name.empty())
51                 return NULL;
52             return plugin_name.c_str();
53         }
54 
55 
56         bool show_mixed; // Show mixed source/assembly
57         bool show_bytes;
58         uint32_t num_lines_context;
59         uint32_t num_instructions;
60         bool raw;
61         std::string func_name;
62         lldb::addr_t start_addr;
63         lldb::addr_t end_addr;
64         bool at_pc;
65         bool frame_line;
66         std::string plugin_name;
67         ArchSpec arch;
68         static OptionDefinition g_option_table[];
69     };
70 
71     CommandObjectDisassemble (CommandInterpreter &interpreter);
72 
73     virtual
74     ~CommandObjectDisassemble ();
75 
76     virtual
77     Options *
78     GetOptions ()
79     {
80         return &m_options;
81     }
82 
83     virtual bool
84     Execute (Args& command,
85              CommandReturnObject &result);
86 
87 protected:
88     CommandOptions m_options;
89 
90 };
91 
92 } // namespace lldb_private
93 
94 #endif  // liblldb_CommandObjectDisassemble_h_
95