blob: 7587c0a97ca6909768ad62848b829178dbd054bf [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
Greg Clayton49ce8962012-08-29 21:13:06 +000017#include "lldb/Core/ArchSpec.h"
Chris Lattner24943d22010-06-08 16:52:24 +000018#include "lldb/Interpreter/CommandObject.h"
Jim Ingham84cdc152010-06-15 19:49:27 +000019#include "lldb/Interpreter/Options.h"
Chris Lattner24943d22010-06-08 16:52:24 +000020
21namespace lldb_private {
22
23//-------------------------------------------------------------------------
24// CommandObjectDisassemble
25//-------------------------------------------------------------------------
26
Jim Inghamda26bd22012-06-08 21:56:10 +000027class CommandObjectDisassemble : public CommandObjectParsed
Chris Lattner24943d22010-06-08 16:52:24 +000028{
29public:
30 class CommandOptions : public Options
31 {
32 public:
33
Greg Claytonf15996e2011-04-07 22:46:35 +000034 CommandOptions (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +000035
36 virtual
37 ~CommandOptions ();
38
39 virtual Error
Greg Clayton143fcc32011-04-13 00:18:08 +000040 SetOptionValue (uint32_t option_idx, const char *option_arg);
Chris Lattner24943d22010-06-08 16:52:24 +000041
42 void
Greg Clayton143fcc32011-04-13 00:18:08 +000043 OptionParsingStarting ();
Chris Lattner24943d22010-06-08 16:52:24 +000044
Greg Claytonb3448432011-03-24 21:19:54 +000045 const OptionDefinition*
Chris Lattner24943d22010-06-08 16:52:24 +000046 GetDefinitions ();
47
Greg Clayton149731c2011-03-25 18:03:16 +000048 const char *
49 GetPluginName ()
50 {
Greg Clayton24bc5d92011-03-30 18:16:51 +000051 if (plugin_name.empty())
Greg Clayton149731c2011-03-25 18:03:16 +000052 return NULL;
Greg Clayton24bc5d92011-03-30 18:16:51 +000053 return plugin_name.c_str();
Greg Clayton149731c2011-03-25 18:03:16 +000054 }
55
Jim Inghamd2ad7fd2011-09-01 01:11:04 +000056 virtual Error
57 OptionParsingFinished ();
Greg Clayton149731c2011-03-25 18:03:16 +000058
Chris Lattner24943d22010-06-08 16:52:24 +000059 bool show_mixed; // Show mixed source/assembly
60 bool show_bytes;
61 uint32_t num_lines_context;
Jim Inghamaa3e3e12011-03-22 01:48:42 +000062 uint32_t num_instructions;
Chris Lattner24943d22010-06-08 16:52:24 +000063 bool raw;
Greg Clayton24bc5d92011-03-30 18:16:51 +000064 std::string func_name;
Jim Inghamd2ad7fd2011-09-01 01:11:04 +000065 bool cur_function;
Greg Clayton24bc5d92011-03-30 18:16:51 +000066 lldb::addr_t start_addr;
67 lldb::addr_t end_addr;
68 bool at_pc;
69 bool frame_line;
70 std::string plugin_name;
71 ArchSpec arch;
Jim Inghamd2ad7fd2011-09-01 01:11:04 +000072 bool some_location_specified; // If no location was specified, we'll select "at_pc". This should be set
73 // in SetOptionValue if anything the selects a location is set.
Greg Claytonb3448432011-03-24 21:19:54 +000074 static OptionDefinition g_option_table[];
Chris Lattner24943d22010-06-08 16:52:24 +000075 };
76
Greg Clayton238c0a12010-09-18 01:14:36 +000077 CommandObjectDisassemble (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +000078
79 virtual
80 ~CommandObjectDisassemble ();
81
82 virtual
83 Options *
84 GetOptions ()
85 {
86 return &m_options;
87 }
88
Jim Inghamda26bd22012-06-08 21:56:10 +000089protected:
Chris Lattner24943d22010-06-08 16:52:24 +000090 virtual bool
Jim Inghamda26bd22012-06-08 21:56:10 +000091 DoExecute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +000092 CommandReturnObject &result);
93
Chris Lattner24943d22010-06-08 16:52:24 +000094 CommandOptions m_options;
95
Chris Lattner24943d22010-06-08 16:52:24 +000096};
97
98} // namespace lldb_private
99
100#endif // liblldb_CommandObjectDisassemble_h_