This adds the data formatters for chrono duration typedefs.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp | ||
---|---|---|
994 | Nice! | |
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/chrono/TestDataFormatterLibcxxChrono.py | ||
24 | You probably copied & pasted this — this is no longer needed since every test function is now running in its own instance. | |
34 | This is not guaranteed behavior and is highly specific on the actual compiler. I would probably just remove this first sets of tests. | |
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/chrono/main.cpp | ||
18 | can you change this to a function call like std::cout()<<"break here\n"; It's not guaranteed that all compilers actually generate code for this line that results in a breakpoint opportunity. |
Thanks for doing this!
Question to all: Should the summary string include the unit? lldb doesn't always show the type, so it could help comprehension if the unit is included. For example 60s instead of 60.
lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp | ||
---|---|---|
984–991 | there's some regex grouping that doesn't seem to be needed. |
I was wondering about that too, but I wasn't sure whether that was wanted. If we do that what do you prefer for micro seconds us or µs. The latter uses Unicode. The C++ Standard allows both http://eel.is/c++draft/time.duration.io.
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/chrono/TestDataFormatterLibcxxChrono.py | ||
---|---|---|
24 | I indeed copy-pasted the vector code; it's the first time I look at these formatters. |
lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp | ||
---|---|---|
984–991 | Earlier testing without grouping didn't work. Since the next iteration uses units here is a regex per type. |
@Mordante @Michael137 This seems to fail on older versions of compiler/libcxx https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-matrix/7247/ You can probably fix this by just requiring a minimum clang version in the tests
there's some regex grouping that doesn't seem to be needed.