[Lldb-commits] [PATCH] D77108: [lldb/DWARF] Fix evaluator crash when accessing empty stack

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 31 10:33:39 PDT 2020

labath added a comment.

In D77108#1952818 <https://reviews.llvm.org/D77108#1952818>, @aprantl wrote:

> For the future, a clean solution would be extending the macros in Dwarf.def to list the stack effects in the definitions of the DW_OP_*, for example
>   // opcode, name, version, vendor, in, out
>   HANDLE_DW_OP(0x12, dup, 2, DWARF, 1, 2)

That sounds very interesting. However,

> Is there any DWARF operator where the stack effect (number of consumes & produced stack elements) isn't statically known?

`DW_OP_pick` comes to mind.  It always produces one item, but it can reach arbitrarily deep into the dwarf stack (without consuming that item). Glancing through the dwarf spec, it looks like this is the only such operator, so special-casing that wouldn't be too bad...

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list