Home | History | Annotate | Download | only in Expression

Lines Matching refs:stack

333         case DW_OP_pick:    s->Printf("DW_OP_pick(0x%2.2x) ", m_data.GetU8(&offset)); break;          // 0x15 1 1-byte stack index
594 // case DW_OP_APPLE_assign: // 0xF1 - pops value off and assigns it to second item on stack (2nd item must have assignable context)
597 // case DW_OP_APPLE_address_of: // 0xF2 - gets the address of the top stack item (top item must be a variable, or have value_type that is an address already)
600 // case DW_OP_APPLE_value_of: // 0xF3 - pops the value off the stack and pushes the value of that object (top item must be a variable, or expression local)
603 // case DW_OP_APPLE_deref_type: // 0xF4 - gets the address of the top stack item (top item must be a variable, or a clang type)
927 case DW_OP_pick: // 0x15 1 1-byte stack index
1311 std::vector<Value> stack;
1325 stack.push_back(*initial_value_ptr);
1349 size_t count = stack.size();
1350 log->Printf("Stack before operation has %lu values:", count);
1355 stack[i].Dump(&new_value);
1367 stack.push_back(Scalar(opcodes.GetAddress(&offset)));
1368 stack.back().SetValueType (Value::eValueTypeFileAddress);
1393 // stack.push_back(load_addr);
1409 // DESCRIPTION: Pops the top stack entry and treats it as an address.
1416 Value::ValueType value_type = stack.back().GetValueType();
1421 void *src = (void *)stack.back().GetScalar().ULongLong();
1424 stack.back().GetScalar() = ptr;
1425 stack.back().ClearContext();
1433 lldb::addr_t pointer_addr = stack.back().GetScalar().ULongLong(LLDB_INVALID_ADDRESS);
1441 stack.back().GetScalar() = addr_data.GetPointer(&addr_data_offset);
1442 stack.back().ClearContext();
1480 // stack entry and treats it as an address. The value retrieved from that
1487 // on the expression stack.
1492 Value::ValueType value_type = stack.back().GetValueType();
1497 void *src = (void *)stack.back().GetScalar().ULongLong();
1516 stack.back().GetScalar() = ptr;
1517 stack.back().ClearContext();
1525 lldb::addr_t pointer_addr = stack.back().GetScalar().ULongLong(LLDB_INVALID_ADDRESS);
1534 case 1: stack.back().GetScalar() = addr_data.GetU8(&addr_data_offset); break;
1535 case 2: stack.back().GetScalar() = addr_data.GetU16(&addr_data_offset); break;
1536 case 4: stack.back().GetScalar() = addr_data.GetU32(&addr_data_offset); break;
1537 case 8: stack.back().GetScalar() = addr_data.GetU64(&addr_data_offset); break;
1538 default: stack.back().GetScalar() = addr_data.GetPointer(&addr_data_offset);
1540 stack.back().ClearContext();
1578 // the top of the stack is treated as an address. The second stack
1581 // stack elements are popped, a data item is retrieved through an
1583 // stack top. In the DW_OP_xderef_size operation, however, the size in
1589 // on the expression stack.
1599 // the top of the stack is treated as an address. The second stack entry
1601 // that support multiple address spaces. The top two stack elements are
1603 // address calculation and pushed as the new stack top. The size of the
1628 case DW_OP_const1u : stack.push_back(Scalar(( uint8_t)opcodes.GetU8 (&offset))); break;
1629 case DW_OP_const1s : stack.push_back(Scalar(( int8_t)opcodes.GetU8 (&offset))); break;
1630 case DW_OP_const2u : stack.push_back(Scalar((uint16_t)opcodes.GetU16 (&offset))); break;
1631 case DW_OP_const2s : stack.push_back(Scalar(( int16_t)opcodes.GetU16 (&offset))); break;
1632 case DW_OP_const4u : stack.push_back(Scalar((uint32_t)opcodes.GetU32 (&offset))); break;
1633 case DW_OP_const4s : stack.push_back(Scalar(( int32_t)opcodes.GetU32 (&offset))); break;
1634 case DW_OP_const8u : stack.push_back(Scalar((uint64_t)opcodes.GetU64 (&offset))); break;
1635 case DW_OP_const8s : stack.push_back(Scalar(( int64_t)opcodes.GetU64 (&offset))); break;
1636 case DW_OP_constu : stack.push_back(Scalar(opcodes.GetULEB128 (&offset))); break;
1637 case DW_OP_consts : stack.push_back(Scalar(opcodes.GetSLEB128 (&offset))); break;
1642 // DESCRIPTION: duplicates the value at the top of the stack
1645 if (stack.empty())
1648 error_ptr->SetErrorString("Expression stack empty for DW_OP_dup.");
1652 stack.push_back(stack.back());
1658 // DESCRIPTION: pops the value at the top of the stack
1661 if (stack.empty())
1664 error_ptr->SetErrorString("Expression stack empty for DW_OP_drop.");
1668 stack.pop_back();
1674 // DESCRIPTION: Duplicates the entry currently second in the stack at
1675 // the top of the stack.
1678 if (stack.size() < 2)
1681 error_ptr->SetErrorString("Expression stack needs at least 2 items for DW_OP_over.");
1685 stack.push_back(stack[stack.size() - 2]);
1691 // OPERANDS: uint8_t index into the current stack
1692 // DESCRIPTION: The stack entry with the specified index (0 through 255,
1693 // inclusive) is pushed on the stack
1698 if (pick_idx < stack.size())
1699 stack.push_back(stack[pick_idx]);
1712 // DESCRIPTION: swaps the top two stack entries. The entry at the top
1713 // of the stack becomes the second stack entry, and the second entry
1714 // becomes the top of the stack
1717 if (stack.size() < 2)
1720 error_ptr->SetErrorString("Expression stack needs at least 2 items for DW_OP_swap.");
1725 tmp = stack.back();
1726 stack.back() = stack[stack.size() - 2];
1727 stack[stack.size() - 2] = tmp;
1734 // DESCRIPTION: Rotates the first three stack entries. The entry at
1735 // the top of the stack becomes the third stack entry, the second
1736 // entry becomes the top of the stack, and the third entry becomes
1740 if (stack.size() < 3)
1743 error_ptr->SetErrorString("Expression stack needs at least 3 items for DW_OP_rot.");
1748 size_t last_idx = stack.size() - 1;
1749 Value old_top = stack[last_idx];
1750 stack[last_idx] = stack[last_idx - 1];
1751 stack[last_idx - 1] = stack[last_idx - 2];
1752 stack[last_idx - 2] = old_top;
1759 // DESCRIPTION: pops the top stack entry, interprets it as a signed
1764 if (stack.empty())
1767 error_ptr->SetErrorString("Expression stack needs at least 1 item for DW_OP_abs.");
1770 else if (stack.back().ResolveValue(exe_ctx).AbsoluteValue() == false)
1773 error_ptr->SetErrorString("Failed to take the absolute value of the first stack item.");
1781 // DESCRIPTION: pops the top two stack values, performs a bitwise and
1785 if (stack.size() < 2)
1788 error_ptr->SetErrorString("Expression stack needs at least 2 items for DW_OP_and.");
1793 tmp = stack.back();
1794 stack.pop_back();
1795 stack.back().ResolveValue(exe_ctx) = stack.back().ResolveValue(exe_ctx) & tmp.ResolveValue(exe_ctx);
1802 // DESCRIPTION: pops the top two stack values, divides the former second
1803 // entry by the former top of the stack using signed division, and
1807 if (stack.size() < 2)
1810 error_ptr->SetErrorString("Expression stack needs at least 2 items for DW_OP_div.");
1815 tmp = stack.back();
1824 stack.pop_back();
1825 stack.back() = stack.back().ResolveValue(exe_ctx) / tmp.ResolveValue(exe_ctx);
1826 if (!stack.back().ResolveValue(exe_ctx).IsValid())
1839 // DESCRIPTION: pops the top two stack values, subtracts the former top
1840 // of the stack from the former second entry, and pushes the result.
1843 if (stack.size() < 2)
1846 error_ptr->SetErrorString("Expression stack needs at least 2 items for DW_OP_minus.");
1851 tmp = stack.back();
1852 stack.pop_back();
1853 stack.back().ResolveValue(exe_ctx) = stack.back().ResolveValue(exe_ctx) - tmp.ResolveValue(exe_ctx);
1860 // DESCRIPTION: pops the top two stack values and pushes the result of
1861 // the calculation: former second stack entry modulo the former top of
1862 // the stack.
1865 if (stack.size() < 2)
1868 error_ptr->SetErrorString("Expression stack needs at least 2 items for DW_OP_mod.");
1873 tmp = stack.back();
1874 stack.pop_back();
1875 stack.back().ResolveValue(exe_ctx) = stack.back().ResolveValue(exe_ctx) % tmp.ResolveValue(exe_ctx);
1883 // DESCRIPTION: pops the top two stack entries, multiplies them
1887 if (stack.size() < 2)
1890 error_ptr->SetErrorString("Expression stack needs at least 2 items for DW_OP_mul.");
1895 tmp = stack.back();
1896 stack.pop_back();
1897 stack.back().ResolveValue(exe_ctx) = stack.back().ResolveValue(exe_ctx) * tmp.ResolveValue(exe_ctx);
1904 // DESCRIPTION: pops the top stack entry, and pushes its negation.
1907 if (stack.empty())
1910 error_ptr->SetErrorString("Expression stack needs at least 1 item for DW_OP_neg.");
1915 if (stack.back().ResolveValue(exe_ctx).UnaryNegate() == false)
1927 // DESCRIPTION: pops the top stack entry, and pushes its bitwise
1931 if (stack.empty())
1934 error_ptr->SetErrorString("Expression stack needs at least 1 item for DW_OP_not.");
1939 if (stack.back().ResolveValue(exe_ctx).OnesComplement() == false)
1951 // DESCRIPTION: pops the top two stack entries, performs a bitwise or
1955 if (stack.size() < 2)
1958 error_ptr->SetErrorString("Expression stack needs at least 2 items for DW_OP_or.");
1963 tmp = stack.back();
1964 stack.pop_back();
1965 stack.back().ResolveValue(exe_ctx) = stack.back().ResolveValue(exe_ctx) | tmp.ResolveValue(exe_ctx);
1972 // DESCRIPTION: pops the top two stack entries, adds them together, and
1976 if (stack.size() < 2)
1979 error_ptr->SetErrorString("Expression stack needs at least 2 items for DW_OP_plus.");
1984 tmp = stack.back();
1985 stack.pop_back();
1986 stack.back().ResolveValue(exe_ctx) = stack.back().ResolveValue(exe_ctx) + tmp.ResolveValue(exe_ctx);
1993 // DESCRIPTION: pops the top stack entry, adds it to the unsigned LEB128
1997 if (stack.empty())
2000 error_ptr->SetErrorString("Expression stack needs at least 1 item for DW_OP_plus_uconst.");
2007 stack.back().ResolveValue(exe_ctx) += uconst_value;
2008 if (!stack.back().ResolveValue(exe_ctx).IsValid())
2020 // DESCRIPTION: pops the top two stack entries, shifts the former
2022 // of the stack, and pushes the result.
2025 if (stack.size() < 2)
2028 error_ptr->SetErrorString("Expression stack needs at least 2 items for DW_OP_shl.");
2033 tmp = stack.back();
2034 stack.pop_back();
2035 stack.back().ResolveValue(exe_ctx) <<= tmp.ResolveValue(exe_ctx);
2042 // DESCRIPTION: pops the top two stack entries, shifts the former second
2044 // specified by the former top of the stack, and pushes the result.
2047 if (stack.size() < 2)
2050 error_ptr->SetErrorString("Expression stack needs at least 2 items for DW_OP_shr.");
2055 tmp = stack.back();
2056 stack.pop_back();
2057 if (stack.back().ResolveValue(exe_ctx).ShiftRightLogical(tmp.ResolveValue(exe_ctx)) == false)
2069 // DESCRIPTION: pops the top two stack entries, shifts the former second
2072 // top of the stack, and pushes the result.
2075 if (stack.size() < 2)
2078 error_ptr->SetErrorString("Expression stack needs at least 2 items for DW_OP_shra.");
2083 tmp = stack.back();
2084 stack.pop_back();
2085 stack.back().ResolveValue(exe_ctx) >>= tmp.ResolveValue(exe_ctx);
2092 // DESCRIPTION: pops the top two stack entries, performs the bitwise
2096 if (stack.size() < 2)
2099 error_ptr->SetErrorString("Expression stack needs at least 2 items for DW_OP_xor.");
2104 tmp = stack.back();
2105 stack.pop_back();
2106 stack.back().ResolveValue(exe_ctx) = stack.back().ResolveValue(exe_ctx) ^ tmp.ResolveValue(exe_ctx);
2138 // signed integer constant. This operation pops the top of stack. If
2146 tmp = stack.back();
2147 stack.pop_back();
2168 // DESCRIPTION: pops the top two stack values, compares using the
2170 // STACK RESULT: push the constant value 1 onto the stack if the result
2175 if (stack.size() < 2)
2178 error_ptr->SetErrorString("Expression stack needs at least 2 items for DW_OP_eq.");
2183 tmp = stack.back();
2184 stack.pop_back();
2185 stack.back().ResolveValue(exe_ctx) = stack.back().ResolveValue(exe_ctx) == tmp.ResolveValue(exe_ctx);
2192 // DESCRIPTION: pops the top two stack values, compares using the
2194 // STACK RESULT: push the constant value 1 onto the stack if the result
2199 if (stack.size() < 2)
2202 error_ptr->SetErrorString("Expression stack needs at least 2 items for DW_OP_ge.");
2207 tmp = stack.back();
2208 stack.pop_back();
2209 stack.back().ResolveValue(exe_ctx) = stack.back().ResolveValue(exe_ctx) >= tmp.ResolveValue(exe_ctx);
2216 // DESCRIPTION: pops the top two stack values, compares using the
2218 // STACK RESULT: push the constant value 1 onto the stack if the result
2223 if (stack.size() < 2)
2226 error_ptr->SetErrorString("Expression stack needs at least 2 items for DW_OP_gt.");
2231 tmp = stack.back();
2232 stack.pop_back();
2233 stack.back().ResolveValue(exe_ctx) = stack.back().ResolveValue(exe_ctx) > tmp.ResolveValue(exe_ctx);
2240 // DESCRIPTION: pops the top two stack values, compares using the
2242 // STACK RESULT: push the constant value 1 onto the stack if the result
2247 if (stack.size() < 2)
2250 error_ptr->SetErrorString("Expression stack needs at least 2 items for DW_OP_le.");
2255 tmp = stack.back();
2256 stack.pop_back();
2257 stack.back().ResolveValue(exe_ctx) = stack.back().ResolveValue(exe_ctx) <= tmp.ResolveValue(exe_ctx);
2264 // DESCRIPTION: pops the top two stack values, compares using the
2266 // STACK RESULT: push the constant value 1 onto the stack if the result
2271 if (stack.size() < 2)
2274 error_ptr->SetErrorString("Expression stack needs at least 2 items for DW_OP_lt.");
2279 tmp = stack.back();
2280 stack.pop_back();
2281 stack.back().ResolveValue(exe_ctx) = stack.back().ResolveValue(exe_ctx) < tmp.ResolveValue(exe_ctx);
2288 // DESCRIPTION: pops the top two stack values, compares using the
2290 // STACK RESULT: push the constant value 1 onto the stack if the result
2295 if (stack.size() < 2)
2298 error_ptr->SetErrorString("Expression stack needs at least 2 items for DW_OP_ne.");
2303 tmp = stack.back();
2304 stack.pop_back();
2305 stack.back().ResolveValue(exe_ctx) = stack.back().ResolveValue(exe_ctx) != tmp.ResolveValue(exe_ctx);
2313 // STACK RESULT: push the unsigned literal constant value onto the top
2314 // of the stack.
2348 stack.push_back(Scalar(op - DW_OP_lit0));
2354 // DESCRIPTION: Push the value in register n on the top of the stack.
2392 stack.push_back(tmp);
2401 // DESCRIPTION: Push the value in register on the top of the stack.
2407 stack.push_back(tmp);
2460 stack.push_back(tmp);
2461 stack.back().SetValueType (Value::eValueTypeLoadAddress);
2484 stack.push_back(tmp);
2485 stack.back().SetValueType (Value::eValueTypeLoadAddress);
2502 stack.push_back(value);
2503 stack.back().SetValueType (Value::eValueTypeLoadAddress);
2511 error_ptr->SetErrorString ("Invalid stack frame in context for DW_OP_fbreg opcode.");
2527 // DESCRIPTION: A place holder. It has no effect on the location stack
2539 // top of the stack. If the piece is located in a register, but does not
2582 // values on the stack. Execution returns to the point following the call
2583 // when the end of the attribute is reached. Values on the stack at the
2585 // and values left on the stack by the called expression may be used as
2608 // values on the stack. Execution returns to the point following the call
2609 // when the end of the attribute is reached. Values on the stack at the
2611 // and values left on the stack by the called expression may be used as
2624 // rather is a constant value. The value from the top of the stack is
2629 stack.back().SetValueType(Value::eValueTypeScalar);
2643 // is commonly evaluated with a valid stack frame.
2648 stack.push_back(Scalar(cfa));
2649 stack.back().SetValueType (Value::eValueTypeHostAddress);
2653 error_ptr->SetErrorString ("Stack frame does not include a canonical frame address for DW_OP_call_frame_cfa opcode.");
2658 error_ptr->SetErrorString ("Invalid stack frame in context for DW_OP_call_frame_cfa opcode.");
2669 if (stack.empty())
2672 error_ptr->SetErrorString ("Stack empty after evaluation.");
2677 size_t count = stack.size();
2678 log->Printf("Stack after operation has %lu values:", count);
2683 stack[i].Dump(&new_value);
2688 result = stack.back();