summaryrefslogtreecommitdiffstats
path: root/lldb/source
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/Core/Debugger.cpp11
-rw-r--r--lldb/source/Core/DumpDataExtractor.cpp3
-rw-r--r--lldb/source/Target/Target.cpp6
-rw-r--r--lldb/source/Target/TargetProperties.td3
4 files changed, 19 insertions, 4 deletions
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index 683ecefe097..2e293f57c81 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -257,7 +257,14 @@ Status Debugger::SetPropertyValue(const ExecutionContext *exe_ctx,
llvm::StringRef value) {
bool is_load_script =
(property_path == "target.load-script-from-symbol-file");
- bool is_escape_non_printables = (property_path == "escape-non-printables");
+ // These properties might change how we visualize data.
+ bool invalidate_data_vis = (property_path == "escape-non-printables");
+ invalidate_data_vis |=
+ (property_path == "target.max-zero-padding-in-float-format");
+ if (invalidate_data_vis) {
+ DataVisualization::ForceUpdate();
+ }
+
TargetSP target_sp;
LoadScriptFromSymFile load_script_old_value;
if (is_load_script && exe_ctx->GetTargetSP()) {
@@ -300,8 +307,6 @@ Status Debugger::SetPropertyValue(const ExecutionContext *exe_ctx,
}
}
}
- } else if (is_escape_non_printables) {
- DataVisualization::ForceUpdate();
}
}
return error;
diff --git a/lldb/source/Core/DumpDataExtractor.cpp b/lldb/source/Core/DumpDataExtractor.cpp
index 30c3a821c98..af8239332b1 100644
--- a/lldb/source/Core/DumpDataExtractor.cpp
+++ b/lldb/source/Core/DumpDataExtractor.cpp
@@ -563,7 +563,8 @@ lldb::offset_t lldb_private::DumpDataExtractor(
llvm::SmallVector<char, 256> sv;
// Show full precision when printing float values
const unsigned format_precision = 0;
- const unsigned format_max_padding = 100;
+ const unsigned format_max_padding =
+ target_sp->GetMaxZeroPaddingInFloatFormat();
size_t item_bit_size = item_byte_size * 8;
if (item_bit_size == ast->getTypeSize(ast->FloatTy)) {
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index 5675e788a21..c92d63882c0 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -3789,6 +3789,12 @@ bool TargetProperties::GetEnableSyntheticValue() const {
nullptr, idx, g_target_properties[idx].default_uint_value != 0);
}
+uint32_t TargetProperties::GetMaxZeroPaddingInFloatFormat() const {
+ const uint32_t idx = ePropertyMaxZeroPaddingInFloatFormat;
+ return m_collection_sp->GetPropertyAtIndexAsUInt64(
+ nullptr, idx, g_target_properties[idx].default_uint_value);
+}
+
uint32_t TargetProperties::GetMaximumNumberOfChildrenToDisplay() const {
const uint32_t idx = ePropertyMaxChildrenCount;
return m_collection_sp->GetPropertyAtIndexAsSInt64(
diff --git a/lldb/source/Target/TargetProperties.td b/lldb/source/Target/TargetProperties.td
index 7fa8f1cdd8d..9079c3cf427 100644
--- a/lldb/source/Target/TargetProperties.td
+++ b/lldb/source/Target/TargetProperties.td
@@ -60,6 +60,9 @@ let Definition = "target" in {
def SaveObjects: Property<"save-jit-objects", "Boolean">,
DefaultFalse,
Desc<"Save intermediate object files generated by the LLVM JIT">;
+ def MaxZeroPaddingInFloatFormat: Property<"max-zero-padding-in-float-format", "UInt64">,
+ DefaultUnsignedValue<6>,
+ Desc<"The maximum number of zeroes to insert when displaying a very small float before falling back to scientific notation.">;
def MaxChildrenCount: Property<"max-children-count", "SInt64">,
DefaultUnsignedValue<256>,
Desc<"Maximum number of children to expand in any level of depth.">;
OpenPOWER on IntegriCloud