[Lldb-commits] [PATCH] D113362: [formatters] Add a libstdcpp formatter for forward_list and refactor list formatter
    Danil Stefaniuc via Phabricator via lldb-commits 
    lldb-commits at lists.llvm.org
       
    Tue Nov  9 02:18:28 PST 2021
    
    
  
danilashtefan added inline comments.
================
Comment at: lldb/examples/synthetic/gnu_libstdcpp.py:92
+                    return 1               
+            size = self.node_value_pointer_offset
             current = self.next
----------------
wallace wrote:
> let's better initialize this with a simpler value
Initial size does also depend on the has_prev value, so I decided to initialize it is this simple way
================
Comment at: lldb/examples/synthetic/gnu_libstdcpp.py:95
                 current = current.GetChildMemberWithName('_M_next')
-            return (size - 1)
+            return (size - size_correction)
         except:
----------------
wallace wrote:
> what is this? try to come up with a better name with documentation to make this easier to understand
Size to return also depends on the has_prev. I have simplified the previously introduced if case 
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113362/new/
https://reviews.llvm.org/D113362
    
    
More information about the lldb-commits
mailing list