[Lldb-commits] [PATCH] D67001: [lldb] Limit the amount of zeroes we use for padding when printing small floats

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 30 06:00:58 PDT 2019


teemperor created this revision.
teemperor added a reviewer: LLDB.
Herald added subscribers: lldb-commits, JDevlieghere.
Herald added a project: LLDB.

We got a radar that printing small floats is not very user-friendly in LLDB as we print them with up to
100 leading zeroes before starting to use scientific notation. This patch changes this by already using
scientific notation when we hit 6 padding zeroes by default and moves this value into a target setting
so that users can just set this number back to 100 if they for some reason preferred the old behaviour.

This new setting is influencing how we format data, so that's why we have to reset the data visualisation
cache when it is changed.

Note that we have always been using scientific notation for large numbers because it seems that
the LLVM implementation doesn't support printing out the padding zeroes for them. I would have fixed
that if it was trivial, but looking at the LLVM implementation for this it seems that this is not as trivial
as it sounds. I would say we look into this if we ever get a bug report about someone wanting to have
a large amount of trailing zeroes in their numbers instead of using scientific notation.

Fixes rdar://39744137


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D67001

Files:
  lldb/include/lldb/Target/Target.h
  lldb/packages/Python/lldbsuite/test/functionalities/float-display/Makefile
  lldb/packages/Python/lldbsuite/test/functionalities/float-display/TestFloatDisplay.py
  lldb/packages/Python/lldbsuite/test/functionalities/float-display/main.c
  lldb/source/Core/Debugger.cpp
  lldb/source/Core/DumpDataExtractor.cpp
  lldb/source/Target/Target.cpp
  lldb/source/Target/TargetProperties.td

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67001.218072.patch
Type: text/x-patch
Size: 11445 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190830/12481459/attachment-0001.bin>


More information about the lldb-commits mailing list