This diff adds a data formatter for libstdcpp's set. Besides, it unifies the tests for set for libcxx and libstdcpp for maintainability.
just some minor things left
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.
remove this line
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
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
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
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. '''
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())
remove these lines
yes, the code is good as you did it
Just fix that last thing and I'll land your patch :) Thanks
actual python documentation uses ''' for comments, not #