blob: 42ede79787dfc1b0ee746c11b0a9debfbbd44e6d [file] [log] [blame]
Chris Lattner24943d22010-06-08 16:52:24 +00001//===-- 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"
Jim Ingham84cdc152010-06-15 19:49:27 +000018#include "lldb/Interpreter/Options.h"
Chris Lattner24943d22010-06-08 16:52:24 +000019
20namespace lldb_private {
21
22//-------------------------------------------------------------------------
23// CommandObjectDisassemble
24//-------------------------------------------------------------------------
25
26class CommandObjectDisassemble : public CommandObject
27{
28public:
29 class CommandOptions : public Options
30 {
31 public:
32
33 CommandOptions ();
34
35 virtual
36 ~CommandOptions ();
37
38 virtual Error
39 SetOptionValue (int option_idx, const char *option_arg);
40
41 void
42 ResetOptionValues ();
43
Greg Claytonb3448432011-03-24 21:19:54 +000044 const OptionDefinition*
Chris Lattner24943d22010-06-08 16:52:24 +000045 GetDefinitions ();
46
Greg Clayton149731c2011-03-25 18:03:16 +000047 const char *
48 GetPluginName ()
49 {
50 if (m_plugin_name.empty())
51 return NULL;
52 return m_plugin_name.c_str();
53 }
54
55
Chris Lattner24943d22010-06-08 16:52:24 +000056 bool show_mixed; // Show mixed source/assembly
57 bool show_bytes;
58 uint32_t num_lines_context;
Jim Inghamaa3e3e12011-03-22 01:48:42 +000059 uint32_t num_instructions;
Chris Lattner24943d22010-06-08 16:52:24 +000060 bool raw;
61 std::string m_func_name;
Jim Ingham34e9a982010-06-15 18:47:14 +000062 lldb::addr_t m_start_addr;
63 lldb::addr_t m_end_addr;
Jim Inghamaa3e3e12011-03-22 01:48:42 +000064 bool m_at_pc;
Greg Clayton149731c2011-03-25 18:03:16 +000065 std::string m_plugin_name;
Greg Clayton889fbd02011-03-26 19:14:58 +000066 ArchSpec m_arch;
Greg Claytonb3448432011-03-24 21:19:54 +000067 static OptionDefinition g_option_table[];
Chris Lattner24943d22010-06-08 16:52:24 +000068 };
69
Greg Clayton238c0a12010-09-18 01:14:36 +000070 CommandObjectDisassemble (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +000071
72 virtual
73 ~CommandObjectDisassemble ();
74
75 virtual
76 Options *
77 GetOptions ()
78 {
79 return &m_options;
80 }
81
82 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +000083 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +000084 CommandReturnObject &result);
85
86protected:
87 CommandOptions m_options;
88
Chris Lattner24943d22010-06-08 16:52:24 +000089};
90
91} // namespace lldb_private
92
93#endif // liblldb_CommandObjectDisassemble_h_