Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance of .debug_names lookups when DW_IDX_parent attributes are used #91808

Closed
wants to merge 2 commits into from

Commits on May 10, 2024

  1. Improve performance of .debug_names lookups when DW_IDX_parent attrib…

    …utes are used.
    
    When a .debug_names table has entries that use the DW_IDX_parent attributes, we can end up with entries in the .debug_names table that are not full definitions. This is because a class that is foward declared, can contain types. For example:
    
    0x0090cdbf: DW_TAG_compile_unit
                  DW_AT_producer	("clang version 15.0.7")
                  DW_AT_language	(DW_LANG_C_plus_plus_14)
                  DW_AT_name	("UniqueInstance.cpp")
    
    0x0090cdc7:   DW_TAG_namespace
                    DW_AT_name	("std")
    
    0x0090cdd5:     DW_TAG_class_type
                      DW_AT_name	("ios_base")
                      DW_AT_declaration	(true)
    
    0x0090cdd7:       DW_TAG_class_type
                        DW_AT_name	("Init")
                        DW_AT_declaration	(true)
    
    0x0090cdda:       DW_TAG_typedef
                        DW_AT_type	(0x0090ce4e "std::_Ios_Seekdir")
                        DW_AT_name	("seekdir")
                        DW_AT_decl_file	(0x11)
                        DW_AT_decl_line	(479)
    
    0x0090cde4:       DW_TAG_typedef
                        DW_AT_type	(0x0090ce45 "std::_Ios_Openmode")
                        DW_AT_name	("openmode")
                        DW_AT_decl_file	(0x11)
                        DW_AT_decl_line	(447)
    
    0x0090cdee:       DW_TAG_typedef
                        DW_AT_type	(0x0090ce3c "std::_Ios_Iostate")
                        DW_AT_name	("iostate")
                        DW_AT_decl_file	(0x11)
                        DW_AT_decl_line	(416)
    
    0x0090cdf8:       NULL
    
    "std::ios_base" is forward declared and it contains typedefs whose entries in the .debug_names table will point to the DIE at offset 0x0090cdd5. These entries cause our type lookups to try and parse a TON of forward declarations and waste time and resources.
    
    This fix makes sure when/if we find an entry in the .debug_names table, we don't process it if it has a DW_AT_declaration(true) attribute.
    clayborg committed May 10, 2024
    Configuration menu
    Copy the full SHA
    0cc1be6 View commit details
    Browse the repository at this point in the history

Commits on May 29, 2024

  1. Fix comment as suggested.

    clayborg committed May 29, 2024
    Configuration menu
    Copy the full SHA
    8faad14 View commit details
    Browse the repository at this point in the history