[Lldb-commits] [lldb] [lldb][libc++] Adds local_t clock data formatters. (PR #88178)

Mark de Wever via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 12 10:36:32 PDT 2024


================
@@ -1068,6 +1068,29 @@ static void LoadLibCxxFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {
                     eTypeOptionCascade,
                 true);
 
+  AddCXXSummary(
+      cpp_category_sp,
+      lldb_private::formatters::LibcxxChronoLocalSecondsSummaryProvider,
+      "libc++ std::chrono::local_seconds summary provider",
+      "^std::__[[:alnum:]]+::chrono::time_point<"
+      "std::__[[:alnum:]]+::chrono::local_t, "
+      "std::__[[:alnum:]]+::chrono::duration<long long, "
----------------
mordante wrote:

It is, seconds is defined as 

using seconds      = duration<[signed integer type of at least 35 bits](http://eel.is/c++draft/time.syn#def:signed_integer_type_of_at_least_35_bits)>;

In libc++ this is hard coded to `long long` on all platforms
https://github.com/llvm/llvm-project/blob/main/libcxx/include/__chrono/duration.h#L287

There is some value in it to future proof it, if we ever get a platform where long is 64 bit and long long 128 bit.

I'll also update `LibcxxChronoSysSecondsSummaryProvider` above.

https://github.com/llvm/llvm-project/pull/88178


More information about the lldb-commits mailing list