This is an archive of the discontinued LLVM Phabricator instance.

[formatters] List and forward_list capping_size determination and application
ClosedPublic

Authored by danilashtefan on Nov 23 2021, 3:56 AM.

Details

Summary

This diff is adding the capping_size determination for the list and forward list, to limit the number of children to be displayed. Also it modifies and unifies tests for libcxx and libstdcpp list data formatter.

Diff Detail

Event Timeline

danilashtefan requested review of this revision.Nov 23 2021, 3:56 AM
danilashtefan created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptNov 23 2021, 3:56 AM
danilashtefan added inline comments.Nov 23 2021, 4:46 AM
lldb/examples/synthetic/gnu_libstdcpp.py
60–62

I will change this to the following:

`if not _list_uses_loop_detector of self.has_prev:

logger >> "Asked not to use loop detection
 return False"`
wallace requested changes to this revision.Nov 23 2021, 8:42 AM
wallace added inline comments.
lldb/examples/synthetic/gnu_libstdcpp.py
14–16

you have to use > instead of >=

34–38

this shouldn't fail, so remove the try/except

59–66

these changes shouldn't be here, as has_loop should only be called if the size is not present as a member of the variable. num_children is the method that is called by lldb to determine the size of the structure, which invokes num_children_impl only if the count is not a member variable. So I have the impression that this code is redundant

lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/forward_list/TestDataFormatterGenericForwardList.py
66

create another test in which you set the setting to 3, for example, and then check the output

This revision now requires changes to proceed.Nov 23 2021, 8:42 AM
danilashtefan marked 3 inline comments as done.

Done!

wallace requested changes to this revision.Nov 23 2021, 10:45 AM

add generic tests for list

This revision now requires changes to proceed.Nov 23 2021, 10:45 AM

List tests unification for libcxx and libstdcpp

Deleted duplicated tests from both platforms

danilashtefan retitled this revision from [formatters] Draft PR for the list nad forward_list capping_size to [formatters] List and forward_list capping_size determination and application.Nov 23 2021, 1:29 PM
danilashtefan edited the summary of this revision. (Show Details)
wallace accepted this revision.Nov 23 2021, 1:45 PM
This revision is now accepted and ready to land.Nov 23 2021, 1:45 PM
This revision was landed with ongoing or failed builds.Nov 23 2021, 2:19 PM
This revision was automatically updated to reflect the committed changes.
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/main.cpp