blob: ac354a8f2c725cdad203d990e80837969bdf03a4 [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
Greg Claytonf15996e2011-04-07 22:46:35 +000033 CommandOptions (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +000034
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 {
Greg Clayton24bc5d92011-03-30 18:16:51 +000050 if (plugin_name.empty())
Greg Clayton149731c2011-03-25 18:03:16 +000051 return NULL;
Greg Clayton24bc5d92011-03-30 18:16:51 +000052 return plugin_name.c_str();
Greg Clayton149731c2011-03-25 18:03:16 +000053 }
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;
Greg Clayton24bc5d92011-03-30 18:16:51 +000061 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;
Greg Claytonb3448432011-03-24 21:19:54 +000068 static OptionDefinition g_option_table[];
Chris Lattner24943d22010-06-08 16:52:24 +000069 };
70
Greg Clayton238c0a12010-09-18 01:14:36 +000071 CommandObjectDisassemble (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +000072
73 virtual
74 ~CommandObjectDisassemble ();
75
76 virtual
77 Options *
78 GetOptions ()
79 {
80 return &m_options;
81 }
82
83 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +000084 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +000085 CommandReturnObject &result);
86
87protected:
88 CommandOptions m_options;
89
Chris Lattner24943d22010-06-08 16:52:24 +000090};
91
92} // namespace lldb_private
93
94#endif // liblldb_CommandObjectDisassemble_h_