[all-commits] [llvm/llvm-project] 4edb7e: [lldb/DWARF] Fix sizes of DW_OP_const[1248][us] an...

Pavel Labath via All-commits all-commits at lists.llvm.org
Tue Nov 10 07:10:32 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 4edb7e34f824ca4adaa55d3668e050166bae2ad4
      https://github.com/llvm/llvm-project/commit/4edb7e34f824ca4adaa55d3668e050166bae2ad4
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2020-11-10 (Tue, 10 Nov 2020)

  Changed paths:
    M lldb/include/lldb/Utility/Scalar.h
    M lldb/source/Expression/DWARFExpression.cpp
    M lldb/unittests/Expression/DWARFExpressionTest.cpp

  Log Message:
  -----------
  [lldb/DWARF] Fix sizes of DW_OP_const[1248][us] and DW_OP_litN results

Dwarf says (Section 2.5.1.1. of DWARF v5) that these operations should
push "generic" (pointer-sized) values. This was not the case for
DW_OP_const operations (which were pushing values based on the size of
arguments), nor DW_OP_litN (which were always pushing 64-bit values).

The practical effect of this that were were unable to display the values
of variables if the size of the DW_OP_const opcode was smaller than the
value of the variable it was describing. This would happen because we
would store this (small) result into a buffer and then would not be able
to read sufficient data out of it (in Value::GetValueAsData). Gcc emits
debug info like this.

Other (more subtle) effects are also possible.

The same fix should be applied to DW_OP_const[us] (leb128 versions), but
I'm not doing that right now, because that would cause us to display
wrong (truncated) values of variables on 32-bit targets (pr48087).

Differential Revision: https://reviews.llvm.org/D90840




More information about the All-commits mailing list