llvm-project/lldb
Raphael Isemann 5814255e1a [lldb] Always round down in NSDate's formatter to match NSDate's builtin format
Summary:

When printing an NSDate (for example with `NSLog` or `po`) the seconds value is
always rounded down. LLDB's own formatter however isn't following that behaviour
which leads to situations where the formatted result is sometimes one second
off. For example:

```
(lldb) p [NSDate dateWithTimeIntervalSince1970:0.1]
(__NSTaggedDate *) $1 = [...] 1970-01-01 00:00:01 UTC
(lldb) po [NSDate dateWithTimeIntervalSince1970:0.1]
1970-01-01 00:00:00 +0000

(lldb) p [NSDate dateWithTimeIntervalSince1970:0.6]
(__NSTaggedDate *) $4 =[...] 1970-01-01 00:00:01 UTC
(lldb) po [NSDate dateWithTimeIntervalSince1970:0.6]
1970-01-01 00:00:00 +0000
```

This patch just always rounds down the seconds value we get from the NSDate
object.

Fixes rdar://65084800

Reviewers: mib, davide

Reviewed By: mib

Subscribers: JDevlieghere

Differential Revision: https://reviews.llvm.org/D83221
2020-07-06 16:59:37 +02:00
..
bindings [lldb/api] Improve error reporting in SBBreakpoint::AddName (NFCI) 2020-07-01 12:45:05 +02:00
cmake [lldb/Lua] Require Lua 5.3 2020-06-23 09:24:01 -07:00
docs [lldb/Docs] Add more details to the issues with custom Python installs on macOS 2020-06-25 10:53:30 -07:00
examples As part of using inclusive language within the llvm project, 2020-06-19 14:51:04 -07:00
include/lldb [lldb/Utility] Merge Scalar::Get(Value)TypeAsCString 2020-07-06 10:34:12 +02:00
packages/Python [TestReturnValue] Skip based on architecutre, not platform. 2020-06-30 12:48:23 -07:00
resources
scripts [lldb/Scripts] 2020-06-30 17:06:14 +02:00
source [lldb] Always round down in NSDate's formatter to match NSDate's builtin format 2020-07-06 16:59:37 +02:00
test [lldb] Always round down in NSDate's formatter to match NSDate's builtin format 2020-07-06 16:59:37 +02:00
third_party/Python/module [lldb] NFC: Fix trivial typo in comments, documents, and messages 2020-04-07 01:06:16 +09:00
tools debugserver: Return a nullptr in GetPlatformString() 2020-07-01 11:06:25 -07:00
unittests [lldb/Utility] Merge Scalar::Get(Value)TypeAsCString 2020-07-06 10:34:12 +02:00
utils [lldb/Utils] Serialize exit code in lldb-repro.py 2020-05-05 16:05:49 -07:00
.clang-format
.clang-tidy [lldb] Add .clang-tidy with customization to disable readability-identifier-naming 2020-03-09 12:50:28 -07:00
.gitignore Add .noindex to the gitignore 2019-04-05 17:57:42 +00:00
CMakeLists.txt [lldb/CMake] Only CMAKE_CFG_INTDIR if it's not '.' 2020-03-27 17:49:00 -07:00
CODE_OWNERS.txt [lldb][NFC] Cleanup mentions and code related to lldb-mi 2019-07-19 15:55:23 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
use_lldb_suite_root.py