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

[llvm][DebugInfo] Add DW_AT_type to DW_TAG_enumeration_type in non-strict DWARF v2 mode #98335

Merged
merged 4 commits into from
Jul 12, 2024

Commits on Jul 10, 2024

  1. [llvm][DebugInfo] Add DW_AT_type to DW_TAG_enumeration_type in non-st…

    …rict DWARF v2 mode
    
    During testing of llvm#96202 we found that
    when clang set to DWARF v2 was used to build the test file, lldb could not tell
    that the unsigned enum type was in fact unsigned. So it defaulted to signed and
    printed the wrong value.
    
    The reason for this is that DWARFv2 does not include DW_AT_type in DW_TAG_enumeration_type.
    This was added in DWARF v3:
    "The enumeration type entry may also have a DW_AT_type attribute which refers to the
    underlying data type used to implement the enumeration.
    
    In C or C++, the underlying type will be the appropriate integral type determined by the
    compiler from the properties of the enumeration literal values."
    
    I noticed that gcc does emit this attribute for DWARF v2 but not when strict
    DWARF is requested (more details in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16063#c7).
    
    This patch changes to clang to do the same. This will improve the experience of anyone
    using tools that can understand the attribute but for whatever reason are stuck
    building binaries containing v2 only.
    
    You can see a current clang/gcc comparison here: https://godbolt.org/z/eG9Kc9WGf
    
    https://reviews.llvm.org/D42734 added the original code that emitted this
    for >= v3 only.
    DavidSpickett committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    3ca12bb View commit details
    Browse the repository at this point in the history
  2. Expect hex not just 0-9

    DavidSpickett committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    4646b9e View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2024

  1. release note

    DavidSpickett committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    c60a8fa View commit details
    Browse the repository at this point in the history
  2. Appease Sphinx.

    DavidSpickett committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    e022ee1 View commit details
    Browse the repository at this point in the history