blob: e315515a28cf3a91c0edc5d89842dc58045a101b [file] [log] [blame]
Chris Lattner24943d22010-06-08 16:52:24 +00001//===-- CommandObjectBreakpointCommand.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_CommandObjectBreakpointCommand_h_
11#define liblldb_CommandObjectBreakpointCommand_h_
12
13// C Includes
14// C++ Includes
15
16
17// Other libraries and framework includes
18// Project includes
19
20#include "lldb/lldb-types.h"
Jim Ingham84cdc152010-06-15 19:49:27 +000021#include "lldb/Interpreter/Options.h"
Chris Lattner24943d22010-06-08 16:52:24 +000022#include "lldb/Core/InputReader.h"
23#include "lldb/Interpreter/CommandObject.h"
24#include "lldb/Interpreter/CommandReturnObject.h"
25#include "lldb/Interpreter/CommandObjectMultiword.h"
26
27
28namespace lldb_private {
29
30//-------------------------------------------------------------------------
31// CommandObjectMultiwordBreakpoint
32//-------------------------------------------------------------------------
33
34class CommandObjectBreakpointCommand : public CommandObjectMultiword
35{
36public:
Greg Clayton63094e02010-06-23 01:19:29 +000037 CommandObjectBreakpointCommand (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +000038
39 virtual
40 ~CommandObjectBreakpointCommand ();
41
42
43 static bool
44 BreakpointOptionsCallbackFunction (void *baton,
45 StoppointCallbackContext *context,
46 lldb::user_id_t break_id,
47 lldb::user_id_t break_loc_id);
48};
49
50//-------------------------------------------------------------------------
51// CommandObjectBreakpointCommandAdd
52//-------------------------------------------------------------------------
53
54
55class CommandObjectBreakpointCommandAdd : public CommandObject
56{
57public:
58
59 CommandObjectBreakpointCommandAdd ();
60
61 virtual
62 ~CommandObjectBreakpointCommandAdd ();
63
64 virtual bool
Greg Clayton63094e02010-06-23 01:19:29 +000065 Execute (CommandInterpreter &interpreter,
66 Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +000067 CommandReturnObject &result);
68
69 virtual Options *
70 GetOptions ();
71
72 void
Greg Clayton63094e02010-06-23 01:19:29 +000073 CollectDataForBreakpointCommandCallback (CommandInterpreter &interpreter,
74 BreakpointOptions *bp_options,
Chris Lattner24943d22010-06-08 16:52:24 +000075 CommandReturnObject &result);
76
Johnny Chen3e0571b2010-09-11 00:23:59 +000077 /// Set a one-liner as the callback for the breakpoint.
Johnny Chenb81ed0d2010-09-11 00:18:09 +000078 void
79 SetBreakpointCommandCallback (CommandInterpreter &interpreter,
80 BreakpointOptions *bp_options,
81 const char *oneliner);
82
Chris Lattner24943d22010-06-08 16:52:24 +000083 static size_t
84 GenerateBreakpointCommandCallback (void *baton,
Greg Clayton63094e02010-06-23 01:19:29 +000085 InputReader &reader,
Chris Lattner24943d22010-06-08 16:52:24 +000086 lldb::InputReaderAction notification,
87 const char *bytes,
88 size_t bytes_len);
89
90 static bool
91 BreakpointOptionsCallbackFunction (void *baton,
92 StoppointCallbackContext *context,
93 lldb::user_id_t break_id,
94 lldb::user_id_t break_loc_id);
95
96
97 class CommandOptions : public Options
98 {
99 public:
100
101 CommandOptions ();
102
103 virtual
104 ~CommandOptions ();
105
106 virtual Error
107 SetOptionValue (int option_idx, const char *option_arg);
108
109 void
110 ResetOptionValues ();
111
112 const lldb::OptionDefinition*
113 GetDefinitions ();
114
115 // Options table: Required for subclasses of Options.
116
117 static lldb::OptionDefinition g_option_table[];
118
119 // Instance variables to hold the values for command options.
120
121 bool m_use_commands;
122 bool m_use_script_language;
123 lldb::ScriptLanguage m_script_language;
Johnny Chenb81ed0d2010-09-11 00:18:09 +0000124
125 // Instance variables to hold the values for one_liner options.
126 bool m_use_one_liner;
127 std::string m_one_liner;
Chris Lattner24943d22010-06-08 16:52:24 +0000128 };
129
130private:
131 CommandOptions m_options;
132};
133
134//-------------------------------------------------------------------------
135// CommandObjectBreakpointCommandRemove
136//-------------------------------------------------------------------------
137
138class CommandObjectBreakpointCommandRemove : public CommandObject
139{
140public:
141 CommandObjectBreakpointCommandRemove ();
142
143 virtual
144 ~CommandObjectBreakpointCommandRemove ();
145
146 virtual bool
Greg Clayton63094e02010-06-23 01:19:29 +0000147 Execute (CommandInterpreter &interpreter,
148 Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000149 CommandReturnObject &result);
150
151private:
152};
153
154//-------------------------------------------------------------------------
155// CommandObjectBreakpointCommandList
156//-------------------------------------------------------------------------
157
158class CommandObjectBreakpointCommandList : public CommandObject
159{
160public:
161 CommandObjectBreakpointCommandList ();
162
163 virtual
164 ~CommandObjectBreakpointCommandList ();
165
166 virtual bool
Greg Clayton63094e02010-06-23 01:19:29 +0000167 Execute (CommandInterpreter &interpreter,
168 Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000169 CommandReturnObject &result);
170
171private:
172};
173
174
175} // namespace lldb_private
176
177#endif // liblldb_CommandObjectBreakpointCommand_h_