]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/source/Commands/CommandObjectDisassemble.h
Upgrade to OpenPAM Radula.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / source / Commands / CommandObjectDisassemble.h
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
21 namespace lldb_private {
22
23 //-------------------------------------------------------------------------
24 // CommandObjectDisassemble
25 //-------------------------------------------------------------------------
26
27 class CommandObjectDisassemble : public CommandObjectParsed
28 {
29 public:
30     class CommandOptions : public Options
31     {
32     public:
33         CommandOptions (CommandInterpreter &interpreter);
34
35         ~CommandOptions() override;
36
37         Error
38         SetOptionValue(uint32_t option_idx, const char *option_arg) override;
39
40         void
41         OptionParsingStarting() override;
42
43         const OptionDefinition*
44         GetDefinitions() override;
45
46         const char *
47         GetPluginName ()
48         {
49             return (plugin_name.empty() ? nullptr : plugin_name.c_str());
50         }
51         
52         const char *
53         GetFlavorString ()
54         {
55             if (flavor_string.empty() || flavor_string == "default")
56                 return nullptr;
57             return flavor_string.c_str();
58         }
59         
60         Error
61         OptionParsingFinished() override;
62
63         bool show_mixed; // Show mixed source/assembly
64         bool show_bytes;
65         uint32_t num_lines_context;
66         uint32_t num_instructions;
67         bool raw;
68         std::string func_name;
69         bool current_function;
70         lldb::addr_t start_addr;
71         lldb::addr_t end_addr;
72         bool at_pc;
73         bool frame_line;
74         std::string plugin_name;
75         std::string flavor_string;
76         ArchSpec arch;
77         bool some_location_specified; // If no location was specified, we'll select "at_pc".  This should be set
78                                       // in SetOptionValue if anything the selects a location is set.
79         lldb::addr_t symbol_containing_addr;
80         static OptionDefinition g_option_table[];
81     };
82
83     CommandObjectDisassemble (CommandInterpreter &interpreter);
84
85     ~CommandObjectDisassemble() override;
86
87     Options *
88     GetOptions() override
89     {
90         return &m_options;
91     }
92
93 protected:
94     bool
95     DoExecute(Args& command,
96               CommandReturnObject &result) override;
97
98     CommandOptions m_options;
99 };
100
101 } // namespace lldb_private
102
103 #endif // liblldb_CommandObjectDisassemble_h_