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

Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Move property to debugger, not target
  • Loading branch information
kastiglione committed Apr 23, 2026
commit 1ad2d88941a1f4f29d33a4b7184e1f653613a122
2 changes: 2 additions & 0 deletions lldb/include/lldb/Core/Debugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ class Debugger : public std::enable_shared_from_this<Debugger>,

bool GetAutoOneLineSummaries() const;

bool GetPrintBraces() const;

bool GetAutoIndent() const;

bool SetAutoIndent(bool b);
Expand Down
2 changes: 0 additions & 2 deletions lldb/include/lldb/Target/Target.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,6 @@ class TargetProperties : public Properties {
/// otherwise false.
std::pair<uint32_t, bool> GetMaximumDepthOfChildrenToDisplay() const;

bool GetPrintBraces() const;

uint32_t GetMaximumSizeOfStringSummary() const;

uint32_t GetMaximumMemReadSize() const;
Expand Down
4 changes: 4 additions & 0 deletions lldb/source/Core/CoreProperties.td
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ let Definition = "debugger", Path = "" in {
Global,
DefaultTrue,
Desc<"If true, LLDB will automatically display small structs in one-liner format (default: true).">;
def PrintBraces: Property<"print-braces", "Boolean">,
Global,
DefaultTrue,
Desc<"Print curly braces around structures when displaying variable values.">;
def AutoIndent: Property<"auto-indent", "Boolean">,
Global,
DefaultTrue,
Expand Down
6 changes: 6 additions & 0 deletions lldb/source/Core/Debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,12 @@ bool Debugger::GetAutoOneLineSummaries() const {
idx, g_debugger_properties[idx].default_uint_value != 0);
}

bool Debugger::GetPrintBraces() const {
const uint32_t idx = ePropertyPrintBraces;
return GetPropertyAtIndexAs<bool>(
idx, g_debugger_properties[idx].default_uint_value != 0);
}

bool Debugger::GetEscapeNonPrintables() const {
const uint32_t idx = ePropertyEscapeNonPrintables;
return GetPropertyAtIndexAs<bool>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void OptionGroupValueObjectDisplay::OptionParsingStarting(
auto max_depth_config = target_sp->GetMaximumDepthOfChildrenToDisplay();
max_depth = std::get<uint32_t>(max_depth_config);
max_depth_is_default = std::get<bool>(max_depth_config);
print_braces = target_sp->GetPrintBraces();
print_braces = target_sp->GetDebugger().GetPrintBraces();
} else {
// If we don't have any targets, then dynamic values won't do us much good.
use_dynamic = lldb::eNoDynamicValues;
Expand Down
6 changes: 0 additions & 6 deletions lldb/source/Target/Target.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5004,12 +5004,6 @@ TargetProperties::GetMaximumDepthOfChildrenToDisplay() const {
return {option_value->GetCurrentValue(), is_default};
}

bool TargetProperties::GetPrintBraces() const {
const uint32_t idx = ePropertyPrintBraces;
return GetPropertyAtIndexAs<bool>(
idx, g_target_properties[idx].default_uint_value != 0);
}

uint32_t TargetProperties::GetMaximumSizeOfStringSummary() const {
const uint32_t idx = ePropertyMaxSummaryLength;
return GetPropertyAtIndexAs<uint64_t>(
Expand Down
3 changes: 0 additions & 3 deletions lldb/source/Target/TargetProperties.td
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ let Definition = "target", Path = "target" in {
def MaxChildrenDepth: Property<"max-children-depth", "UInt64">,
DefaultUnsignedValue<5>,
Desc<"Maximum depth to expand children.">;
def PrintBraces: Property<"print-braces", "Boolean">,
DefaultTrue,
Desc<"Print curly braces around structures when displaying variable values.">;
def MaxSummaryLength: Property<"max-string-summary-length", "UInt64">,
DefaultUnsignedValue<1024>,
Desc<"Maximum number of characters to show when using %s in summary strings.">;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_default_has_braces(self):

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