Revert "Revert "I had recently added a new SBFrame::GetVariables() overload with yet another bool argument""

Reverting this commit led to other failures which I did not see at
first.  This turned out to be an easy problem to fix, so I added
SBVariablesOptions.cpp to the CMakeLists.txt.  In the future please
try to make sure new files are added to CMake.

llvm-svn: 229516
This commit is contained in:
Zachary Turner 2015-02-17 17:55:50 +00:00
parent a9614171a7
commit 51f96eeb24
14 changed files with 469 additions and 35 deletions

View File

@ -52,5 +52,6 @@
#include "lldb/API/SBType.h"
#include "lldb/API/SBValue.h"
#include "lldb/API/SBValueList.h"
#include "lldb/API/SBVariablesOptions.h"
#endif // LLDB_LLDB_h_

View File

@ -90,6 +90,7 @@ class LLDB_API SBTypeSynthetic;
class LLDB_API SBTypeList;
class LLDB_API SBValue;
class LLDB_API SBValueList;
class LLDB_API SBVariablesOptions;
class LLDB_API SBWatchpoint;
class LLDB_API SBUnixSignals;

View File

@ -157,12 +157,7 @@ public:
lldb::DynamicValueType use_dynamic);
lldb::SBValueList
GetVariables (bool arguments,
bool locals,
bool statics,
bool in_scope_only,
bool include_runtime_support_values,
lldb::DynamicValueType use_dynamic);
GetVariables (const lldb::SBVariablesOptions& options);
lldb::SBValueList
GetRegisters ();

View File

@ -0,0 +1,98 @@
//===-- SBVariablesOptions.h ------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLDB_SBVariablesOptions_h_
#define LLDB_SBVariablesOptions_h_
#include "lldb/API/SBDefines.h"
class VariablesOptionsImpl;
namespace lldb {
class SBVariablesOptions
{
public:
SBVariablesOptions ();
SBVariablesOptions (const SBVariablesOptions& options);
SBVariablesOptions&
operator = (const SBVariablesOptions& options);
~SBVariablesOptions ();
bool
IsValid () const;
bool
GetIncludeArguments () const;
void
SetIncludeArguments (bool);
bool
GetIncludeLocals () const;
void
SetIncludeLocals (bool);
bool
GetIncludeStatics () const;
void
SetIncludeStatics (bool);
bool
GetInScopeOnly () const;
void
SetInScopeOnly (bool);
bool
GetIncludeRuntimeSupportValues () const;
void
SetIncludeRuntimeSupportValues (bool);
lldb::DynamicValueType
GetUseDynamic () const;
void
SetUseDynamic (lldb::DynamicValueType);
protected:
VariablesOptionsImpl *
operator->();
const VariablesOptionsImpl *
operator->() const;
VariablesOptionsImpl *
get ();
VariablesOptionsImpl &
ref();
const VariablesOptionsImpl &
ref() const;
SBVariablesOptions (VariablesOptionsImpl *lldb_object_ptr);
void
SetOptions (VariablesOptionsImpl *lldb_object_ptr);
private:
std::unique_ptr<VariablesOptionsImpl> m_opaque_ap;
};
} // namespace lldb
#endif // LLDB_SBValue_h_

View File

@ -767,6 +767,8 @@
941BCC8014E48C4000BB969C /* SBTypeFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 9461568714E355F2003A195C /* SBTypeFormat.h */; settings = {ATTRIBUTES = (Public, ); }; };
941BCC8114E48C4000BB969C /* SBTypeSummary.h in Headers */ = {isa = PBXBuildFile; fileRef = 9461568814E355F2003A195C /* SBTypeSummary.h */; settings = {ATTRIBUTES = (Public, ); }; };
941BCC8214E48C4000BB969C /* SBTypeSynthetic.h in Headers */ = {isa = PBXBuildFile; fileRef = 9461568914E355F2003A195C /* SBTypeSynthetic.h */; settings = {ATTRIBUTES = (Public, ); }; };
94235B9E1A8D667400EB2EED /* SBVariablesOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94235B9B1A8D5FF300EB2EED /* SBVariablesOptions.cpp */; };
94235B9F1A8D66D600EB2EED /* SBVariablesOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 94235B9A1A8D5FD800EB2EED /* SBVariablesOptions.h */; settings = {ATTRIBUTES = (Public, ); }; };
942829561A89614C00521B30 /* JSON.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 942829551A89614C00521B30 /* JSON.cpp */; };
942829CC1A89839300521B30 /* liblldb-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2689FFCA13353D7A00698AC0 /* liblldb-core.a */; };
942AFF0519F84ABF007B43B4 /* LibCxxVector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 942AFF0419F84ABF007B43B4 /* LibCxxVector.cpp */; };
@ -2405,6 +2407,9 @@
940B04DE1A8986070045D5F7 /* libncurses.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libncurses.dylib; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib/libncurses.dylib; sourceTree = DEVELOPER_DIR; };
940B04E01A89860E0045D5F7 /* libedit.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libedit.dylib; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib/libedit.dylib; sourceTree = DEVELOPER_DIR; };
94145430175D7FDE00284436 /* lldb-versioning.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lldb-versioning.h"; path = "include/lldb/lldb-versioning.h"; sourceTree = "<group>"; };
94235B9A1A8D5FD800EB2EED /* SBVariablesOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBVariablesOptions.h; path = include/lldb/API/SBVariablesOptions.h; sourceTree = "<group>"; };
94235B9B1A8D5FF300EB2EED /* SBVariablesOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBVariablesOptions.cpp; path = source/API/SBVariablesOptions.cpp; sourceTree = "<group>"; };
94235B9D1A8D601A00EB2EED /* SBVariablesOptions.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBVariablesOptions.i; sourceTree = "<group>"; };
942829541A89614000521B30 /* JSON.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JSON.h; path = include/lldb/Utility/JSON.h; sourceTree = "<group>"; };
942829551A89614C00521B30 /* JSON.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSON.cpp; path = source/Utility/JSON.cpp; sourceTree = "<group>"; };
942829C01A89835300521B30 /* argdumper */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = argdumper; sourceTree = BUILT_PRODUCTS_DIR; };
@ -3182,6 +3187,7 @@
9461569514E3567F003A195C /* SBTypeSynthetic.i */,
2611FF12142D83060017FEA3 /* SBValue.i */,
2611FF13142D83060017FEA3 /* SBValueList.i */,
94235B9D1A8D601A00EB2EED /* SBVariablesOptions.i */,
B2A5872514313B480092BFBA /* SBWatchpoint.i */,
);
name = interface;
@ -3200,8 +3206,6 @@
262D3190111B4341004E6F88 /* API */ = {
isa = PBXGroup;
children = (
254FBB961A81B03100BD6378 /* SBLaunchInfo.h */,
254FBB941A81AA7F00BD6378 /* SBLaunchInfo.cpp */,
254FBBA41A91670E00BD6378 /* SBAttachInfo.cpp */,
254FBBA21A9166F100BD6378 /* SBAttachInfo.h */,
2611FEEE142D83060017FEA3 /* interface */,
@ -3259,6 +3263,8 @@
9AC703AE117675410086C050 /* SBInstruction.cpp */,
9AC7038F117675270086C050 /* SBInstructionList.h */,
9AC703B0117675490086C050 /* SBInstructionList.cpp */,
254FBB961A81B03100BD6378 /* SBLaunchInfo.h */,
254FBB941A81AA7F00BD6378 /* SBLaunchInfo.cpp */,
26DE205811618FE700A093E2 /* SBLineEntry.h */,
26DE20621161904200A093E2 /* SBLineEntry.cpp */,
9A9831021125FC5800A56CB0 /* SBListener.h */,
@ -3319,6 +3325,8 @@
9A19A6AD1163BB9800E0D453 /* SBValue.cpp */,
9A357582116CFDEE00E8ED2F /* SBValueList.h */,
9A35758D116CFE0F00E8ED2F /* SBValueList.cpp */,
94235B9A1A8D5FD800EB2EED /* SBVariablesOptions.h */,
94235B9B1A8D5FF300EB2EED /* SBVariablesOptions.cpp */,
B2A58721143119810092BFBA /* SBWatchpoint.h */,
B2A58723143119D50092BFBA /* SBWatchpoint.cpp */,
);
@ -5223,6 +5231,7 @@
26D265A2136B40EE002EEE45 /* SharingPtr.h in Headers */,
26D265BC136B4269002EEE45 /* lldb-public.h in Headers */,
4CE4F673162C971A00F75CB3 /* SBExpressionOptions.h in Headers */,
94235B9F1A8D66D600EB2EED /* SBVariablesOptions.h in Headers */,
23EFE389193D1ABC00E54E54 /* SBTypeEnumMember.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -5822,6 +5831,7 @@
9AC703AF117675410086C050 /* SBInstruction.cpp in Sources */,
9AC703B1117675490086C050 /* SBInstructionList.cpp in Sources */,
268F9D55123AA16600B91E9B /* SBSymbolContextList.cpp in Sources */,
94235B9E1A8D667400EB2EED /* SBVariablesOptions.cpp in Sources */,
26C72C961243229A0068DC16 /* SBStream.cpp in Sources */,
9443B122140C18C40013457C /* SBData.cpp in Sources */,
4CF52AF8142829390051E832 /* SBFileSpecList.cpp in Sources */,

View File

@ -127,6 +127,7 @@ HEADER_FILES="${SRC_ROOT}/include/lldb/lldb.h"\
" ${SRC_ROOT}/include/lldb/API/SBTypeSynthetic.h"\
" ${SRC_ROOT}/include/lldb/API/SBValue.h"\
" ${SRC_ROOT}/include/lldb/API/SBValueList.h"\
" ${SRC_ROOT}/include/lldb/API/SBVariablesOptions.h"\
" ${SRC_ROOT}/include/lldb/API/SBWatchpoint.h"\
" ${SRC_ROOT}/include/lldb/API/SBUnixSignals.h"
@ -180,6 +181,7 @@ INTERFACE_FILES="${SRC_ROOT}/scripts/Python/interface/SBAddress.i"\
" ${SRC_ROOT}/scripts/Python/interface/SBTypeSynthetic.i"\
" ${SRC_ROOT}/scripts/Python/interface/SBValue.i"\
" ${SRC_ROOT}/scripts/Python/interface/SBValueList.i"\
" ${SRC_ROOT}/scripts/Python/interface/SBVariablesOptions.i"\
" ${SRC_ROOT}/scripts/Python/interface/SBWatchpoint.i"\
" ${SRC_ROOT}/scripts/Python/interface/SBUnixSignals.i"

View File

@ -199,12 +199,7 @@ public:
lldb::DynamicValueType use_dynamic);
lldb::SBValueList
GetVariables (bool arguments,
bool locals,
bool statics,
bool in_scope_only,
bool include_runtime_support_values,
lldb::DynamicValueType use_dynamic);
GetVariables (const lldb::SBVariablesOptions& options);
lldb::SBValueList
GetRegisters ();

View File

@ -0,0 +1,61 @@
//===-- SWIG Interface for SBVariablesOptions ----------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
namespace lldb {
class SBVariablesOptions
{
public:
SBVariablesOptions ();
SBVariablesOptions (const SBVariablesOptions& options);
~SBVariablesOptions ();
bool
IsValid () const;
bool
GetIncludeArguments () const;
void
SetIncludeArguments (bool);
bool
GetIncludeLocals () const;
void
SetIncludeLocals (bool);
bool
GetIncludeStatics () const;
void
SetIncludeStatics (bool);
bool
GetInScopeOnly () const;
void
SetInScopeOnly (bool);
bool
GetIncludeRuntimeSupportValues () const;
void
SetIncludeRuntimeSupportValues (bool);
lldb::DynamicValueType
GetUseDynamic () const;
void
SetUseDynamic (lldb::DynamicValueType);
};
} // namespace lldb

View File

@ -106,6 +106,7 @@ import os
#include "lldb/API/SBTypeSynthetic.h"
#include "lldb/API/SBValue.h"
#include "lldb/API/SBValueList.h"
#include "lldb/API/SBVariablesOptions.h"
#include "lldb/API/SBWatchpoint.h"
#include "lldb/API/SBUnixSignals.h"
@ -182,6 +183,7 @@ import os
%include "./Python/interface/SBTypeSynthetic.i"
%include "./Python/interface/SBValue.i"
%include "./Python/interface/SBValueList.i"
%include "./Python/interface/SBVariablesOptions.i"
%include "./Python/interface/SBWatchpoint.i"
%include "./Python/interface/SBUnixSignals.i"

View File

@ -58,6 +58,7 @@ add_lldb_library(lldbAPI
SBTypeSynthetic.cpp
SBValue.cpp
SBValueList.cpp
SBVariablesOptions.cpp
SBWatchpoint.cpp
SBUnixSignals.cpp
)

View File

@ -44,6 +44,7 @@
#include "lldb/API/SBStream.h"
#include "lldb/API/SBSymbolContext.h"
#include "lldb/API/SBThread.h"
#include "lldb/API/SBVariablesOptions.h"
using namespace lldb;
using namespace lldb_private;
@ -1075,7 +1076,17 @@ SBFrame::GetVariables (bool arguments,
if (frame && target)
{
lldb::DynamicValueType use_dynamic = frame->CalculateTarget()->GetPreferDynamicValue();
value_list = GetVariables (arguments, locals, statics, in_scope_only, use_dynamic);
const bool include_runtime_support_values = target ? target->GetDisplayRuntimeSupportValues() : false;
SBVariablesOptions options;
options.SetIncludeArguments(arguments);
options.SetIncludeLocals(locals);
options.SetIncludeStatics(statics);
options.SetInScopeOnly(in_scope_only);
options.SetIncludeRuntimeSupportValues(include_runtime_support_values);
options.SetUseDynamic(use_dynamic);
value_list = GetVariables (options);
}
return value_list;
}
@ -1089,22 +1100,19 @@ SBFrame::GetVariables (bool arguments,
{
ExecutionContext exe_ctx(m_opaque_sp.get());
Target *target = exe_ctx.GetTargetPtr();
bool include_runtime_support_values = target ? target->GetDisplayRuntimeSupportValues() : false;
return GetVariables(arguments,
locals,
statics,
in_scope_only,
include_runtime_support_values,
use_dynamic);
const bool include_runtime_support_values = target ? target->GetDisplayRuntimeSupportValues() : false;
SBVariablesOptions options;
options.SetIncludeArguments(arguments);
options.SetIncludeLocals(locals);
options.SetIncludeStatics(statics);
options.SetInScopeOnly(in_scope_only);
options.SetIncludeRuntimeSupportValues(include_runtime_support_values);
options.SetUseDynamic(use_dynamic);
return GetVariables(options);
}
SBValueList
SBFrame::GetVariables (bool arguments,
bool locals,
bool statics,
bool in_scope_only,
bool include_runtime_support_values,
lldb::DynamicValueType use_dynamic)
SBFrame::GetVariables (const lldb::SBVariablesOptions& options)
{
Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
@ -1115,10 +1123,19 @@ SBFrame::GetVariables (bool arguments,
StackFrame *frame = NULL;
Target *target = exe_ctx.GetTargetPtr();
const bool statics = options.GetIncludeStatics();
const bool arguments = options.GetIncludeArguments();
const bool locals = options.GetIncludeLocals();
const bool in_scope_only = options.GetInScopeOnly();
const bool include_runtime_support_values = options.GetIncludeRuntimeSupportValues();
const lldb::DynamicValueType use_dynamic = options.GetUseDynamic();
if (log)
log->Printf ("SBFrame::GetVariables (arguments=%i, locals=%i, statics=%i, in_scope_only=%i)",
arguments, locals, statics, in_scope_only);
log->Printf ("SBFrame::GetVariables (arguments=%i, locals=%i, statics=%i, in_scope_only=%i runtime=%i dynamic=%i)",
arguments, locals,
statics, in_scope_only,
include_runtime_support_values, use_dynamic);
Process *process = exe_ctx.GetProcessPtr();
if (target && process)
{

View File

@ -0,0 +1,254 @@
//===-- SBVariablesOptions.cpp --------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "lldb/API/SBVariablesOptions.h"
using namespace lldb;
using namespace lldb_private;
class VariablesOptionsImpl
{
public:
VariablesOptionsImpl () :
m_include_arguments(false),
m_include_locals(false),
m_include_statics(false),
m_in_scope_only(false),
m_include_runtime_support_values(false),
m_use_dynamic(lldb::eNoDynamicValues)
{}
VariablesOptionsImpl (const VariablesOptionsImpl&) = default;
~VariablesOptionsImpl () = default;
VariablesOptionsImpl&
operator = (const VariablesOptionsImpl&) = default;
bool
GetIncludeArguments () const
{
return m_include_arguments;
}
void
SetIncludeArguments (bool b)
{
m_include_arguments = b;
}
bool
GetIncludeLocals () const
{
return m_include_locals;
}
void
SetIncludeLocals (bool b)
{
m_include_locals = b;
}
bool
GetIncludeStatics () const
{
return m_include_statics;
}
void
SetIncludeStatics (bool b)
{
m_include_statics = b;
}
bool
GetInScopeOnly () const
{
return m_in_scope_only;
}
void
SetInScopeOnly (bool b)
{
m_in_scope_only = b;
}
bool
GetIncludeRuntimeSupportValues () const
{
return m_include_runtime_support_values;
}
void
SetIncludeRuntimeSupportValues (bool b)
{
m_include_runtime_support_values = b;
}
lldb::DynamicValueType
GetUseDynamic () const
{
return m_use_dynamic;
}
void
SetUseDynamic (lldb::DynamicValueType d)
{
m_use_dynamic = d;
}
private:
bool m_include_arguments : 1;
bool m_include_locals : 1;
bool m_include_statics : 1;
bool m_in_scope_only : 1;
bool m_include_runtime_support_values : 1;
lldb::DynamicValueType m_use_dynamic;
};
SBVariablesOptions::SBVariablesOptions () :
m_opaque_ap(new VariablesOptionsImpl())
{
}
SBVariablesOptions::SBVariablesOptions (const SBVariablesOptions& options) :
m_opaque_ap(new VariablesOptionsImpl(options.ref()))
{
}
SBVariablesOptions&
SBVariablesOptions::operator = (const SBVariablesOptions& options)
{
m_opaque_ap.reset(new VariablesOptionsImpl(options.ref()));
return *this;
}
SBVariablesOptions::~SBVariablesOptions () = default;
bool
SBVariablesOptions::IsValid () const
{
return m_opaque_ap.get() != nullptr;
}
bool
SBVariablesOptions::GetIncludeArguments () const
{
return m_opaque_ap->GetIncludeArguments();
}
void
SBVariablesOptions::SetIncludeArguments (bool arguments)
{
m_opaque_ap->SetIncludeArguments(arguments);
}
bool
SBVariablesOptions::GetIncludeLocals () const
{
return m_opaque_ap->GetIncludeLocals();
}
void
SBVariablesOptions::SetIncludeLocals (bool locals)
{
m_opaque_ap->SetIncludeLocals(locals);
}
bool
SBVariablesOptions::GetIncludeStatics () const
{
return m_opaque_ap->GetIncludeStatics();
}
void
SBVariablesOptions::SetIncludeStatics (bool statics)
{
m_opaque_ap->SetIncludeStatics(statics);
}
bool
SBVariablesOptions::GetInScopeOnly () const
{
return m_opaque_ap->GetInScopeOnly();
}
void
SBVariablesOptions::SetInScopeOnly (bool in_scope_only)
{
m_opaque_ap->SetInScopeOnly(in_scope_only);
}
bool
SBVariablesOptions::GetIncludeRuntimeSupportValues () const
{
return m_opaque_ap->GetIncludeRuntimeSupportValues();
}
void
SBVariablesOptions::SetIncludeRuntimeSupportValues (bool runtime_support_values)
{
m_opaque_ap->SetIncludeRuntimeSupportValues(runtime_support_values);
}
lldb::DynamicValueType
SBVariablesOptions::GetUseDynamic () const
{
return m_opaque_ap->GetUseDynamic();
}
void
SBVariablesOptions::SetUseDynamic (lldb::DynamicValueType dynamic)
{
m_opaque_ap->SetUseDynamic(dynamic);
}
VariablesOptionsImpl *
SBVariablesOptions::operator->()
{
return m_opaque_ap.operator->();
}
const VariablesOptionsImpl *
SBVariablesOptions::operator->() const
{
return m_opaque_ap.operator->();
}
VariablesOptionsImpl *
SBVariablesOptions::get ()
{
return m_opaque_ap.get();
}
VariablesOptionsImpl &
SBVariablesOptions::ref()
{
return *m_opaque_ap;
}
const VariablesOptionsImpl &
SBVariablesOptions::ref() const
{
return *m_opaque_ap;
}
SBVariablesOptions::SBVariablesOptions (VariablesOptionsImpl *lldb_object_ptr) :
m_opaque_ap(std::move(lldb_object_ptr))
{
}
void
SBVariablesOptions::SetOptions (VariablesOptionsImpl *lldb_object_ptr)
{
m_opaque_ap.reset(std::move(lldb_object_ptr));
}

View File

@ -113,6 +113,7 @@ add_lldb_library(liblldb SHARED
API/SBUnixSignals.cpp
API/SBValue.cpp
API/SBValueList.cpp
API/SBVariablesOptions.cpp
API/SBWatchpoint.cpp
Host/Windows/getopt/GetOptInc.cpp
${LLDB_WRAP_PYTHON}

View File

@ -1,4 +0,0 @@
LEVEL = ../../../make
CXX_SOURCES := main.cpp
CXXFLAGS += -std=c++11
include $(LEVEL)/Makefile.rules