public String toString(int caretPosition, boolean newlines, boolean offsets) {
		StringBuilder sb = new StringBuilder();
		for (int step = 0; step < operations.size(); step++) {
			DWARFExpressionOperation op = operations.get(step);

			if (step != 0) {
				sb.append("; ");
				if (newlines) {
					sb.append('\n');
				}
			}
			if (offsets) {
				sb.append(String.format("%3d [%03x]: ", step, op.getOffset()));
			}
			if (caretPosition == step) {
				sb.append(" ==> [");
			}
			int opcode = op.getOpCode();
			if (DWARFExpressionOpCodes.isValidOpcode(opcode)) {
				sb.append(DWARFExpressionOpCodes.toString(opcode));
			}
			else {
				if (opcode >= DWARFExpressionOpCodes.DW_OP_lo_user &&
					opcode <= DWARFExpressionOpCodes.DW_OP_hi_user) {
					int relOpCode = opcode - DWARFExpressionOpCodes.DW_OP_lo_user;
					sb.append(
						DWARFExpressionOpCodes.toString(DWARFExpressionOpCodes.DW_OP_lo_user) +
							"+" + relOpCode + "[" + opcode + "]");
				}
				else {
					sb.append("DW_OP_UNKNOWN[" + opcode + "]");
				}
			}
			for (int operandIndex = 0; operandIndex < op.operands.length; operandIndex++) {
				if (operandIndex == 0) {
					sb.append(':');
				}
				sb.append(' ');
				DWARFExpressionOperandType operandType = op.operandTypes[operandIndex];
				if (operandType != DWARFExpressionOperandType.SIZED_BLOB) {
					long operandValue = op.operands[operandIndex];

					sb.append(DWARFExpressionOperandType.valueToString(operandValue, operandType));
				}
				else {
					sb.append(NumericUtilities.convertBytesToString(op.blob, " "));
				}
			}
			if (caretPosition == step) {
				sb.append(" ] <==");
			}
			if (opcode == DWARFExpressionOpCodes.DW_OP_bra ||
				opcode == DWARFExpressionOpCodes.DW_OP_skip) {
				long destOffset = op.getOperandValue(0) + op.getOffset();
				int destIndex = findOpByOffset(destOffset);
				sb.append(String.format(" /* dest index: %d, offset: %03x */", destIndex,
					(int) destOffset));
			}
		}

		return sb.toString();
	}
Finds the index of an {@link DWARFExpressionOperation operation} by its offset
from the beginning of the expression.

@param offset
@return -1 if there is no op at the specified offset
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/dwarf/expression/DWARFExpression.java