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         virtual Error
56         OptionParsingFinished ();
57 
58         bool show_mixed; // Show mixed source/assembly
59         bool show_bytes;
60         uint32_t num_lines_context;
61         uint32_t num_instructions;
62         bool raw;
63         std::string func_name;
64         bool cur_function;
65         lldb::addr_t start_addr;
66         lldb::addr_t end_addr;
67         bool at_pc;
68         bool frame_line;
69         std::string plugin_name;
70         ArchSpec arch;
71         bool some_location_specified; // If no location was specified, we'll select "at_pc".  This should be set
72                                       // in SetOptionValue if anything the selects a location is set.
73         static OptionDefinition g_option_table[];
74     };
75 
76     CommandObjectDisassemble (CommandInterpreter &interpreter);
77 
78     virtual
79     ~CommandObjectDisassemble ();
80 
81     virtual
82     Options *
83     GetOptions ()
84     {
85         return &m_options;
86     }
87 
88     virtual bool
89     Execute (Args& command,
90              CommandReturnObject &result);
91 
92 protected:
93     CommandOptions m_options;
94 
95 };
96 
97 } // namespace lldb_private
98 
99 #endif  // liblldb_CommandObjectDisassemble_h_
100