Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 1 | //===-- CommandObjectFrame.cpp ----------------------------------*- 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 | #include "CommandObjectFrame.h" |
| 11 | |
| 12 | // C Includes |
| 13 | // C++ Includes |
Johnny Chen | 10b12b3 | 2011-09-16 21:41:42 +0000 | [diff] [blame] | 14 | #include <string> |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 15 | // Other libraries and framework includes |
| 16 | // Project includes |
Enrico Granata | 0be2e9b | 2011-08-22 22:03:47 +0000 | [diff] [blame] | 17 | #include "lldb/Core/DataVisualization.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 18 | #include "lldb/Core/Debugger.h" |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 19 | #include "lldb/Core/Module.h" |
| 20 | #include "lldb/Core/StreamFile.h" |
Johnny Chen | 10b12b3 | 2011-09-16 21:41:42 +0000 | [diff] [blame] | 21 | #include "lldb/Core/StreamString.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 22 | #include "lldb/Core/Timer.h" |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 23 | #include "lldb/Core/Value.h" |
| 24 | #include "lldb/Core/ValueObject.h" |
| 25 | #include "lldb/Core/ValueObjectVariable.h" |
Greg Clayton | cd54803 | 2011-02-01 01:31:41 +0000 | [diff] [blame] | 26 | #include "lldb/Host/Host.h" |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 27 | #include "lldb/Interpreter/Args.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 28 | #include "lldb/Interpreter/CommandInterpreter.h" |
| 29 | #include "lldb/Interpreter/CommandReturnObject.h" |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 30 | #include "lldb/Interpreter/Options.h" |
Greg Clayton | a42880a | 2011-10-25 06:44:01 +0000 | [diff] [blame] | 31 | #include "lldb/Interpreter/OptionGroupFormat.h" |
Jim Ingham | 10de7d1 | 2011-05-04 03:43:18 +0000 | [diff] [blame] | 32 | #include "lldb/Interpreter/OptionGroupValueObjectDisplay.h" |
Greg Clayton | 368f822 | 2011-07-07 04:38:25 +0000 | [diff] [blame] | 33 | #include "lldb/Interpreter/OptionGroupVariable.h" |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 34 | #include "lldb/Symbol/ClangASTType.h" |
| 35 | #include "lldb/Symbol/ClangASTContext.h" |
| 36 | #include "lldb/Symbol/ObjectFile.h" |
| 37 | #include "lldb/Symbol/SymbolContext.h" |
| 38 | #include "lldb/Symbol/Type.h" |
| 39 | #include "lldb/Symbol/Variable.h" |
| 40 | #include "lldb/Symbol/VariableList.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 41 | #include "lldb/Target/Process.h" |
| 42 | #include "lldb/Target/StackFrame.h" |
| 43 | #include "lldb/Target/Thread.h" |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 44 | #include "lldb/Target/Target.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 45 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 46 | using namespace lldb; |
| 47 | using namespace lldb_private; |
| 48 | |
| 49 | #pragma mark CommandObjectFrameInfo |
| 50 | |
| 51 | //------------------------------------------------------------------------- |
| 52 | // CommandObjectFrameInfo |
| 53 | //------------------------------------------------------------------------- |
| 54 | |
| 55 | class CommandObjectFrameInfo : public CommandObject |
| 56 | { |
| 57 | public: |
| 58 | |
Greg Clayton | 238c0a1 | 2010-09-18 01:14:36 +0000 | [diff] [blame] | 59 | CommandObjectFrameInfo (CommandInterpreter &interpreter) : |
| 60 | CommandObject (interpreter, |
| 61 | "frame info", |
| 62 | "List information about the currently selected frame in the current thread.", |
| 63 | "frame info", |
| 64 | eFlagProcessMustBeLaunched | eFlagProcessMustBePaused) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 65 | { |
| 66 | } |
| 67 | |
| 68 | ~CommandObjectFrameInfo () |
| 69 | { |
| 70 | } |
| 71 | |
| 72 | bool |
Greg Clayton | 238c0a1 | 2010-09-18 01:14:36 +0000 | [diff] [blame] | 73 | Execute (Args& command, |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 74 | CommandReturnObject &result) |
| 75 | { |
Greg Clayton | b72d0f0 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 76 | ExecutionContext exe_ctx(m_interpreter.GetExecutionContext()); |
Greg Clayton | 567e7f3 | 2011-09-22 04:58:26 +0000 | [diff] [blame] | 77 | StackFrame *frame = exe_ctx.GetFramePtr(); |
| 78 | if (frame) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 79 | { |
Greg Clayton | 567e7f3 | 2011-09-22 04:58:26 +0000 | [diff] [blame] | 80 | frame->DumpUsingSettingsFormat (&result.GetOutputStream()); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 81 | result.SetStatus (eReturnStatusSuccessFinishResult); |
| 82 | } |
| 83 | else |
| 84 | { |
| 85 | result.AppendError ("no current frame"); |
| 86 | result.SetStatus (eReturnStatusFailed); |
| 87 | } |
| 88 | return result.Succeeded(); |
| 89 | } |
| 90 | }; |
| 91 | |
| 92 | #pragma mark CommandObjectFrameSelect |
| 93 | |
| 94 | //------------------------------------------------------------------------- |
| 95 | // CommandObjectFrameSelect |
| 96 | //------------------------------------------------------------------------- |
| 97 | |
| 98 | class CommandObjectFrameSelect : public CommandObject |
| 99 | { |
| 100 | public: |
| 101 | |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 102 | class CommandOptions : public Options |
| 103 | { |
| 104 | public: |
| 105 | |
Greg Clayton | f15996e | 2011-04-07 22:46:35 +0000 | [diff] [blame] | 106 | CommandOptions (CommandInterpreter &interpreter) : |
Johnny Chen | 9335643 | 2011-04-08 22:39:17 +0000 | [diff] [blame] | 107 | Options(interpreter) |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 108 | { |
Greg Clayton | 143fcc3 | 2011-04-13 00:18:08 +0000 | [diff] [blame] | 109 | OptionParsingStarting (); |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 110 | } |
| 111 | |
| 112 | virtual |
| 113 | ~CommandOptions () |
| 114 | { |
| 115 | } |
| 116 | |
| 117 | virtual Error |
Greg Clayton | 143fcc3 | 2011-04-13 00:18:08 +0000 | [diff] [blame] | 118 | SetOptionValue (uint32_t option_idx, const char *option_arg) |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 119 | { |
| 120 | Error error; |
| 121 | bool success = false; |
| 122 | char short_option = (char) m_getopt_table[option_idx].val; |
| 123 | switch (short_option) |
| 124 | { |
| 125 | case 'r': |
| 126 | relative_frame_offset = Args::StringToSInt32 (option_arg, INT32_MIN, 0, &success); |
| 127 | if (!success) |
Greg Clayton | 9c23673 | 2011-10-26 00:56:27 +0000 | [diff] [blame] | 128 | error.SetErrorStringWithFormat ("invalid frame offset argument '%s'", option_arg); |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 129 | break; |
| 130 | |
| 131 | default: |
Greg Clayton | 9c23673 | 2011-10-26 00:56:27 +0000 | [diff] [blame] | 132 | error.SetErrorStringWithFormat ("invalid short option character '%c'", short_option); |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 133 | break; |
| 134 | } |
| 135 | |
| 136 | return error; |
| 137 | } |
| 138 | |
| 139 | void |
Greg Clayton | 143fcc3 | 2011-04-13 00:18:08 +0000 | [diff] [blame] | 140 | OptionParsingStarting () |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 141 | { |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 142 | relative_frame_offset = INT32_MIN; |
| 143 | } |
| 144 | |
Greg Clayton | b344843 | 2011-03-24 21:19:54 +0000 | [diff] [blame] | 145 | const OptionDefinition* |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 146 | GetDefinitions () |
| 147 | { |
| 148 | return g_option_table; |
| 149 | } |
| 150 | |
| 151 | // Options table: Required for subclasses of Options. |
| 152 | |
Greg Clayton | b344843 | 2011-03-24 21:19:54 +0000 | [diff] [blame] | 153 | static OptionDefinition g_option_table[]; |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 154 | int32_t relative_frame_offset; |
| 155 | }; |
| 156 | |
Greg Clayton | 238c0a1 | 2010-09-18 01:14:36 +0000 | [diff] [blame] | 157 | CommandObjectFrameSelect (CommandInterpreter &interpreter) : |
| 158 | CommandObject (interpreter, |
| 159 | "frame select", |
| 160 | "Select a frame by index from within the current thread and make it the current frame.", |
Caroline Tice | 43b014a | 2010-10-04 22:28:36 +0000 | [diff] [blame] | 161 | NULL, |
Greg Clayton | f15996e | 2011-04-07 22:46:35 +0000 | [diff] [blame] | 162 | eFlagProcessMustBeLaunched | eFlagProcessMustBePaused), |
| 163 | m_options (interpreter) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 164 | { |
Caroline Tice | 43b014a | 2010-10-04 22:28:36 +0000 | [diff] [blame] | 165 | CommandArgumentEntry arg; |
| 166 | CommandArgumentData index_arg; |
| 167 | |
| 168 | // Define the first (and only) variant of this arg. |
| 169 | index_arg.arg_type = eArgTypeFrameIndex; |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 170 | index_arg.arg_repetition = eArgRepeatOptional; |
Caroline Tice | 43b014a | 2010-10-04 22:28:36 +0000 | [diff] [blame] | 171 | |
| 172 | // There is only one variant this argument could be; put it into the argument entry. |
| 173 | arg.push_back (index_arg); |
| 174 | |
| 175 | // Push the data for the first argument into the m_arguments vector. |
| 176 | m_arguments.push_back (arg); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 177 | } |
| 178 | |
| 179 | ~CommandObjectFrameSelect () |
| 180 | { |
| 181 | } |
| 182 | |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 183 | virtual |
| 184 | Options * |
| 185 | GetOptions () |
| 186 | { |
| 187 | return &m_options; |
| 188 | } |
| 189 | |
| 190 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 191 | bool |
Greg Clayton | 238c0a1 | 2010-09-18 01:14:36 +0000 | [diff] [blame] | 192 | Execute (Args& command, |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 193 | CommandReturnObject &result) |
| 194 | { |
Greg Clayton | b72d0f0 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 195 | ExecutionContext exe_ctx (m_interpreter.GetExecutionContext()); |
Greg Clayton | 567e7f3 | 2011-09-22 04:58:26 +0000 | [diff] [blame] | 196 | Thread *thread = exe_ctx.GetThreadPtr(); |
| 197 | if (thread) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 198 | { |
Greg Clayton | 567e7f3 | 2011-09-22 04:58:26 +0000 | [diff] [blame] | 199 | const uint32_t num_frames = thread->GetStackFrameCount(); |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 200 | uint32_t frame_idx = UINT32_MAX; |
| 201 | if (m_options.relative_frame_offset != INT32_MIN) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 202 | { |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 203 | // The one and only argument is a signed relative frame index |
Greg Clayton | 567e7f3 | 2011-09-22 04:58:26 +0000 | [diff] [blame] | 204 | frame_idx = thread->GetSelectedFrameIndex (); |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 205 | if (frame_idx == UINT32_MAX) |
| 206 | frame_idx = 0; |
| 207 | |
| 208 | if (m_options.relative_frame_offset < 0) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 209 | { |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 210 | if (frame_idx >= -m_options.relative_frame_offset) |
| 211 | frame_idx += m_options.relative_frame_offset; |
| 212 | else |
Jim Ingham | d9fa9d7 | 2011-09-08 01:15:09 +0000 | [diff] [blame] | 213 | { |
| 214 | if (frame_idx == 0) |
| 215 | { |
| 216 | //If you are already at the bottom of the stack, then just warn and don't reset the frame. |
| 217 | result.AppendError("Already at the bottom of the stack"); |
| 218 | result.SetStatus(eReturnStatusFailed); |
| 219 | return false; |
| 220 | } |
| 221 | else |
| 222 | frame_idx = 0; |
| 223 | } |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 224 | } |
| 225 | else if (m_options.relative_frame_offset > 0) |
| 226 | { |
| 227 | if (num_frames - frame_idx > m_options.relative_frame_offset) |
| 228 | frame_idx += m_options.relative_frame_offset; |
| 229 | else |
Jim Ingham | d9fa9d7 | 2011-09-08 01:15:09 +0000 | [diff] [blame] | 230 | { |
| 231 | if (frame_idx == num_frames - 1) |
| 232 | { |
| 233 | //If we are already at the top of the stack, just warn and don't reset the frame. |
| 234 | result.AppendError("Already at the top of the stack"); |
| 235 | result.SetStatus(eReturnStatusFailed); |
| 236 | return false; |
| 237 | } |
| 238 | else |
| 239 | frame_idx = num_frames - 1; |
| 240 | } |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 241 | } |
| 242 | } |
| 243 | else |
| 244 | { |
| 245 | if (command.GetArgumentCount() == 1) |
| 246 | { |
| 247 | const char *frame_idx_cstr = command.GetArgumentAtIndex(0); |
| 248 | frame_idx = Args::StringToUInt32 (frame_idx_cstr, UINT32_MAX, 0); |
| 249 | } |
Jason Molenda | 7685ccc | 2011-09-30 23:12:14 +0000 | [diff] [blame] | 250 | else if (command.GetArgumentCount() == 0) |
Jason Molenda | 811ded5 | 2011-09-29 23:02:41 +0000 | [diff] [blame] | 251 | { |
| 252 | frame_idx = thread->GetSelectedFrameIndex (); |
| 253 | if (frame_idx == UINT32_MAX) |
Jason Molenda | 7685ccc | 2011-09-30 23:12:14 +0000 | [diff] [blame] | 254 | { |
Jason Molenda | 811ded5 | 2011-09-29 23:02:41 +0000 | [diff] [blame] | 255 | frame_idx = 0; |
Jason Molenda | 7685ccc | 2011-09-30 23:12:14 +0000 | [diff] [blame] | 256 | } |
Jason Molenda | 811ded5 | 2011-09-29 23:02:41 +0000 | [diff] [blame] | 257 | } |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 258 | else |
| 259 | { |
| 260 | result.AppendError ("invalid arguments.\n"); |
Greg Clayton | f15996e | 2011-04-07 22:46:35 +0000 | [diff] [blame] | 261 | m_options.GenerateOptionUsage (result.GetErrorStream(), this); |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 262 | } |
| 263 | } |
| 264 | |
| 265 | if (frame_idx < num_frames) |
| 266 | { |
Greg Clayton | 567e7f3 | 2011-09-22 04:58:26 +0000 | [diff] [blame] | 267 | thread->SetSelectedFrameByIndex (frame_idx); |
| 268 | exe_ctx.SetFrameSP(thread->GetSelectedFrame ()); |
| 269 | StackFrame *frame = exe_ctx.GetFramePtr(); |
| 270 | if (frame) |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 271 | { |
| 272 | bool already_shown = false; |
Greg Clayton | 567e7f3 | 2011-09-22 04:58:26 +0000 | [diff] [blame] | 273 | SymbolContext frame_sc(frame->GetSymbolContext(eSymbolContextLineEntry)); |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 274 | if (m_interpreter.GetDebugger().GetUseExternalEditor() && frame_sc.line_entry.file && frame_sc.line_entry.line != 0) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 275 | { |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 276 | already_shown = Host::OpenFileInExternalEditor (frame_sc.line_entry.file, frame_sc.line_entry.line); |
| 277 | } |
Jim Ingham | 74989e8 | 2010-08-30 19:44:40 +0000 | [diff] [blame] | 278 | |
Greg Clayton | abe0fed | 2011-04-18 08:33:37 +0000 | [diff] [blame] | 279 | bool show_frame_info = true; |
| 280 | bool show_source = !already_shown; |
| 281 | uint32_t source_lines_before = 3; |
| 282 | uint32_t source_lines_after = 3; |
Greg Clayton | 567e7f3 | 2011-09-22 04:58:26 +0000 | [diff] [blame] | 283 | if (frame->GetStatus (result.GetOutputStream(), |
| 284 | show_frame_info, |
| 285 | show_source, |
| 286 | source_lines_before, |
| 287 | source_lines_after)) |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 288 | { |
| 289 | result.SetStatus (eReturnStatusSuccessFinishResult); |
| 290 | return result.Succeeded(); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 291 | } |
| 292 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 293 | } |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 294 | result.AppendErrorWithFormat ("Frame index (%u) out of range.\n", frame_idx); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 295 | } |
| 296 | else |
| 297 | { |
| 298 | result.AppendError ("no current thread"); |
| 299 | } |
| 300 | result.SetStatus (eReturnStatusFailed); |
| 301 | return false; |
| 302 | } |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 303 | protected: |
| 304 | |
| 305 | CommandOptions m_options; |
| 306 | }; |
| 307 | |
Greg Clayton | b344843 | 2011-03-24 21:19:54 +0000 | [diff] [blame] | 308 | OptionDefinition |
Greg Clayton | c12b6b4 | 2010-10-10 22:28:11 +0000 | [diff] [blame] | 309 | CommandObjectFrameSelect::CommandOptions::g_option_table[] = |
| 310 | { |
| 311 | { LLDB_OPT_SET_1, false, "relative", 'r', required_argument, NULL, 0, eArgTypeOffset, "A relative frame index offset from the current frame index."}, |
| 312 | { 0, false, NULL, 0, 0, NULL, NULL, eArgTypeNone, NULL } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 313 | }; |
| 314 | |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 315 | #pragma mark CommandObjectFrameVariable |
| 316 | //---------------------------------------------------------------------- |
| 317 | // List images with associated information |
| 318 | //---------------------------------------------------------------------- |
| 319 | class CommandObjectFrameVariable : public CommandObject |
| 320 | { |
| 321 | public: |
| 322 | |
Greg Clayton | 238c0a1 | 2010-09-18 01:14:36 +0000 | [diff] [blame] | 323 | CommandObjectFrameVariable (CommandInterpreter &interpreter) : |
| 324 | CommandObject (interpreter, |
| 325 | "frame variable", |
Greg Clayton | fe424a9 | 2010-09-18 03:37:20 +0000 | [diff] [blame] | 326 | "Show frame variables. All argument and local variables " |
| 327 | "that are in scope will be shown when no arguments are given. " |
| 328 | "If any arguments are specified, they can be names of " |
Johnny Chen | 17a661c | 2010-10-25 23:57:26 +0000 | [diff] [blame] | 329 | "argument, local, file static and file global variables. " |
Greg Clayton | fe424a9 | 2010-09-18 03:37:20 +0000 | [diff] [blame] | 330 | "Children of aggregate variables can be specified such as " |
Johnny Chen | 2b05e29 | 2012-02-14 22:00:40 +0000 | [diff] [blame] | 331 | "'var->child.x'.", |
Jim Ingham | a7a9c89 | 2010-12-23 02:17:54 +0000 | [diff] [blame] | 332 | NULL, |
Greg Clayton | f15996e | 2011-04-07 22:46:35 +0000 | [diff] [blame] | 333 | eFlagProcessMustBeLaunched | eFlagProcessMustBePaused), |
Jim Ingham | 10de7d1 | 2011-05-04 03:43:18 +0000 | [diff] [blame] | 334 | m_option_group (interpreter), |
Greg Clayton | 368f822 | 2011-07-07 04:38:25 +0000 | [diff] [blame] | 335 | m_option_variable(true), // Include the frame specific options by passing "true" |
Greg Clayton | a42880a | 2011-10-25 06:44:01 +0000 | [diff] [blame] | 336 | m_option_format (eFormatDefault), |
Jim Ingham | 10de7d1 | 2011-05-04 03:43:18 +0000 | [diff] [blame] | 337 | m_varobj_options() |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 338 | { |
Caroline Tice | 43b014a | 2010-10-04 22:28:36 +0000 | [diff] [blame] | 339 | CommandArgumentEntry arg; |
| 340 | CommandArgumentData var_name_arg; |
| 341 | |
| 342 | // Define the first (and only) variant of this arg. |
| 343 | var_name_arg.arg_type = eArgTypeVarName; |
| 344 | var_name_arg.arg_repetition = eArgRepeatStar; |
| 345 | |
| 346 | // There is only one variant this argument could be; put it into the argument entry. |
| 347 | arg.push_back (var_name_arg); |
| 348 | |
| 349 | // Push the data for the first argument into the m_arguments vector. |
| 350 | m_arguments.push_back (arg); |
Jim Ingham | 10de7d1 | 2011-05-04 03:43:18 +0000 | [diff] [blame] | 351 | |
Greg Clayton | 368f822 | 2011-07-07 04:38:25 +0000 | [diff] [blame] | 352 | m_option_group.Append (&m_option_variable, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1); |
Greg Clayton | 24a6bd9 | 2011-10-27 17:55:14 +0000 | [diff] [blame] | 353 | m_option_group.Append (&m_option_format, OptionGroupFormat::OPTION_GROUP_FORMAT | OptionGroupFormat::OPTION_GROUP_GDB_FMT, LLDB_OPT_SET_1); |
Jim Ingham | 10de7d1 | 2011-05-04 03:43:18 +0000 | [diff] [blame] | 354 | m_option_group.Append (&m_varobj_options, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1); |
| 355 | m_option_group.Finalize(); |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 356 | } |
| 357 | |
| 358 | virtual |
| 359 | ~CommandObjectFrameVariable () |
| 360 | { |
| 361 | } |
| 362 | |
| 363 | virtual |
| 364 | Options * |
| 365 | GetOptions () |
| 366 | { |
Jim Ingham | 10de7d1 | 2011-05-04 03:43:18 +0000 | [diff] [blame] | 367 | return &m_option_group; |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 368 | } |
| 369 | |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 370 | |
| 371 | virtual bool |
| 372 | Execute |
| 373 | ( |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 374 | Args& command, |
| 375 | CommandReturnObject &result |
| 376 | ) |
| 377 | { |
Greg Clayton | b72d0f0 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 378 | ExecutionContext exe_ctx(m_interpreter.GetExecutionContext()); |
Greg Clayton | 567e7f3 | 2011-09-22 04:58:26 +0000 | [diff] [blame] | 379 | StackFrame *frame = exe_ctx.GetFramePtr(); |
| 380 | if (frame == NULL) |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 381 | { |
Greg Clayton | aa44805 | 2010-09-18 04:06:15 +0000 | [diff] [blame] | 382 | result.AppendError ("you must be stopped in a valid stack frame to view frame variables."); |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 383 | result.SetStatus (eReturnStatusFailed); |
| 384 | return false; |
| 385 | } |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 386 | |
| 387 | Stream &s = result.GetOutputStream(); |
| 388 | |
| 389 | bool get_file_globals = true; |
| 390 | |
| 391 | // Be careful about the stack frame, if any summary formatter runs code, it might clear the StackFrameList |
| 392 | // for the thread. So hold onto a shared pointer to the frame so it stays alive. |
| 393 | |
Greg Clayton | 567e7f3 | 2011-09-22 04:58:26 +0000 | [diff] [blame] | 394 | VariableList *variable_list = frame->GetVariableList (get_file_globals); |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 395 | |
| 396 | VariableSP var_sp; |
| 397 | ValueObjectSP valobj_sp; |
| 398 | |
| 399 | const char *name_cstr = NULL; |
| 400 | size_t idx; |
| 401 | |
Enrico Granata | 16376ed | 2012-02-15 02:34:21 +0000 | [diff] [blame] | 402 | TypeSummaryImplSP summary_format_sp; |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 403 | if (!m_option_variable.summary.empty()) |
| 404 | DataVisualization::NamedSummaryFormats::GetSummaryFormat(ConstString(m_option_variable.summary.c_str()), summary_format_sp); |
| 405 | |
| 406 | ValueObject::DumpValueObjectOptions options; |
| 407 | |
| 408 | options.SetPointerDepth(m_varobj_options.ptr_depth) |
| 409 | .SetMaximumDepth(m_varobj_options.max_depth) |
| 410 | .SetShowTypes(m_varobj_options.show_types) |
| 411 | .SetShowLocation(m_varobj_options.show_location) |
| 412 | .SetUseObjectiveC(m_varobj_options.use_objc) |
| 413 | .SetUseDynamicType(m_varobj_options.use_dynamic) |
| 414 | .SetUseSyntheticValue((lldb::SyntheticValueType)m_varobj_options.use_synth) |
| 415 | .SetFlatOutput(m_varobj_options.flat_output) |
| 416 | .SetOmitSummaryDepth(m_varobj_options.no_summary_depth) |
| 417 | .SetIgnoreCap(m_varobj_options.ignore_cap); |
| 418 | |
| 419 | if (m_varobj_options.be_raw) |
| 420 | options.SetRawDisplay(true); |
| 421 | |
| 422 | if (variable_list) |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 423 | { |
Greg Clayton | a42880a | 2011-10-25 06:44:01 +0000 | [diff] [blame] | 424 | const Format format = m_option_format.GetFormat(); |
| 425 | |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 426 | if (command.GetArgumentCount() > 0) |
| 427 | { |
| 428 | VariableList regex_var_list; |
| 429 | |
| 430 | // If we have any args to the variable command, we will make |
| 431 | // variable objects from them... |
| 432 | for (idx = 0; (name_cstr = command.GetArgumentAtIndex(idx)) != NULL; ++idx) |
| 433 | { |
| 434 | if (m_option_variable.use_regex) |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 435 | { |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 436 | const uint32_t regex_start_index = regex_var_list.GetSize(); |
| 437 | RegularExpression regex (name_cstr); |
| 438 | if (regex.Compile(name_cstr)) |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 439 | { |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 440 | size_t num_matches = 0; |
| 441 | const size_t num_new_regex_vars = variable_list->AppendVariablesIfUnique(regex, |
| 442 | regex_var_list, |
| 443 | num_matches); |
| 444 | if (num_new_regex_vars > 0) |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 445 | { |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 446 | for (uint32_t regex_idx = regex_start_index, end_index = regex_var_list.GetSize(); |
| 447 | regex_idx < end_index; |
| 448 | ++regex_idx) |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 449 | { |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 450 | var_sp = regex_var_list.GetVariableAtIndex (regex_idx); |
| 451 | if (var_sp) |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 452 | { |
Greg Clayton | 567e7f3 | 2011-09-22 04:58:26 +0000 | [diff] [blame] | 453 | valobj_sp = frame->GetValueObjectForFrameVariable (var_sp, m_varobj_options.use_dynamic); |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 454 | if (valobj_sp) |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 455 | { |
Greg Clayton | ccf4450 | 2012-01-26 21:08:30 +0000 | [diff] [blame] | 456 | // if (format != eFormatDefault) |
| 457 | // valobj_sp->SetFormat (format); |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 458 | |
| 459 | if (m_option_variable.show_decl && var_sp->GetDeclaration ().GetFile()) |
| 460 | { |
| 461 | bool show_fullpaths = false; |
| 462 | bool show_module = true; |
| 463 | if (var_sp->DumpDeclaration(&s, show_fullpaths, show_module)) |
| 464 | s.PutCString (": "); |
Greg Clayton | 6bc0b5d | 2010-10-10 23:55:27 +0000 | [diff] [blame] | 465 | } |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 466 | if (summary_format_sp) |
| 467 | valobj_sp->SetCustomSummaryFormat(summary_format_sp); |
| 468 | ValueObject::DumpValueObject (result.GetOutputStream(), |
| 469 | valobj_sp.get(), |
Greg Clayton | ccf4450 | 2012-01-26 21:08:30 +0000 | [diff] [blame] | 470 | options, |
| 471 | format); |
Greg Clayton | 6bc0b5d | 2010-10-10 23:55:27 +0000 | [diff] [blame] | 472 | } |
| 473 | } |
| 474 | } |
Greg Clayton | 6bc0b5d | 2010-10-10 23:55:27 +0000 | [diff] [blame] | 475 | } |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 476 | else if (num_matches == 0) |
Greg Clayton | 6bc0b5d | 2010-10-10 23:55:27 +0000 | [diff] [blame] | 477 | { |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 478 | result.GetErrorStream().Printf ("error: no variables matched the regular expression '%s'.\n", name_cstr); |
Greg Clayton | 6bc0b5d | 2010-10-10 23:55:27 +0000 | [diff] [blame] | 479 | } |
| 480 | } |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 481 | else |
Greg Clayton | 6bc0b5d | 2010-10-10 23:55:27 +0000 | [diff] [blame] | 482 | { |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 483 | char regex_error[1024]; |
| 484 | if (regex.GetErrorAsCString(regex_error, sizeof(regex_error))) |
| 485 | result.GetErrorStream().Printf ("error: %s\n", regex_error); |
Greg Clayton | 6bc0b5d | 2010-10-10 23:55:27 +0000 | [diff] [blame] | 486 | else |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 487 | result.GetErrorStream().Printf ("error: unkown regex error when compiling '%s'\n", name_cstr); |
| 488 | } |
| 489 | } |
| 490 | else // No regex, either exact variable names or variable expressions. |
| 491 | { |
| 492 | Error error; |
| 493 | uint32_t expr_path_options = StackFrame::eExpressionPathOptionCheckPtrVsMember; |
| 494 | lldb::VariableSP var_sp; |
Greg Clayton | 567e7f3 | 2011-09-22 04:58:26 +0000 | [diff] [blame] | 495 | valobj_sp = frame->GetValueForVariableExpressionPath (name_cstr, |
| 496 | m_varobj_options.use_dynamic, |
| 497 | expr_path_options, |
| 498 | var_sp, |
| 499 | error); |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 500 | if (valobj_sp) |
| 501 | { |
Greg Clayton | ccf4450 | 2012-01-26 21:08:30 +0000 | [diff] [blame] | 502 | // if (format != eFormatDefault) |
| 503 | // valobj_sp->SetFormat (format); |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 504 | if (m_option_variable.show_decl && var_sp && var_sp->GetDeclaration ().GetFile()) |
Greg Clayton | 6bc0b5d | 2010-10-10 23:55:27 +0000 | [diff] [blame] | 505 | { |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 506 | var_sp->GetDeclaration ().DumpStopContext (&s, false); |
| 507 | s.PutCString (": "); |
Greg Clayton | 6bc0b5d | 2010-10-10 23:55:27 +0000 | [diff] [blame] | 508 | } |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 509 | if (summary_format_sp) |
| 510 | valobj_sp->SetCustomSummaryFormat(summary_format_sp); |
| 511 | |
| 512 | Stream &output_stream = result.GetOutputStream(); |
| 513 | ValueObject::DumpValueObject (output_stream, |
| 514 | valobj_sp.get(), |
| 515 | valobj_sp->GetParent() ? name_cstr : NULL, |
Greg Clayton | ccf4450 | 2012-01-26 21:08:30 +0000 | [diff] [blame] | 516 | options, |
| 517 | format); |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 518 | } |
| 519 | else |
| 520 | { |
| 521 | const char *error_cstr = error.AsCString(NULL); |
| 522 | if (error_cstr) |
| 523 | result.GetErrorStream().Printf("error: %s\n", error_cstr); |
| 524 | else |
| 525 | result.GetErrorStream().Printf ("error: unable to find any variable expression path that matches '%s'\n", name_cstr); |
Greg Clayton | c0cf52d | 2010-09-13 03:44:33 +0000 | [diff] [blame] | 526 | } |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 527 | } |
| 528 | } |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 529 | } |
| 530 | else // No command arg specified. Use variable_list, instead. |
| 531 | { |
| 532 | const uint32_t num_variables = variable_list->GetSize(); |
| 533 | if (num_variables > 0) |
Greg Clayton | c0cf52d | 2010-09-13 03:44:33 +0000 | [diff] [blame] | 534 | { |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 535 | for (uint32_t i=0; i<num_variables; i++) |
Greg Clayton | c0cf52d | 2010-09-13 03:44:33 +0000 | [diff] [blame] | 536 | { |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 537 | var_sp = variable_list->GetVariableAtIndex(i); |
| 538 | bool dump_variable = true; |
| 539 | switch (var_sp->GetScope()) |
Greg Clayton | c0cf52d | 2010-09-13 03:44:33 +0000 | [diff] [blame] | 540 | { |
Greg Clayton | c0cf52d | 2010-09-13 03:44:33 +0000 | [diff] [blame] | 541 | case eValueTypeVariableGlobal: |
Greg Clayton | 368f822 | 2011-07-07 04:38:25 +0000 | [diff] [blame] | 542 | dump_variable = m_option_variable.show_globals; |
| 543 | if (dump_variable && m_option_variable.show_scope) |
Greg Clayton | c0cf52d | 2010-09-13 03:44:33 +0000 | [diff] [blame] | 544 | s.PutCString("GLOBAL: "); |
| 545 | break; |
| 546 | |
| 547 | case eValueTypeVariableStatic: |
Greg Clayton | 368f822 | 2011-07-07 04:38:25 +0000 | [diff] [blame] | 548 | dump_variable = m_option_variable.show_globals; |
| 549 | if (dump_variable && m_option_variable.show_scope) |
Greg Clayton | c0cf52d | 2010-09-13 03:44:33 +0000 | [diff] [blame] | 550 | s.PutCString("STATIC: "); |
| 551 | break; |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 552 | |
Greg Clayton | c0cf52d | 2010-09-13 03:44:33 +0000 | [diff] [blame] | 553 | case eValueTypeVariableArgument: |
Greg Clayton | 368f822 | 2011-07-07 04:38:25 +0000 | [diff] [blame] | 554 | dump_variable = m_option_variable.show_args; |
| 555 | if (dump_variable && m_option_variable.show_scope) |
Greg Clayton | c0cf52d | 2010-09-13 03:44:33 +0000 | [diff] [blame] | 556 | s.PutCString(" ARG: "); |
| 557 | break; |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 558 | |
Greg Clayton | c0cf52d | 2010-09-13 03:44:33 +0000 | [diff] [blame] | 559 | case eValueTypeVariableLocal: |
Greg Clayton | 368f822 | 2011-07-07 04:38:25 +0000 | [diff] [blame] | 560 | dump_variable = m_option_variable.show_locals; |
| 561 | if (dump_variable && m_option_variable.show_scope) |
Greg Clayton | c0cf52d | 2010-09-13 03:44:33 +0000 | [diff] [blame] | 562 | s.PutCString(" LOCAL: "); |
| 563 | break; |
| 564 | |
| 565 | default: |
| 566 | break; |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 567 | } |
Greg Clayton | c0cf52d | 2010-09-13 03:44:33 +0000 | [diff] [blame] | 568 | |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 569 | if (dump_variable) |
| 570 | { |
| 571 | // Use the variable object code to make sure we are |
| 572 | // using the same APIs as the the public API will be |
| 573 | // using... |
Greg Clayton | 567e7f3 | 2011-09-22 04:58:26 +0000 | [diff] [blame] | 574 | valobj_sp = frame->GetValueObjectForFrameVariable (var_sp, |
| 575 | m_varobj_options.use_dynamic); |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 576 | if (valobj_sp) |
| 577 | { |
Greg Clayton | ccf4450 | 2012-01-26 21:08:30 +0000 | [diff] [blame] | 578 | // if (format != eFormatDefault) |
| 579 | // valobj_sp->SetFormat (format); |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 580 | |
| 581 | // When dumping all variables, don't print any variables |
| 582 | // that are not in scope to avoid extra unneeded output |
| 583 | if (valobj_sp->IsInScope ()) |
Greg Clayton | c0cf52d | 2010-09-13 03:44:33 +0000 | [diff] [blame] | 584 | { |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 585 | if (m_option_variable.show_decl && var_sp->GetDeclaration ().GetFile()) |
Greg Clayton | c0cf52d | 2010-09-13 03:44:33 +0000 | [diff] [blame] | 586 | { |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 587 | var_sp->GetDeclaration ().DumpStopContext (&s, false); |
| 588 | s.PutCString (": "); |
Greg Clayton | a357ecf | 2010-09-14 03:16:58 +0000 | [diff] [blame] | 589 | } |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 590 | if (summary_format_sp) |
| 591 | valobj_sp->SetCustomSummaryFormat(summary_format_sp); |
| 592 | ValueObject::DumpValueObject (result.GetOutputStream(), |
| 593 | valobj_sp.get(), |
| 594 | name_cstr, |
Greg Clayton | ccf4450 | 2012-01-26 21:08:30 +0000 | [diff] [blame] | 595 | options, |
| 596 | format); |
Greg Clayton | c0cf52d | 2010-09-13 03:44:33 +0000 | [diff] [blame] | 597 | } |
| 598 | } |
| 599 | } |
| 600 | } |
| 601 | } |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 602 | } |
Johnny Chen | 649d3f1 | 2011-09-12 23:58:53 +0000 | [diff] [blame] | 603 | result.SetStatus (eReturnStatusSuccessFinishResult); |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 604 | } |
Enrico Granata | db64d95 | 2011-08-12 16:42:31 +0000 | [diff] [blame] | 605 | |
| 606 | if (m_interpreter.TruncationWarningNecessary()) |
| 607 | { |
| 608 | result.GetOutputStream().Printf(m_interpreter.TruncationWarningText(), |
| 609 | m_cmd_name.c_str()); |
| 610 | m_interpreter.TruncationWarningGiven(); |
| 611 | } |
| 612 | |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 613 | return result.Succeeded(); |
| 614 | } |
| 615 | protected: |
| 616 | |
Jim Ingham | 10de7d1 | 2011-05-04 03:43:18 +0000 | [diff] [blame] | 617 | OptionGroupOptions m_option_group; |
Greg Clayton | 368f822 | 2011-07-07 04:38:25 +0000 | [diff] [blame] | 618 | OptionGroupVariable m_option_variable; |
Greg Clayton | a42880a | 2011-10-25 06:44:01 +0000 | [diff] [blame] | 619 | OptionGroupFormat m_option_format; |
Jim Ingham | 10de7d1 | 2011-05-04 03:43:18 +0000 | [diff] [blame] | 620 | OptionGroupValueObjectDisplay m_varobj_options; |
Jim Ingham | 537926c | 2010-09-02 00:18:39 +0000 | [diff] [blame] | 621 | }; |
| 622 | |
Jim Ingham | 10de7d1 | 2011-05-04 03:43:18 +0000 | [diff] [blame] | 623 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 624 | #pragma mark CommandObjectMultiwordFrame |
| 625 | |
| 626 | //------------------------------------------------------------------------- |
| 627 | // CommandObjectMultiwordFrame |
| 628 | //------------------------------------------------------------------------- |
| 629 | |
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 630 | CommandObjectMultiwordFrame::CommandObjectMultiwordFrame (CommandInterpreter &interpreter) : |
Greg Clayton | 238c0a1 | 2010-09-18 01:14:36 +0000 | [diff] [blame] | 631 | CommandObjectMultiword (interpreter, |
| 632 | "frame", |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 633 | "A set of commands for operating on the current thread's frames.", |
| 634 | "frame <subcommand> [<subcommand-options>]") |
| 635 | { |
Greg Clayton | 238c0a1 | 2010-09-18 01:14:36 +0000 | [diff] [blame] | 636 | LoadSubCommand ("info", CommandObjectSP (new CommandObjectFrameInfo (interpreter))); |
| 637 | LoadSubCommand ("select", CommandObjectSP (new CommandObjectFrameSelect (interpreter))); |
| 638 | LoadSubCommand ("variable", CommandObjectSP (new CommandObjectFrameVariable (interpreter))); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 639 | } |
| 640 | |
| 641 | CommandObjectMultiwordFrame::~CommandObjectMultiwordFrame () |
| 642 | { |
| 643 | } |
| 644 | |