[all-commits] [llvm/llvm-project] ef3feb: [lldb][DWARFASTParserClang] Fetch constant value f...

Michael Buch via All-commits all-commits at lists.llvm.org
Mon Nov 6 02:24:19 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ef3febadf606c2fc4f1ad8d85a7ecdde16e4cbb3
      https://github.com/llvm/llvm-project/commit/ef3febadf606c2fc4f1ad8d85a7ecdde16e4cbb3
  Author: Michael Buch <michaelbuch12 at gmail.com>
  Date:   2023-11-06 (Mon, 06 Nov 2023)

  Changed paths:
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
    M lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
    M lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
    M lldb/test/API/lang/cpp/const_static_integral_member/main.cpp

  Log Message:
  -----------
  [lldb][DWARFASTParserClang] Fetch constant value from variable defintion if available (#71004)

https://github.com/llvm/llvm-project/pull/70639 proposes moving the
`DW_AT_const_value` on inline static members from the declaration DIE to
the definition DIE. This patch makes sure the LLDB's expression
evaluator can continue to support static initialisers even if the
declaration doesn't have a `DW_AT_const_value` anymore.

Previously the expression evaluator would find the constant for a
VarDecl from its declaration `DW_TAG_member` DIE. In cases where the
initialiser was specified out-of-class, LLDB could find it during symbol
resolution.

However, neither of those will work for constants, since we don't have a
constant attribute on the declaration anymore and we don't have
constants in the symbol table.

**Testing**

* If https://github.com/llvm/llvm-project/pull/70639 were to land
without this patch then most of the `TestConstStaticIntegralMember.py`
would start failing




More information about the All-commits mailing list