aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectFrame.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-10-25 06:44:01 +0000
committerGreg Clayton <gclayton@apple.com>2011-10-25 06:44:01 +0000
commit1deb79623896414dae71b7827de8c9ba2eb3bdd9 (patch)
tree47b4b9f36f0aaa3392665144a0c2ee28f947522f /lldb/source/Commands/CommandObjectFrame.cpp
parentd4268d91e7f1df42776a8e1994c7415fc04d7571 (diff)
downloadllvm-1deb79623896414dae71b7827de8c9ba2eb3bdd9.zip
llvm-1deb79623896414dae71b7827de8c9ba2eb3bdd9.tar.gz
llvm-1deb79623896414dae71b7827de8c9ba2eb3bdd9.tar.bz2
Updated all commands that use a "--format" / "-f" options to use the new
OptionGroupFormat. Updated OptionGroupFormat to be able to also use the "--size" and "--count" options. Commands that use a OptionGroupFormat instance can choose which of the options they want by initializing OptionGroupFormat accordingly. Clients can either get only the "--format", "--format" + "--size", or "--format" + "--size" + "--count". This is in preparation for upcoming chnages where there are alternate ways (GDB format specification) to set a format. llvm-svn: 142911
Diffstat (limited to 'lldb/source/Commands/CommandObjectFrame.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectFrame.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp
index d832694..c752812 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -29,6 +29,7 @@
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Interpreter/Options.h"
+#include "lldb/Interpreter/OptionGroupFormat.h"
#include "lldb/Interpreter/OptionGroupValueObjectDisplay.h"
#include "lldb/Interpreter/OptionGroupVariable.h"
#include "lldb/Interpreter/OptionGroupWatchpoint.h"
@@ -336,6 +337,7 @@ public:
eFlagProcessMustBeLaunched | eFlagProcessMustBePaused),
m_option_group (interpreter),
m_option_variable(true), // Include the frame specific options by passing "true"
+ m_option_format (eFormatDefault),
m_option_watchpoint(),
m_varobj_options()
{
@@ -353,6 +355,7 @@ public:
m_arguments.push_back (arg);
m_option_group.Append (&m_option_variable, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
+ m_option_group.Append (&m_option_format, OptionGroupFormat::OPTION_GROUP_FORMAT, LLDB_OPT_SET_1);
m_option_group.Append (&m_option_watchpoint, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
m_option_group.Append (&m_varobj_options, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
m_option_group.Finalize();
@@ -440,6 +443,9 @@ public:
// Things have checked out ok...
// m_option_watchpoint.watch_type specifies the type of watching.
}
+
+ const Format format = m_option_format.GetFormat();
+
if (command.GetArgumentCount() > 0)
{
VariableList regex_var_list;
@@ -470,8 +476,8 @@ public:
valobj_sp = frame->GetValueObjectForFrameVariable (var_sp, m_varobj_options.use_dynamic);
if (valobj_sp)
{
- if (m_option_variable.format != eFormatDefault)
- valobj_sp->SetFormat (m_option_variable.format);
+ if (format != eFormatDefault)
+ valobj_sp->SetFormat (format);
if (m_option_variable.show_decl && var_sp->GetDeclaration ().GetFile())
{
@@ -515,8 +521,8 @@ public:
error);
if (valobj_sp)
{
- if (m_option_variable.format != eFormatDefault)
- valobj_sp->SetFormat (m_option_variable.format);
+ if (format != eFormatDefault)
+ valobj_sp->SetFormat (format);
if (m_option_variable.show_decl && var_sp && var_sp->GetDeclaration ().GetFile())
{
var_sp->GetDeclaration ().DumpStopContext (&s, false);
@@ -633,8 +639,8 @@ public:
m_varobj_options.use_dynamic);
if (valobj_sp)
{
- if (m_option_variable.format != eFormatDefault)
- valobj_sp->SetFormat (m_option_variable.format);
+ if (format != eFormatDefault)
+ valobj_sp->SetFormat (format);
// When dumping all variables, don't print any variables
// that are not in scope to avoid extra unneeded output
@@ -673,6 +679,7 @@ protected:
OptionGroupOptions m_option_group;
OptionGroupVariable m_option_variable;
+ OptionGroupFormat m_option_format;
OptionGroupWatchpoint m_option_watchpoint;
OptionGroupValueObjectDisplay m_varobj_options;
};