================ @@ -470,6 +469,50 @@ Some opcodes do not influence the final DWARF expression directly, instead encoding information logically belonging to the debug records which use them. ``` + +(symbolic-control-flow)= + +##### Symbolic Control Flow + +DWARF `DW_OP_bra` and `DW_OP_skip` have a two-byte offset in +`[-32768, 32767]`, but we don't know that offset until we emit the expression, +so we use three pseudo-ops with label IDs that CodeGen resolves during +emission: + +- `DW_OP_LLVM_label, ID` marks a destination and emits no bytes. +- `DW_OP_LLVM_bra, ID` branches to label `ID` when the value on top of the + expression stack is non-zero. +- `DW_OP_LLVM_skip, ID` always branches to label `ID`. + +Label IDs are local to an expression: + +- Each ID can have at most one label, and every branch needs a matching label + in the same expression. +- Labels don't need branches, and consecutive labels have the same byte + offset. +- Branches can go forward, backward, to themselves, or form cycles. + +There are a few other restrictions: ---------------- echristo wrote:
Good point, they're also not nearly as dire as written :) https://github.com/llvm/llvm-project/pull/210850 _______________________________________________ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
