kubamracek created this revision.
kubamracek added a reviewer: jingham.
kubamracek added a project: LLDB.
Repository:
rLLDB LLDB
https://reviews.llvm.org/D55954
Files:
include/lldb/API/SBTarget.h
include/lldb/API/SBVariablesOptions.h
include/lldb/Target/Target.h
scripts/interface/SBVariablesOptions.i
source/API/SBFrame.cpp
source/API/SBVariablesOptions.cpp
source/Target/Target.cpp
Index: source/Target/Target.cpp
===================================================================
--- source/Target/Target.cpp
+++ source/Target/Target.cpp
@@ -3356,6 +3356,8 @@
{"display-runtime-support-values", OptionValue::eTypeBoolean, false, false,
nullptr, {}, "If true, LLDB will show variables that are meant to "
"support the operation of a language's runtime support."},
+ {"display-recognized-arguments", OptionValue::eTypeBoolean, false, false,
+ nullptr, {}, "Show recognized arguments in variable listings by default."},
{"non-stop-mode", OptionValue::eTypeBoolean, false, 0, nullptr, {},
"Disable lock-step debugging, instead control threads independently."},
{"require-hardware-breakpoint", OptionValue::eTypeBoolean, false, 0,
@@ -3404,6 +3406,7 @@
ePropertyDisplayExpressionsInCrashlogs,
ePropertyTrapHandlerNames,
ePropertyDisplayRuntimeSupportValues,
+ ePropertyDisplayRecognizedArguments,
ePropertyNonStopModeEnabled,
ePropertyRequireHardwareBreakpoints,
ePropertyExperimental,
@@ -3963,6 +3966,16 @@
m_collection_sp->SetPropertyAtIndexAsBoolean(nullptr, idx, b);
}
+bool TargetProperties::GetDisplayRecognizedArguments() const {
+ const uint32_t idx = ePropertyDisplayRecognizedArguments;
+ return m_collection_sp->GetPropertyAtIndexAsBoolean(nullptr, idx, false);
+}
+
+void TargetProperties::SetDisplayRecognizedArguments(bool b) {
+ const uint32_t idx = ePropertyDisplayRecognizedArguments;
+ m_collection_sp->SetPropertyAtIndexAsBoolean(nullptr, idx, b);
+}
+
bool TargetProperties::GetNonStopModeEnabled() const {
const uint32_t idx = ePropertyNonStopModeEnabled;
return m_collection_sp->GetPropertyAtIndexAsBoolean(nullptr, idx, false);
Index: source/API/SBVariablesOptions.cpp
===================================================================
--- source/API/SBVariablesOptions.cpp
+++ source/API/SBVariablesOptions.cpp
@@ -9,6 +9,10 @@
//===----------------------------------------------------------------------===//
#include "lldb/API/SBVariablesOptions.h"
+#include "lldb/API/SBTarget.h"
+#include "lldb/Target/Target.h"
+
+#include "lldb/lldb-private.h"
using namespace lldb;
using namespace lldb_private;
@@ -16,9 +20,10 @@
class VariablesOptionsImpl {
public:
VariablesOptionsImpl()
- : m_include_arguments(false), m_include_recognized_arguments(false),
- m_include_locals(false), m_include_statics(false),
- m_in_scope_only(false), m_include_runtime_support_values(false),
+ : m_include_arguments(false), m_include_locals(false),
+ m_include_statics(false), m_in_scope_only(false),
+ m_include_runtime_support_values(false),
+ m_include_recognized_arguments(eLazyBoolCalculate),
m_use_dynamic(lldb::eNoDynamicValues) {}
VariablesOptionsImpl(const VariablesOptionsImpl &) = default;
@@ -31,12 +36,14 @@
void SetIncludeArguments(bool b) { m_include_arguments = b; }
- bool GetIncludeRecognizedArguments() const {
- return m_include_recognized_arguments;
+ bool GetIncludeRecognizedArguments(const lldb::TargetSP &target_sp) const {
+ if (m_include_recognized_arguments != eLazyBoolCalculate)
+ return m_include_recognized_arguments;
+ return target_sp->GetDisplayRecognizedArguments();
}
void SetIncludeRecognizedArguments(bool b) {
- m_include_recognized_arguments = b;
+ m_include_recognized_arguments = b ? eLazyBoolYes : eLazyBoolNo;
}
bool GetIncludeLocals() const { return m_include_locals; }
@@ -65,11 +72,11 @@
private:
bool m_include_arguments : 1;
- bool m_include_recognized_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;
+ LazyBool m_include_recognized_arguments; // can be overridden with a setting
lldb::DynamicValueType m_use_dynamic;
};
@@ -99,8 +106,9 @@
m_opaque_ap->SetIncludeArguments(arguments);
}
-bool SBVariablesOptions::GetIncludeRecognizedArguments() const {
- return m_opaque_ap->GetIncludeRecognizedArguments();
+bool SBVariablesOptions::GetIncludeRecognizedArguments(
+ const lldb::SBTarget &target) const {
+ return m_opaque_ap->GetIncludeRecognizedArguments(target.GetSP());
}
void SBVariablesOptions::SetIncludeRecognizedArguments(bool arguments) {
Index: source/API/SBFrame.cpp
===================================================================
--- source/API/SBFrame.cpp
+++ source/API/SBFrame.cpp
@@ -957,7 +957,8 @@
const bool statics = options.GetIncludeStatics();
const bool arguments = options.GetIncludeArguments();
- const bool recognized_arguments = options.GetIncludeRecognizedArguments();
+ const bool recognized_arguments =
+ options.GetIncludeRecognizedArguments(SBTarget(TargetSP(target)));
const bool locals = options.GetIncludeLocals();
const bool in_scope_only = options.GetInScopeOnly();
const bool include_runtime_support_values =
Index: scripts/interface/SBVariablesOptions.i
===================================================================
--- scripts/interface/SBVariablesOptions.i
+++ scripts/interface/SBVariablesOptions.i
@@ -28,7 +28,7 @@
SetIncludeArguments (bool);
bool
- GetIncludeRecognizedArguments () const;
+ GetIncludeRecognizedArguments (const lldb::SBTarget &) const;
void
SetIncludeRecognizedArguments (bool);
Index: include/lldb/Target/Target.h
===================================================================
--- include/lldb/Target/Target.h
+++ include/lldb/Target/Target.h
@@ -188,6 +188,10 @@
void SetDisplayRuntimeSupportValues(bool b);
+ bool GetDisplayRecognizedArguments() const;
+
+ void SetDisplayRecognizedArguments(bool b);
+
const ProcessLaunchInfo &GetProcessLaunchInfo();
void SetProcessLaunchInfo(const ProcessLaunchInfo &launch_info);
Index: include/lldb/API/SBVariablesOptions.h
===================================================================
--- include/lldb/API/SBVariablesOptions.h
+++ include/lldb/API/SBVariablesOptions.h
@@ -33,7 +33,7 @@
void SetIncludeArguments(bool);
- bool GetIncludeRecognizedArguments() const;
+ bool GetIncludeRecognizedArguments(const lldb::SBTarget &) const;
void SetIncludeRecognizedArguments(bool);
Index: include/lldb/API/SBTarget.h
===================================================================
--- include/lldb/API/SBTarget.h
+++ include/lldb/API/SBTarget.h
@@ -903,6 +903,7 @@
friend class SBSourceManager;
friend class SBSymbol;
friend class SBValue;
+ friend class SBVariablesOptions;
//------------------------------------------------------------------
// Constructors are private, use static Target::Create function to create an
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits