Page MenuHomePhabricator

[lldb] Limit the amount of zeroes we use for padding when printing small floats
ClosedPublic

Authored by teemperor on Aug 30 2019, 5:58 AM.

Details

Summary

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

Diff Detail

Repository
rL LLVM

Event Timeline

teemperor created this revision.Aug 30 2019, 5:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2019, 5:58 AM
teemperor planned changes to this revision.Aug 30 2019, 6:41 AM

Just realised I didn't update any other tests that are maybe broken now due to the changed format.

teemperor requested review of this revision.Aug 31 2019, 10:48 AM

Well, seems like we don't actually test this functionality anywhere else in the test suite ( :( ) so this is good to review.

clayborg accepted this revision.Sep 3 2019, 8:00 AM
This revision is now accepted and ready to land.Sep 3 2019, 8:00 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 4 2019, 4:42 AM