diff options
author | Greg Clayton <gclayton@apple.com> | 2010-11-15 01:32:26 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2010-11-15 01:32:26 +0000 |
commit | ce5c9a8f31aec667bc9f0d0240888667386b2bf4 (patch) | |
tree | 2bb78b8a875a729648cfbac357449da22891f824 /lldb/source/Commands/CommandObjectFrame.cpp | |
parent | 03ac1b09d189b90c06821c32089a64bc5b3d611b (diff) | |
download | llvm-ce5c9a8f31aec667bc9f0d0240888667386b2bf4.zip llvm-ce5c9a8f31aec667bc9f0d0240888667386b2bf4.tar.gz llvm-ce5c9a8f31aec667bc9f0d0240888667386b2bf4.tar.bz2 |
Added the address of operator for the "frame variable" command.
llvm-svn: 119100
Diffstat (limited to 'lldb/source/Commands/CommandObjectFrame.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectFrame.cpp | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp index 37cfbfa..1fecc88 100644 --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -586,12 +586,18 @@ public: } else { + bool address_of = false; // If first character is a '*', then show pointer contents if (name_cstr[0] == '*') { ++ptr_depth; name_cstr++; // Skip the '*' } + else if (name_cstr[0] == '&') + { + address_of = true; + name_cstr++; // Skip the '&' + } std::string var_path (name_cstr); size_t separator_idx = var_path.find_first_of(".-["); @@ -724,18 +730,25 @@ public: } - ValueObject::DumpValueObject (result.GetOutputStream(), - exe_ctx.frame, - valobj_sp.get(), - valobj_sp->GetParent() ? name_cstr : NULL, - ptr_depth, - 0, - m_options.max_depth, - m_options.show_types, - m_options.show_location, - m_options.use_objc, - false, - m_options.flat_output); + if (address_of) + { + s.Printf("&%s = %s\n", name_cstr, valobj_sp->GetLocationAsCString (exe_ctx.frame)); + } + else + { + ValueObject::DumpValueObject (result.GetOutputStream(), + exe_ctx.frame, + valobj_sp.get(), + valobj_sp->GetParent() ? name_cstr : NULL, + ptr_depth, + 0, + m_options.max_depth, + m_options.show_types, + m_options.show_location, + m_options.use_objc, + false, + m_options.flat_output); + } } } else |