[Lldb-commits] [PATCH] D112537: [formatters] Add a libstdcpp formatter for set and unify tests across stdlibs

walter erquinigo via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 27 09:09:40 PDT 2021


wallace requested changes to this revision.
wallace added a comment.
This revision now requires changes to proceed.

pretty good! Just some cosmetic changes needed and that's it



================
Comment at: lldb/examples/synthetic/gnu_libstdcpp.py:318
 
-class StdMapSynthProvider:
+class StdSetOrMapSynthProvider:
 
----------------
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.
  '''


================
Comment at: lldb/examples/synthetic/gnu_libstdcpp.py:324-325
         self.count = None
         logger >> "Providing synthetic children for a map named " + \
             str(valobj.GetName())
 
----------------
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())


================
Comment at: lldb/examples/synthetic/gnu_libstdcpp.py:352
         try:
             # we will set this to True if we find out that discovering a node in the map takes more steps than the overall size of the RB tree
             # if this gets set to True, then we will merrily return None for
----------------



================
Comment at: lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/set/TestDataFormatterGenericSet.py:153-154
+        self.do_test_ref_and_ptr(USE_LIBCPP)
+
+
----------------
remove these lines


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112537/new/

https://reviews.llvm.org/D112537



More information about the lldb-commits mailing list