Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1ad2d88

Browse files
committed
Move property to debugger, not target
1 parent 05d24d3 commit 1ad2d88

8 files changed

Lines changed: 14 additions & 13 deletions

File tree

lldb/include/lldb/Core/Debugger.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,8 @@ class Debugger : public std::enable_shared_from_this<Debugger>,
382382

383383
bool GetAutoOneLineSummaries() const;
384384

385+
bool GetPrintBraces() const;
386+
385387
bool GetAutoIndent() const;
386388

387389
bool SetAutoIndent(bool b);

lldb/include/lldb/Target/Target.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,6 @@ class TargetProperties : public Properties {
202202
/// otherwise false.
203203
std::pair<uint32_t, bool> GetMaximumDepthOfChildrenToDisplay() const;
204204

205-
bool GetPrintBraces() const;
206-
207205
uint32_t GetMaximumSizeOfStringSummary() const;
208206

209207
uint32_t GetMaximumMemReadSize() const;

lldb/source/Core/CoreProperties.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ let Definition = "debugger", Path = "" in {
240240
Global,
241241
DefaultTrue,
242242
Desc<"If true, LLDB will automatically display small structs in one-liner format (default: true).">;
243+
def PrintBraces: Property<"print-braces", "Boolean">,
244+
Global,
245+
DefaultTrue,
246+
Desc<"Print curly braces around structures when displaying variable values.">;
243247
def AutoIndent: Property<"auto-indent", "Boolean">,
244248
Global,
245249
DefaultTrue,

lldb/source/Core/Debugger.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,12 @@ bool Debugger::GetAutoOneLineSummaries() const {
723723
idx, g_debugger_properties[idx].default_uint_value != 0);
724724
}
725725

726+
bool Debugger::GetPrintBraces() const {
727+
const uint32_t idx = ePropertyPrintBraces;
728+
return GetPropertyAtIndexAs<bool>(
729+
idx, g_debugger_properties[idx].default_uint_value != 0);
730+
}
731+
726732
bool Debugger::GetEscapeNonPrintables() const {
727733
const uint32_t idx = ePropertyEscapeNonPrintables;
728734
return GetPropertyAtIndexAs<bool>(

lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ void OptionGroupValueObjectDisplay::OptionParsingStarting(
181181
auto max_depth_config = target_sp->GetMaximumDepthOfChildrenToDisplay();
182182
max_depth = std::get<uint32_t>(max_depth_config);
183183
max_depth_is_default = std::get<bool>(max_depth_config);
184-
print_braces = target_sp->GetPrintBraces();
184+
print_braces = target_sp->GetDebugger().GetPrintBraces();
185185
} else {
186186
// If we don't have any targets, then dynamic values won't do us much good.
187187
use_dynamic = lldb::eNoDynamicValues;

lldb/source/Target/Target.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5004,12 +5004,6 @@ TargetProperties::GetMaximumDepthOfChildrenToDisplay() const {
50045004
return {option_value->GetCurrentValue(), is_default};
50055005
}
50065006

5007-
bool TargetProperties::GetPrintBraces() const {
5008-
const uint32_t idx = ePropertyPrintBraces;
5009-
return GetPropertyAtIndexAs<bool>(
5010-
idx, g_target_properties[idx].default_uint_value != 0);
5011-
}
5012-
50135007
uint32_t TargetProperties::GetMaximumSizeOfStringSummary() const {
50145008
const uint32_t idx = ePropertyMaxSummaryLength;
50155009
return GetPropertyAtIndexAs<uint64_t>(

lldb/source/Target/TargetProperties.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@ let Definition = "target", Path = "target" in {
101101
def MaxChildrenDepth: Property<"max-children-depth", "UInt64">,
102102
DefaultUnsignedValue<5>,
103103
Desc<"Maximum depth to expand children.">;
104-
def PrintBraces: Property<"print-braces", "Boolean">,
105-
DefaultTrue,
106-
Desc<"Print curly braces around structures when displaying variable values.">;
107104
def MaxSummaryLength: Property<"max-string-summary-length", "UInt64">,
108105
DefaultUnsignedValue<1024>,
109106
Desc<"Maximum number of characters to show when using %s in summary strings.">;

lldb/test/API/functionalities/data-formatter/print-braces/TestPrintBraces.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def test_default_has_braces(self):
1212

1313
def test_no_braces(self):
1414
self.build()
15-
self.runCmd("settings set target.print-braces false")
15+
self.runCmd("settings set print-braces false")
1616
lldbutil.run_to_source_breakpoint(self, "break here", lldb.SBFileSpec("main.c"))
1717
self.expect("frame variable s", matching=False, substrs=["{", "}"])
1818
self.expect("frame variable s", substrs=["x = 1", "y = 2", "z = 3"])

0 commit comments

Comments
 (0)