This diff adds a data formatter for libstdcpp's set. Besides, it unifies the tests for set for libcxx and libstdcpp for maintainability.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
just some minor things left
| lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp | ||
|---|---|---|
| 930–931 | to mimic the libcxx case that you can see in the line 710 of https://lldb.llvm.org/cpp_reference/CPlusPlusLanguage_8cpp_source.html, you can do stl_summary_flags.SetSkipPointers(false) in line 932 of this file. Then both standard libraries will be handled the same way. Make sure to execute the relevant tests for vector, map, set and list for libstdcpp. | |
| lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/set/Makefile | ||
| 2–3 | remove this line | |
| lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/set/TestDataFormatterGenericSet.py | ||
| 32–39 | can you add additional assertions like the one you did in https://reviews.llvm.org/D112180 that uses ValueCheck? | |
Besides, given that you are using the same python implementation for map and set, better rename the class to StdSeOrMapSynthProvider and add a comment mentioning that it works both for set and maps because they have the same underlying structure
| lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/set/TestDataFormatterGenericSet.py | ||
|---|---|---|
| 32–39 | I have made check method more generic and less verbose. Before it was specifically checking the "ii" variable, that was a set<int> of size 7. With value check approach we can now test set<string> and others. I guess, that I can delete all of the self.expect() and simply call check method with the expected size. Please, let me know if I should do it or leave it as it is. Thanks | |
pretty good! Just some cosmetic changes needed and that's it
| lldb/examples/synthetic/gnu_libstdcpp.py | ||
|---|---|---|
| 317–321 | Make a comment above like ''' Set and Map have the same underlying data structure, therefore we can use exactly the same implementation for the formatter. ''' | |
| 327–329 | As this is not just for maps, you can do something like: self.kind = "set" if "set" in valobj.GetTypeName() else "map"
logger >> "Providing synthetic children for a " self.kind + " named " + \
str(valobj.GetName()) | |
| 356 | ||
| lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/set/TestDataFormatterGenericSet.py | ||
| 153–154 | remove these lines | |
| lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/set/TestDataFormatterGenericSet.py | ||
|---|---|---|
| 32–39 | yes, the code is good as you did it | |
Just fix that last thing and I'll land your patch :) Thanks
| lldb/examples/synthetic/gnu_libstdcpp.py | ||
|---|---|---|
| 317–321 | actual python documentation uses ''' for comments, not # | |
Make a comment above like