CommandObjectFrame.cpp revision b344843f75ef893762c93fd0a22d2d45712ce74d
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
14// Other libraries and framework includes
15// Project includes
16#include "lldb/Core/Debugger.h"
17#include "lldb/Core/Module.h"
18#include "lldb/Core/StreamFile.h"
19#include "lldb/Core/Timer.h"
20#include "lldb/Core/Value.h"
21#include "lldb/Core/ValueObject.h"
22#include "lldb/Core/ValueObjectVariable.h"
23#include "lldb/Host/Host.h"
24#include "lldb/Interpreter/Args.h"
25#include "lldb/Interpreter/CommandInterpreter.h"
26#include "lldb/Interpreter/CommandReturnObject.h"
27#include "lldb/Interpreter/Options.h"
28#include "lldb/Symbol/ClangASTType.h"
29#include "lldb/Symbol/ClangASTContext.h"
30#include "lldb/Symbol/ObjectFile.h"
31#include "lldb/Symbol/SymbolContext.h"
32#include "lldb/Symbol/Type.h"
33#include "lldb/Symbol/Variable.h"
34#include "lldb/Symbol/VariableList.h"
35#include "lldb/Target/Process.h"
36#include "lldb/Target/StackFrame.h"
37#include "lldb/Target/Thread.h"
38#include "lldb/Target/Target.h"
39
40#include "CommandObjectThread.h"
41
42using namespace lldb;
43using namespace lldb_private;
44
45#pragma mark CommandObjectFrameInfo
46
47//-------------------------------------------------------------------------
48// CommandObjectFrameInfo
49//-------------------------------------------------------------------------
50
51class CommandObjectFrameInfo : public CommandObject
52{
53public:
54
55    CommandObjectFrameInfo (CommandInterpreter &interpreter) :
56        CommandObject (interpreter,
57                       "frame info",
58                       "List information about the currently selected frame in the current thread.",
59                       "frame info",
60                       eFlagProcessMustBeLaunched | eFlagProcessMustBePaused)
61    {
62    }
63
64    ~CommandObjectFrameInfo ()
65    {
66    }
67
68    bool
69    Execute (Args& command,
70             CommandReturnObject &result)
71    {
72        ExecutionContext exe_ctx(m_interpreter.GetDebugger().GetExecutionContext());
73        if (exe_ctx.frame)
74        {
75            exe_ctx.frame->DumpUsingSettingsFormat (&result.GetOutputStream());
76            result.GetOutputStream().EOL();
77            result.SetStatus (eReturnStatusSuccessFinishResult);
78        }
79        else
80        {
81            result.AppendError ("no current frame");
82            result.SetStatus (eReturnStatusFailed);
83        }
84        return result.Succeeded();
85    }
86};
87
88#pragma mark CommandObjectFrameSelect
89
90//-------------------------------------------------------------------------
91// CommandObjectFrameSelect
92//-------------------------------------------------------------------------
93
94class CommandObjectFrameSelect : public CommandObject
95{
96public:
97
98   class CommandOptions : public Options
99    {
100    public:
101
102        CommandOptions () :
103            Options()
104        {
105            ResetOptionValues ();
106        }
107
108        virtual
109        ~CommandOptions ()
110        {
111        }
112
113        virtual Error
114        SetOptionValue (int option_idx, const char *option_arg)
115        {
116            Error error;
117            bool success = false;
118            char short_option = (char) m_getopt_table[option_idx].val;
119            switch (short_option)
120            {
121            case 'r':
122                relative_frame_offset = Args::StringToSInt32 (option_arg, INT32_MIN, 0, &success);
123                if (!success)
124                    error.SetErrorStringWithFormat ("invalid frame offset argument '%s'.\n", option_arg);
125                break;
126
127            default:
128                error.SetErrorStringWithFormat ("Invalid short option character '%c'.\n", short_option);
129                break;
130            }
131
132            return error;
133        }
134
135        void
136        ResetOptionValues ()
137        {
138            Options::ResetOptionValues();
139            relative_frame_offset = INT32_MIN;
140        }
141
142        const OptionDefinition*
143        GetDefinitions ()
144        {
145            return g_option_table;
146        }
147
148        // Options table: Required for subclasses of Options.
149
150        static OptionDefinition g_option_table[];
151        int32_t relative_frame_offset;
152    };
153
154    CommandObjectFrameSelect (CommandInterpreter &interpreter) :
155        CommandObject (interpreter,
156                       "frame select",
157                       "Select a frame by index from within the current thread and make it the current frame.",
158                       NULL,
159                       eFlagProcessMustBeLaunched | eFlagProcessMustBePaused)
160    {
161        CommandArgumentEntry arg;
162        CommandArgumentData index_arg;
163
164        // Define the first (and only) variant of this arg.
165        index_arg.arg_type = eArgTypeFrameIndex;
166        index_arg.arg_repetition = eArgRepeatOptional;
167
168        // There is only one variant this argument could be; put it into the argument entry.
169        arg.push_back (index_arg);
170
171        // Push the data for the first argument into the m_arguments vector.
172        m_arguments.push_back (arg);
173    }
174
175    ~CommandObjectFrameSelect ()
176    {
177    }
178
179    virtual
180    Options *
181    GetOptions ()
182    {
183        return &m_options;
184    }
185
186
187    bool
188    Execute (Args& command,
189             CommandReturnObject &result)
190    {
191        ExecutionContext exe_ctx (m_interpreter.GetDebugger().GetExecutionContext());
192        if (exe_ctx.thread)
193        {
194            const uint32_t num_frames = exe_ctx.thread->GetStackFrameCount();
195            uint32_t frame_idx = UINT32_MAX;
196            if (m_options.relative_frame_offset != INT32_MIN)
197            {
198                // The one and only argument is a signed relative frame index
199                frame_idx = exe_ctx.thread->GetSelectedFrameIndex ();
200                if (frame_idx == UINT32_MAX)
201                    frame_idx = 0;
202
203                if (m_options.relative_frame_offset < 0)
204                {
205                    if (frame_idx >= -m_options.relative_frame_offset)
206                        frame_idx += m_options.relative_frame_offset;
207                    else
208                        frame_idx = 0;
209                }
210                else if (m_options.relative_frame_offset > 0)
211                {
212                    if (num_frames - frame_idx > m_options.relative_frame_offset)
213                        frame_idx += m_options.relative_frame_offset;
214                    else
215                        frame_idx = num_frames - 1;
216                }
217            }
218            else
219            {
220                if (command.GetArgumentCount() == 1)
221                {
222                    const char *frame_idx_cstr = command.GetArgumentAtIndex(0);
223                    frame_idx = Args::StringToUInt32 (frame_idx_cstr, UINT32_MAX, 0);
224                }
225                else
226                {
227                    result.AppendError ("invalid arguments.\n");
228                    m_options.GenerateOptionUsage (m_interpreter, result.GetErrorStream(), this);
229                }
230            }
231
232            if (frame_idx < num_frames)
233            {
234                exe_ctx.thread->SetSelectedFrameByIndex (frame_idx);
235                exe_ctx.frame = exe_ctx.thread->GetSelectedFrame ().get();
236
237                if (exe_ctx.frame)
238                {
239                    bool already_shown = false;
240                    SymbolContext frame_sc(exe_ctx.frame->GetSymbolContext(eSymbolContextLineEntry));
241                    if (m_interpreter.GetDebugger().GetUseExternalEditor() && frame_sc.line_entry.file && frame_sc.line_entry.line != 0)
242                    {
243                        already_shown = Host::OpenFileInExternalEditor (frame_sc.line_entry.file, frame_sc.line_entry.line);
244                    }
245
246                    if (DisplayFrameForExecutionContext (exe_ctx.thread,
247                                                         exe_ctx.frame,
248                                                         m_interpreter,
249                                                         result.GetOutputStream(),
250                                                         true,
251                                                         !already_shown,
252                                                         3,
253                                                         3))
254                    {
255                        result.SetStatus (eReturnStatusSuccessFinishResult);
256                        return result.Succeeded();
257                    }
258                }
259            }
260            result.AppendErrorWithFormat ("Frame index (%u) out of range.\n", frame_idx);
261        }
262        else
263        {
264            result.AppendError ("no current thread");
265        }
266        result.SetStatus (eReturnStatusFailed);
267        return false;
268    }
269protected:
270
271    CommandOptions m_options;
272};
273
274OptionDefinition
275CommandObjectFrameSelect::CommandOptions::g_option_table[] =
276{
277{ LLDB_OPT_SET_1, false, "relative", 'r', required_argument, NULL, 0, eArgTypeOffset, "A relative frame index offset from the current frame index."},
278{ 0, false, NULL, 0, 0, NULL, NULL, eArgTypeNone, NULL }
279};
280
281#pragma mark CommandObjectFrameVariable
282//----------------------------------------------------------------------
283// List images with associated information
284//----------------------------------------------------------------------
285class CommandObjectFrameVariable : public CommandObject
286{
287public:
288
289    class CommandOptions : public Options
290    {
291    public:
292
293        CommandOptions () :
294            Options()
295        {
296            ResetOptionValues ();
297        }
298
299        virtual
300        ~CommandOptions ()
301        {
302        }
303
304        virtual Error
305        SetOptionValue (int option_idx, const char *option_arg)
306        {
307            Error error;
308            bool success;
309            char short_option = (char) m_getopt_table[option_idx].val;
310            switch (short_option)
311            {
312            case 'o':   use_objc     = true;  break;
313            case 'r':   use_regex    = true;  break;
314            case 'a':   show_args    = false; break;
315            case 'l':   show_locals  = false; break;
316            case 'g':   show_globals = true;  break;
317            case 't':   show_types   = true;  break;
318            case 'y':   show_summary = false; break;
319            case 'L':   show_location= true;  break;
320            case 'c':   show_decl    = true;  break;
321            case 'D':   debug        = true;  break;
322            case 'f':   error = Args::StringToFormat(option_arg, format); break;
323            case 'F':   flat_output  = true;  break;
324            case 'd':
325                max_depth = Args::StringToUInt32 (option_arg, UINT32_MAX, 0, &success);
326                if (!success)
327                    error.SetErrorStringWithFormat("Invalid max depth '%s'.\n", option_arg);
328                break;
329
330            case 'p':
331                ptr_depth = Args::StringToUInt32 (option_arg, 0, 0, &success);
332                if (!success)
333                    error.SetErrorStringWithFormat("Invalid pointer depth '%s'.\n", option_arg);
334                break;
335
336            case 'G':
337                globals.push_back(ConstString (option_arg));
338                break;
339
340            case 's':
341                show_scope = true;
342                break;
343
344            default:
345                error.SetErrorStringWithFormat("Invalid short option character '%c'.\n", short_option);
346                break;
347            }
348
349            return error;
350        }
351
352        void
353        ResetOptionValues ()
354        {
355            Options::ResetOptionValues();
356
357            use_objc      = false;
358            use_regex     = false;
359            show_args     = true;
360            show_locals   = true;
361            show_globals  = false;
362            show_types    = false;
363            show_scope    = false;
364            show_summary  = true;
365            show_location = false;
366            show_decl     = false;
367            debug         = false;
368            flat_output   = false;
369            max_depth     = UINT32_MAX;
370            ptr_depth     = 0;
371            format        = eFormatDefault;
372            globals.clear();
373        }
374
375        const OptionDefinition*
376        GetDefinitions ()
377        {
378            return g_option_table;
379        }
380
381        // Options table: Required for subclasses of Options.
382
383        static OptionDefinition g_option_table[];
384        bool use_objc:1,
385             use_regex:1,
386             show_args:1,
387             show_locals:1,
388             show_globals:1,
389             show_types:1,
390             show_scope:1,
391             show_summary:1,
392             show_location:1,
393             show_decl:1,
394             debug:1,
395             flat_output:1;
396        uint32_t max_depth; // The depth to print when dumping concrete (not pointers) aggreate values
397        uint32_t ptr_depth; // The default depth that is dumped when we find pointers
398        lldb::Format format; // The format to use when dumping variables or children of variables
399        std::vector<ConstString> globals;
400        // Instance variables to hold the values for command options.
401    };
402
403    CommandObjectFrameVariable (CommandInterpreter &interpreter) :
404        CommandObject (interpreter,
405                       "frame variable",
406                       "Show frame variables. All argument and local variables "
407                       "that are in scope will be shown when no arguments are given. "
408                       "If any arguments are specified, they can be names of "
409                       "argument, local, file static and file global variables. "
410                       "Children of aggregate variables can be specified such as "
411                       "'var->child.x'.",
412                       NULL,
413                       eFlagProcessMustBeLaunched | eFlagProcessMustBePaused)
414    {
415        CommandArgumentEntry arg;
416        CommandArgumentData var_name_arg;
417
418        // Define the first (and only) variant of this arg.
419        var_name_arg.arg_type = eArgTypeVarName;
420        var_name_arg.arg_repetition = eArgRepeatStar;
421
422        // There is only one variant this argument could be; put it into the argument entry.
423        arg.push_back (var_name_arg);
424
425        // Push the data for the first argument into the m_arguments vector.
426        m_arguments.push_back (arg);
427    }
428
429    virtual
430    ~CommandObjectFrameVariable ()
431    {
432    }
433
434    virtual
435    Options *
436    GetOptions ()
437    {
438        return &m_options;
439    }
440
441
442    virtual bool
443    Execute
444    (
445        Args& command,
446        CommandReturnObject &result
447    )
448    {
449        ExecutionContext exe_ctx(m_interpreter.GetDebugger().GetExecutionContext());
450        if (exe_ctx.frame == NULL)
451        {
452            result.AppendError ("you must be stopped in a valid stack frame to view frame variables.");
453            result.SetStatus (eReturnStatusFailed);
454            return false;
455        }
456        else
457        {
458            Stream &s = result.GetOutputStream();
459
460            bool get_file_globals = true;
461            VariableList *variable_list = exe_ctx.frame->GetVariableList (get_file_globals);
462
463            VariableSP var_sp;
464            ValueObjectSP valobj_sp;
465            //ValueObjectList &valobj_list = exe_ctx.frame->GetValueObjectList();
466            const char *name_cstr = NULL;
467            size_t idx;
468            if (!m_options.globals.empty())
469            {
470                uint32_t fail_count = 0;
471                if (exe_ctx.target)
472                {
473                    const size_t num_globals = m_options.globals.size();
474                    for (idx = 0; idx < num_globals; ++idx)
475                    {
476                        VariableList global_var_list;
477                        const uint32_t num_matching_globals = exe_ctx.target->GetImages().FindGlobalVariables (m_options.globals[idx], true, UINT32_MAX, global_var_list);
478
479                        if (num_matching_globals == 0)
480                        {
481                            ++fail_count;
482                            result.GetErrorStream().Printf ("error: can't find global variable '%s'\n", m_options.globals[idx].AsCString());
483                        }
484                        else
485                        {
486                            for (uint32_t global_idx=0; global_idx<num_matching_globals; ++global_idx)
487                            {
488                                var_sp = global_var_list.GetVariableAtIndex(global_idx);
489                                if (var_sp)
490                                {
491                                    valobj_sp = exe_ctx.frame->GetValueObjectForFrameVariable (var_sp);
492                                    if (!valobj_sp)
493                                        valobj_sp = exe_ctx.frame->TrackGlobalVariable (var_sp);
494
495                                    if (valobj_sp)
496                                    {
497                                        if (m_options.format != eFormatDefault)
498                                            valobj_sp->SetFormat (m_options.format);
499
500                                        if (m_options.show_decl && var_sp->GetDeclaration ().GetFile())
501                                        {
502                                            var_sp->GetDeclaration ().DumpStopContext (&s, false);
503                                            s.PutCString (": ");
504                                        }
505
506                                        ValueObject::DumpValueObject (result.GetOutputStream(),
507                                                                      exe_ctx.frame,
508                                                                      valobj_sp.get(),
509                                                                      name_cstr,
510                                                                      m_options.ptr_depth,
511                                                                      0,
512                                                                      m_options.max_depth,
513                                                                      m_options.show_types,
514                                                                      m_options.show_location,
515                                                                      m_options.use_objc,
516                                                                      false,
517                                                                      m_options.flat_output);
518                                    }
519                                }
520                            }
521                        }
522                    }
523                }
524                if (fail_count)
525                    result.SetStatus (eReturnStatusFailed);
526            }
527            else if (variable_list)
528            {
529                if (command.GetArgumentCount() > 0)
530                {
531                    VariableList regex_var_list;
532
533                    // If we have any args to the variable command, we will make
534                    // variable objects from them...
535                    for (idx = 0; (name_cstr = command.GetArgumentAtIndex(idx)) != NULL; ++idx)
536                    {
537                        uint32_t ptr_depth = m_options.ptr_depth;
538
539                        if (m_options.use_regex)
540                        {
541                            const uint32_t regex_start_index = regex_var_list.GetSize();
542                            RegularExpression regex (name_cstr);
543                            if (regex.Compile(name_cstr))
544                            {
545                                size_t num_matches = 0;
546                                const size_t num_new_regex_vars = variable_list->AppendVariablesIfUnique(regex, regex_var_list, num_matches);
547                                if (num_new_regex_vars > 0)
548                                {
549                                    for (uint32_t regex_idx = regex_start_index, end_index = regex_var_list.GetSize();
550                                         regex_idx < end_index;
551                                         ++regex_idx)
552                                    {
553                                        var_sp = regex_var_list.GetVariableAtIndex (regex_idx);
554                                        if (var_sp)
555                                        {
556                                            valobj_sp = exe_ctx.frame->GetValueObjectForFrameVariable (var_sp);
557                                            if (valobj_sp)
558                                            {
559                                                if (m_options.format != eFormatDefault)
560                                                    valobj_sp->SetFormat (m_options.format);
561
562                                                if (m_options.show_decl && var_sp->GetDeclaration ().GetFile())
563                                                {
564                                                    var_sp->GetDeclaration ().DumpStopContext (&s, false);
565                                                    s.PutCString (": ");
566                                                }
567
568                                                ValueObject::DumpValueObject (result.GetOutputStream(),
569                                                                              exe_ctx.frame,
570                                                                              valobj_sp.get(),
571                                                                              var_sp->GetName().AsCString(),
572                                                                              m_options.ptr_depth,
573                                                                              0,
574                                                                              m_options.max_depth,
575                                                                              m_options.show_types,
576                                                                              m_options.show_location,
577                                                                              m_options.use_objc,
578                                                                              false,
579                                                                              m_options.flat_output);
580                                            }
581                                        }
582                                    }
583                                }
584                                else if (num_matches == 0)
585                                {
586                                    result.GetErrorStream().Printf ("error: no variables matched the regular expression '%s'.\n", name_cstr);
587                                }
588                            }
589                            else
590                            {
591                                char regex_error[1024];
592                                if (regex.GetErrorAsCString(regex_error, sizeof(regex_error)))
593                                    result.GetErrorStream().Printf ("error: %s\n", regex_error);
594                                else
595                                    result.GetErrorStream().Printf ("error: unkown regex error when compiling '%s'\n", name_cstr);
596                            }
597                        }
598                        else
599                        {
600                            Error error;
601                            const uint32_t expr_path_options = StackFrame::eExpressionPathOptionCheckPtrVsMember;
602                            valobj_sp = exe_ctx.frame->GetValueForVariableExpressionPath (name_cstr, expr_path_options, error);
603                            if (valobj_sp)
604                            {
605                                if (m_options.format != eFormatDefault)
606                                    valobj_sp->SetFormat (m_options.format);
607
608                                if (m_options.show_decl && var_sp->GetDeclaration ().GetFile())
609                                {
610                                    var_sp->GetDeclaration ().DumpStopContext (&s, false);
611                                    s.PutCString (": ");
612                                }
613                                ValueObject::DumpValueObject (result.GetOutputStream(),
614                                                              exe_ctx.frame,
615                                                              valobj_sp.get(),
616                                                              valobj_sp->GetParent() ? name_cstr : NULL,
617                                                              ptr_depth,
618                                                              0,
619                                                              m_options.max_depth,
620                                                              m_options.show_types,
621                                                              m_options.show_location,
622                                                              m_options.use_objc,
623                                                              false,
624                                                              m_options.flat_output);
625                            }
626                            else
627                            {
628                                const char *error_cstr = error.AsCString(NULL);
629                                if (error_cstr)
630                                    result.GetErrorStream().Printf("error: %s\n", error_cstr);
631                                else
632                                    result.GetErrorStream().Printf ("error: unable to find any variable expression path that matches '%s'\n", name_cstr);
633                            }
634                        }
635                    }
636                }
637                else
638                {
639                    const uint32_t num_variables = variable_list->GetSize();
640
641                    if (num_variables > 0)
642                    {
643                        for (uint32_t i=0; i<num_variables; i++)
644                        {
645                            var_sp = variable_list->GetVariableAtIndex(i);
646                            bool dump_variable = true;
647
648                            switch (var_sp->GetScope())
649                            {
650                            case eValueTypeVariableGlobal:
651                                dump_variable = m_options.show_globals;
652                                if (dump_variable && m_options.show_scope)
653                                    s.PutCString("GLOBAL: ");
654                                break;
655
656                            case eValueTypeVariableStatic:
657                                dump_variable = m_options.show_globals;
658                                if (dump_variable && m_options.show_scope)
659                                    s.PutCString("STATIC: ");
660                                break;
661
662                            case eValueTypeVariableArgument:
663                                dump_variable = m_options.show_args;
664                                if (dump_variable && m_options.show_scope)
665                                    s.PutCString("   ARG: ");
666                                break;
667
668                            case eValueTypeVariableLocal:
669                                dump_variable = m_options.show_locals;
670                                if (dump_variable && m_options.show_scope)
671                                    s.PutCString(" LOCAL: ");
672                                break;
673
674                            default:
675                                break;
676                            }
677
678                            if (dump_variable)
679                            {
680
681                                // Use the variable object code to make sure we are
682                                // using the same APIs as the the public API will be
683                                // using...
684                                valobj_sp = exe_ctx.frame->GetValueObjectForFrameVariable (var_sp);
685                                if (valobj_sp)
686                                {
687                                    if (m_options.format != eFormatDefault)
688                                        valobj_sp->SetFormat (m_options.format);
689
690                                    // When dumping all variables, don't print any variables
691                                    // that are not in scope to avoid extra unneeded output
692                                    if (valobj_sp->IsInScope (exe_ctx.frame))
693                                    {
694                                        if (m_options.show_decl && var_sp->GetDeclaration ().GetFile())
695                                        {
696                                            var_sp->GetDeclaration ().DumpStopContext (&s, false);
697                                            s.PutCString (": ");
698                                        }
699                                        ValueObject::DumpValueObject (result.GetOutputStream(),
700                                                                      exe_ctx.frame,
701                                                                      valobj_sp.get(),
702                                                                      name_cstr,
703                                                                      m_options.ptr_depth,
704                                                                      0,
705                                                                      m_options.max_depth,
706                                                                      m_options.show_types,
707                                                                      m_options.show_location,
708                                                                      m_options.use_objc,
709                                                                      false,
710                                                                      m_options.flat_output);
711                                    }
712                                }
713                            }
714                        }
715                    }
716                }
717                result.SetStatus (eReturnStatusSuccessFinishResult);
718            }
719        }
720        return result.Succeeded();
721    }
722protected:
723
724    CommandOptions m_options;
725};
726
727OptionDefinition
728CommandObjectFrameVariable::CommandOptions::g_option_table[] =
729{
730{ LLDB_OPT_SET_1, false, "debug",      'D', no_argument,       NULL, 0, eArgTypeNone,    "Enable verbose debug information."},
731{ LLDB_OPT_SET_1, false, "depth",      'd', required_argument, NULL, 0, eArgTypeCount,   "Set the max recurse depth when dumping aggregate types (default is infinity)."},
732{ LLDB_OPT_SET_1, false, "show-globals",'g', no_argument,      NULL, 0, eArgTypeNone,    "Show the current frame source file global and static variables."},
733{ LLDB_OPT_SET_1, false, "find-global",'G', required_argument, NULL, 0, eArgTypeVarName, "Find a global variable by name (which might not be in the current stack frame source file)."},
734{ LLDB_OPT_SET_1, false, "location",   'L', no_argument,       NULL, 0, eArgTypeNone,    "Show variable location information."},
735{ LLDB_OPT_SET_1, false, "show-declaration", 'c', no_argument, NULL, 0, eArgTypeNone,    "Show variable declaration information (source file and line where the variable was declared)."},
736{ LLDB_OPT_SET_1, false, "no-args",    'a', no_argument,       NULL, 0, eArgTypeNone,    "Omit function arguments."},
737{ LLDB_OPT_SET_1, false, "no-locals",  'l', no_argument,       NULL, 0, eArgTypeNone,    "Omit local variables."},
738{ LLDB_OPT_SET_1, false, "show-types", 't', no_argument,       NULL, 0, eArgTypeNone,    "Show variable types when dumping values."},
739{ LLDB_OPT_SET_1, false, "no-summary", 'y', no_argument,       NULL, 0, eArgTypeNone,    "Omit summary information."},
740{ LLDB_OPT_SET_1, false, "scope",      's', no_argument,       NULL, 0, eArgTypeNone,    "Show variable scope (argument, local, global, static)."},
741{ LLDB_OPT_SET_1, false, "objc",       'o', no_argument,       NULL, 0, eArgTypeNone,    "When looking up a variable by name, print as an Objective-C object."},
742{ LLDB_OPT_SET_1, false, "ptr-depth",  'p', required_argument, NULL, 0, eArgTypeCount,   "The number of pointers to be traversed when dumping values (default is zero)."},
743{ LLDB_OPT_SET_1, false, "regex",      'r', no_argument,       NULL, 0, eArgTypeRegularExpression,    "The <variable-name> argument for name lookups are regular expressions."},
744{ LLDB_OPT_SET_1, false, "flat",       'F', no_argument,       NULL, 0, eArgTypeNone,    "Display results in a flat format that uses expression paths for each variable or member."},
745{ LLDB_OPT_SET_1, false, "format",     'f', required_argument, NULL, 0, eArgTypeExprFormat,  "Specify the format that the variable output should use."},
746{ 0, false, NULL, 0, 0, NULL, NULL, eArgTypeNone, NULL }
747};
748#pragma mark CommandObjectMultiwordFrame
749
750//-------------------------------------------------------------------------
751// CommandObjectMultiwordFrame
752//-------------------------------------------------------------------------
753
754CommandObjectMultiwordFrame::CommandObjectMultiwordFrame (CommandInterpreter &interpreter) :
755    CommandObjectMultiword (interpreter,
756                            "frame",
757                            "A set of commands for operating on the current thread's frames.",
758                            "frame <subcommand> [<subcommand-options>]")
759{
760    LoadSubCommand ("info",   CommandObjectSP (new CommandObjectFrameInfo (interpreter)));
761    LoadSubCommand ("select", CommandObjectSP (new CommandObjectFrameSelect (interpreter)));
762    LoadSubCommand ("variable", CommandObjectSP (new CommandObjectFrameVariable (interpreter)));
763}
764
765CommandObjectMultiwordFrame::~CommandObjectMultiwordFrame ()
766{
767}
768
769