blob: e99edaccd5d563eb4fa4b2d94b63f089568f3711 [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
Jim Inghamda26bd22012-06-08 21:56:10 +000026class CommandObjectDisassemble : public CommandObjectParsed
Chris Lattner24943d22010-06-08 16:52:24 +000027{
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
Greg Clayton143fcc32011-04-13 00:18:08 +000039 SetOptionValue (uint32_t option_idx, const char *option_arg);
Chris Lattner24943d22010-06-08 16:52:24 +000040
41 void
Greg Clayton143fcc32011-04-13 00:18:08 +000042 OptionParsingStarting ();
Chris Lattner24943d22010-06-08 16:52:24 +000043
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
Jim Inghamd2ad7fd2011-09-01 01:11:04 +000055 virtual Error
56 OptionParsingFinished ();
Greg Clayton149731c2011-03-25 18:03:16 +000057
Chris Lattner24943d22010-06-08 16:52:24 +000058 bool show_mixed; // Show mixed source/assembly
59 bool show_bytes;
60 uint32_t num_lines_context;
Jim Inghamaa3e3e12011-03-22 01:48:42 +000061 uint32_t num_instructions;
Chris Lattner24943d22010-06-08 16:52:24 +000062 bool raw;
Greg Clayton24bc5d92011-03-30 18:16:51 +000063 std::string func_name;
Jim Inghamd2ad7fd2011-09-01 01:11:04 +000064 bool cur_function;
Greg Clayton24bc5d92011-03-30 18:16:51 +000065 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;
Jim Inghamd2ad7fd2011-09-01 01:11:04 +000071 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.
Greg Claytonb3448432011-03-24 21:19:54 +000073 static OptionDefinition g_option_table[];
Chris Lattner24943d22010-06-08 16:52:24 +000074 };
75
Greg Clayton238c0a12010-09-18 01:14:36 +000076 CommandObjectDisassemble (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +000077
78 virtual
79 ~CommandObjectDisassemble ();
80
81 virtual
82 Options *
83 GetOptions ()
84 {
85 return &m_options;
86 }
87
Jim Inghamda26bd22012-06-08 21:56:10 +000088protected:
Chris Lattner24943d22010-06-08 16:52:24 +000089 virtual bool
Jim Inghamda26bd22012-06-08 21:56:10 +000090 DoExecute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +000091 CommandReturnObject &result);
92
Chris Lattner24943d22010-06-08 16:52:24 +000093 CommandOptions m_options;
94
Chris Lattner24943d22010-06-08 16:52:24 +000095};
96
97} // namespace lldb_private
98
99#endif // liblldb_CommandObjectDisassemble_h_