blob: 91812af31876bfd49cfce4d38ba23ef50824ae2d [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 Claytonb3448432011-03-24 21:19:54 +000066 static OptionDefinition g_option_table[];
Chris Lattner24943d22010-06-08 16:52:24 +000067 };
68
Greg Clayton238c0a12010-09-18 01:14:36 +000069 CommandObjectDisassemble (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +000070
71 virtual
72 ~CommandObjectDisassemble ();
73
74 virtual
75 Options *
76 GetOptions ()
77 {
78 return &m_options;
79 }
80
81 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +000082 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +000083 CommandReturnObject &result);
84
85protected:
86 CommandOptions m_options;
87
Chris Lattner24943d22010-06-08 16:52:24 +000088};
89
90} // namespace lldb_private
91
92#endif // liblldb_CommandObjectDisassemble_h_