[Bug 44621] New: LLDB may use wrong operand size of DW_OP_call_ref

Bug ID 44621
Summary LLDB may use wrong operand size of DW_OP_call_ref
Product lldb
Version 10.0
Hardware All
OS All
Status NEW
Severity normal
Priority P
Component All Bugs
Assignee lldb-dev@lists.llvm.org
Reporter ikudrin@accesssoftek.com
CC jdevlieghere@apple.com, llvm-bugs@lists.llvm.org

In lldb/source/Expression/DWARFExpression.cpp, GetOpcodeDataSize(),
DW_OP_call_ref is handled in the same way as DW_OP_addr:

  switch (op) {
  case DW_OP_addr:
  case DW_OP_call_ref: // 0x9a 1 address sized offset of DIE (DWARF3)
    return data.GetAddressByteSize();

According to the DWARF standard, the operand size of DW_OP_call_ref is 4 or 8
bytes depending on the DWARF format (32- or 64-bit) and not an address size on
the target machine, as for DW_OP_addr.

Admittedly, I do not have a sample. I found that reviewing the code.