[Lldb-commits] [PATCH] D67369: Implement DW_OP_convert

Adrian Prantl via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 9 13:39:58 PDT 2019


aprantl created this revision.
aprantl added reviewers: jasonmolenda, davide, labath, clayborg.
Herald added a project: LLDB.
aprantl added a reviewer: jakubjelinek.

This patch adds basic support for DW_OP_convert[1] for integer types. Recent versions of LLVM's optimizer may insert this opcode into DWARF expressions. DW_OP_convert is effectively a type cast operation that takes a reference to a base type DIE (or zero) and then casts the value at the top of the DWARF stack to that type. Internally this works by changing the bit size of the APInt that is used as backing storage for LLDB's DWARF stack.

I managed to write a unit test for this by implementing a mock YAML object file / module that takes debug info sections in yaml2obj format.

[1] Typed DWARF stack. http://www.dwarfstd.org/ShowIssue.php?issue=140425.1


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D67369

Files:
  lldb/include/lldb/Core/Section.h
  lldb/include/lldb/Utility/Scalar.h
  lldb/source/Core/Section.cpp
  lldb/source/Expression/DWARFExpression.cpp
  lldb/source/Utility/Scalar.cpp
  lldb/unittests/Expression/DWARFExpressionTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67369.219422.patch
Type: text/x-patch
Size: 20072 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190909/123a14b7/attachment-0001.bin>


More information about the lldb-commits mailing list