public List getArgumentValues()

in src/main/java/com/jetbrains/jdi/StackFrameImpl.java [465:514]


    public List<Value> getArgumentValues() {
        validateStackFrame();
        MethodImpl mmm = (MethodImpl)location.method();
        List<String> argSigs = mmm.argumentSignatures();
        int count = argSigs.size();
        JDWP.StackFrame.GetValues.SlotInfo[] slots =
                           new JDWP.StackFrame.GetValues.SlotInfo[count];

        int slot;
        if (mmm.isStatic()) {
            slot = 0;
        } else {
            slot = 1;
        }
        for (int ii = 0; ii < count; ++ii) {
            char sigChar = argSigs.get(ii).charAt(0);
            slots[ii] = new JDWP.StackFrame.GetValues.SlotInfo(slot++,(byte)sigChar);
            if (sigChar == 'J' || sigChar == 'D') {
                slot++;
            }
        }

        PacketStream ps;

        /* protect against defunct frame id */
        synchronized (vm.state()) {
            validateStackFrame();
            ps = JDWP.StackFrame.GetValues.enqueueCommand(vm, thread, id, slots);
        }

        ValueImpl[] values;
        try {
            values = JDWP.StackFrame.GetValues.waitForReply(vm, ps).values;
        } catch (JDWPException exc) {
            switch (exc.errorCode()) {
                case JDWP.Error.INVALID_FRAMEID:
                case JDWP.Error.THREAD_NOT_SUSPENDED:
                case JDWP.Error.INVALID_THREAD:
                    throw new InvalidStackFrameException();
                default:
                    throw exc.toJDIException();
            }
        }

        if (count != values.length) {
            throw new InternalException(
                      "Wrong number of values returned from target VM");
        }
        return Arrays.asList(values);
    }