Java Code Examples for com.sun.tools.example.debug.expr.ExpressionParser#GetFrame

The following examples show how to use com.sun.tools.example.debug.expr.ExpressionParser#GetFrame . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExecutionManager.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public Value evaluate(final StackFrame f, String expr)
    throws ParseException,
                                        InvocationException,
                                        InvalidTypeException,
                                        ClassNotLoadedException,
                                        NoSessionException,
                                        IncompatibleThreadStateException {
    ExpressionParser.GetFrame frameGetter = null;
    ensureActiveSession();
    if (f != null) {
        frameGetter = new ExpressionParser.GetFrame() {
            @Override
            public StackFrame get() /* throws IncompatibleThreadStateException */ {
                return f;
            }
        };
    }
    return ExpressionParser.evaluate(expr, vm(), frameGetter);
}
 
Example 2
Source File: MonitorTool.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
private Value evaluate(String expr) throws ParseException,
                                        InvocationException,
                                        InvalidTypeException,
                                        ClassNotLoadedException,
                                        IncompatibleThreadStateException {
    ExpressionParser.GetFrame frameGetter =
        new ExpressionParser.GetFrame() {
            @Override
            public StackFrame get()
                throws IncompatibleThreadStateException
            {
                try {
                    return context.getCurrentFrame();
                } catch (VMNotInterruptedException exc) {
                    throw new IncompatibleThreadStateException();
                }
            }
        };
    return ExpressionParser.evaluate(expr, runtime.vm(), frameGetter);
}
 
Example 3
Source File: ExecutionManager.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public Value evaluate(final StackFrame f, String expr)
    throws ParseException,
                                        InvocationException,
                                        InvalidTypeException,
                                        ClassNotLoadedException,
                                        NoSessionException,
                                        IncompatibleThreadStateException {
    ExpressionParser.GetFrame frameGetter = null;
    ensureActiveSession();
    if (f != null) {
        frameGetter = new ExpressionParser.GetFrame() {
            @Override
            public StackFrame get() /* throws IncompatibleThreadStateException */ {
                return f;
            }
        };
    }
    return ExpressionParser.evaluate(expr, vm(), frameGetter);
}
 
Example 4
Source File: ExecutionManager.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
public Value evaluate(final StackFrame f, String expr)
    throws ParseException,
                                        InvocationException,
                                        InvalidTypeException,
                                        ClassNotLoadedException,
                                        NoSessionException,
                                        IncompatibleThreadStateException {
    ExpressionParser.GetFrame frameGetter = null;
    ensureActiveSession();
    if (f != null) {
        frameGetter = new ExpressionParser.GetFrame() {
            @Override
            public StackFrame get() /* throws IncompatibleThreadStateException */ {
                return f;
            }
        };
    }
    return ExpressionParser.evaluate(expr, vm(), frameGetter);
}
 
Example 5
Source File: ExecutionManager.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public Value evaluate(final StackFrame f, String expr)
    throws ParseException,
                                        InvocationException,
                                        InvalidTypeException,
                                        ClassNotLoadedException,
                                        NoSessionException,
                                        IncompatibleThreadStateException {
    ExpressionParser.GetFrame frameGetter = null;
    ensureActiveSession();
    if (f != null) {
        frameGetter = new ExpressionParser.GetFrame() {
            @Override
            public StackFrame get() /* throws IncompatibleThreadStateException */ {
                return f;
            }
        };
    }
    return ExpressionParser.evaluate(expr, vm(), frameGetter);
}
 
Example 6
Source File: MonitorTool.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
private Value evaluate(String expr) throws ParseException,
                                        InvocationException,
                                        InvalidTypeException,
                                        ClassNotLoadedException,
                                        IncompatibleThreadStateException {
    ExpressionParser.GetFrame frameGetter =
        new ExpressionParser.GetFrame() {
            @Override
            public StackFrame get()
                throws IncompatibleThreadStateException
            {
                try {
                    return context.getCurrentFrame();
                } catch (VMNotInterruptedException exc) {
                    throw new IncompatibleThreadStateException();
                }
            }
        };
    return ExpressionParser.evaluate(expr, runtime.vm(), frameGetter);
}
 
Example 7
Source File: MonitorTool.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private Value evaluate(String expr) throws ParseException,
                                        InvocationException,
                                        InvalidTypeException,
                                        ClassNotLoadedException,
                                        IncompatibleThreadStateException {
    ExpressionParser.GetFrame frameGetter =
        new ExpressionParser.GetFrame() {
            @Override
            public StackFrame get()
                throws IncompatibleThreadStateException
            {
                try {
                    return context.getCurrentFrame();
                } catch (VMNotInterruptedException exc) {
                    throw new IncompatibleThreadStateException();
                }
            }
        };
    return ExpressionParser.evaluate(expr, runtime.vm(), frameGetter);
}
 
Example 8
Source File: MonitorTool.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private Value evaluate(String expr) throws ParseException,
                                        InvocationException,
                                        InvalidTypeException,
                                        ClassNotLoadedException,
                                        IncompatibleThreadStateException {
    ExpressionParser.GetFrame frameGetter =
        new ExpressionParser.GetFrame() {
            @Override
            public StackFrame get()
                throws IncompatibleThreadStateException
            {
                try {
                    return context.getCurrentFrame();
                } catch (VMNotInterruptedException exc) {
                    throw new IncompatibleThreadStateException();
                }
            }
        };
    return ExpressionParser.evaluate(expr, runtime.vm(), frameGetter);
}
 
Example 9
Source File: ExecutionManager.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public Value evaluate(final StackFrame f, String expr)
    throws ParseException,
                                        InvocationException,
                                        InvalidTypeException,
                                        ClassNotLoadedException,
                                        NoSessionException,
                                        IncompatibleThreadStateException {
    ExpressionParser.GetFrame frameGetter = null;
    ensureActiveSession();
    if (f != null) {
        frameGetter = new ExpressionParser.GetFrame() {
            @Override
            public StackFrame get() /* throws IncompatibleThreadStateException */ {
                return f;
            }
        };
    }
    return ExpressionParser.evaluate(expr, vm(), frameGetter);
}
 
Example 10
Source File: MonitorTool.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private Value evaluate(String expr) throws ParseException,
                                        InvocationException,
                                        InvalidTypeException,
                                        ClassNotLoadedException,
                                        IncompatibleThreadStateException {
    ExpressionParser.GetFrame frameGetter =
        new ExpressionParser.GetFrame() {
            @Override
            public StackFrame get()
                throws IncompatibleThreadStateException
            {
                try {
                    return context.getCurrentFrame();
                } catch (VMNotInterruptedException exc) {
                    throw new IncompatibleThreadStateException();
                }
            }
        };
    return ExpressionParser.evaluate(expr, runtime.vm(), frameGetter);
}
 
Example 11
Source File: MonitorTool.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private Value evaluate(String expr) throws ParseException,
                                        InvocationException,
                                        InvalidTypeException,
                                        ClassNotLoadedException,
                                        IncompatibleThreadStateException {
    ExpressionParser.GetFrame frameGetter =
        new ExpressionParser.GetFrame() {
            @Override
            public StackFrame get()
                throws IncompatibleThreadStateException
            {
                try {
                    return context.getCurrentFrame();
                } catch (VMNotInterruptedException exc) {
                    throw new IncompatibleThreadStateException();
                }
            }
        };
    return ExpressionParser.evaluate(expr, runtime.vm(), frameGetter);
}
 
Example 12
Source File: ExecutionManager.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public Value evaluate(final StackFrame f, String expr)
    throws ParseException,
                                        InvocationException,
                                        InvalidTypeException,
                                        ClassNotLoadedException,
                                        NoSessionException,
                                        IncompatibleThreadStateException {
    ExpressionParser.GetFrame frameGetter = null;
    ensureActiveSession();
    if (f != null) {
        frameGetter = new ExpressionParser.GetFrame() {
            @Override
            public StackFrame get() /* throws IncompatibleThreadStateException */ {
                return f;
            }
        };
    }
    return ExpressionParser.evaluate(expr, vm(), frameGetter);
}
 
Example 13
Source File: MonitorTool.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
private Value evaluate(String expr) throws ParseException,
                                        InvocationException,
                                        InvalidTypeException,
                                        ClassNotLoadedException,
                                        IncompatibleThreadStateException {
    ExpressionParser.GetFrame frameGetter =
        new ExpressionParser.GetFrame() {
            @Override
            public StackFrame get()
                throws IncompatibleThreadStateException
            {
                try {
                    return context.getCurrentFrame();
                } catch (VMNotInterruptedException exc) {
                    throw new IncompatibleThreadStateException();
                }
            }
        };
    return ExpressionParser.evaluate(expr, runtime.vm(), frameGetter);
}
 
Example 14
Source File: ExecutionManager.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public Value evaluate(final StackFrame f, String expr)
    throws ParseException,
                                        InvocationException,
                                        InvalidTypeException,
                                        ClassNotLoadedException,
                                        NoSessionException,
                                        IncompatibleThreadStateException {
    ExpressionParser.GetFrame frameGetter = null;
    ensureActiveSession();
    if (f != null) {
        frameGetter = new ExpressionParser.GetFrame() {
            @Override
            public StackFrame get() /* throws IncompatibleThreadStateException */ {
                return f;
            }
        };
    }
    return ExpressionParser.evaluate(expr, vm(), frameGetter);
}
 
Example 15
Source File: MonitorTool.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
private Value evaluate(String expr) throws ParseException,
                                        InvocationException,
                                        InvalidTypeException,
                                        ClassNotLoadedException,
                                        IncompatibleThreadStateException {
    ExpressionParser.GetFrame frameGetter =
        new ExpressionParser.GetFrame() {
            @Override
            public StackFrame get()
                throws IncompatibleThreadStateException
            {
                try {
                    return context.getCurrentFrame();
                } catch (VMNotInterruptedException exc) {
                    throw new IncompatibleThreadStateException();
                }
            }
        };
    return ExpressionParser.evaluate(expr, runtime.vm(), frameGetter);
}
 
Example 16
Source File: ExecutionManager.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public Value evaluate(final StackFrame f, String expr)
    throws ParseException,
                                        InvocationException,
                                        InvalidTypeException,
                                        ClassNotLoadedException,
                                        NoSessionException,
                                        IncompatibleThreadStateException {
    ExpressionParser.GetFrame frameGetter = null;
    ensureActiveSession();
    if (f != null) {
        frameGetter = new ExpressionParser.GetFrame() {
            @Override
            public StackFrame get() /* throws IncompatibleThreadStateException */ {
                return f;
            }
        };
    }
    return ExpressionParser.evaluate(expr, vm(), frameGetter);
}
 
Example 17
Source File: Commands.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private Value evaluate(String expr) {
    Value result = null;
    ExpressionParser.GetFrame frameGetter = null;
    try {
        final ThreadInfo threadInfo = ThreadInfo.getCurrentThreadInfo();
        if ((threadInfo != null) && (threadInfo.getCurrentFrame() != null)) {
            frameGetter = new ExpressionParser.GetFrame() {
                    @Override
                    public StackFrame get() throws IncompatibleThreadStateException {
                        return threadInfo.getCurrentFrame();
                    }
                };
        }
        result = ExpressionParser.evaluate(expr, Env.vm(), frameGetter);
    } catch (InvocationException ie) {
        MessageOutput.println("Exception in expression:",
                              ie.exception().referenceType().name());
    } catch (Exception ex) {
        String exMessage = ex.getMessage();
        if (exMessage == null) {
            MessageOutput.printException(exMessage, ex);
        } else {
            String s;
            try {
                s = MessageOutput.format(exMessage);
            } catch (MissingResourceException mex) {
                s = ex.toString();
            }
            MessageOutput.printDirectln(s);// Special case: use printDirectln()
        }
    }
    return result;
}
 
Example 18
Source File: Commands.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private Value evaluate(String expr) {
    Value result = null;
    ExpressionParser.GetFrame frameGetter = null;
    try {
        final ThreadInfo threadInfo = ThreadInfo.getCurrentThreadInfo();
        if ((threadInfo != null) && (threadInfo.getCurrentFrame() != null)) {
            frameGetter = new ExpressionParser.GetFrame() {
                    @Override
                    public StackFrame get() throws IncompatibleThreadStateException {
                        return threadInfo.getCurrentFrame();
                    }
                };
        }
        result = ExpressionParser.evaluate(expr, Env.vm(), frameGetter);
    } catch (InvocationException ie) {
        MessageOutput.println("Exception in expression:",
                              ie.exception().referenceType().name());
    } catch (Exception ex) {
        String exMessage = ex.getMessage();
        if (exMessage == null) {
            MessageOutput.printException(exMessage, ex);
        } else {
            String s;
            try {
                s = MessageOutput.format(exMessage);
            } catch (MissingResourceException mex) {
                s = ex.toString();
            }
            MessageOutput.printDirectln(s);// Special case: use printDirectln()
        }
    }
    return result;
}
 
Example 19
Source File: Commands.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private Value evaluate(String expr) {
    Value result = null;
    ExpressionParser.GetFrame frameGetter = null;
    try {
        final ThreadInfo threadInfo = ThreadInfo.getCurrentThreadInfo();
        if ((threadInfo != null) && (threadInfo.getCurrentFrame() != null)) {
            frameGetter = new ExpressionParser.GetFrame() {
                    @Override
                    public StackFrame get() throws IncompatibleThreadStateException {
                        return threadInfo.getCurrentFrame();
                    }
                };
        }
        result = ExpressionParser.evaluate(expr, Env.vm(), frameGetter);
    } catch (InvocationException ie) {
        MessageOutput.println("Exception in expression:",
                              ie.exception().referenceType().name());
    } catch (Exception ex) {
        String exMessage = ex.getMessage();
        if (exMessage == null) {
            MessageOutput.printException(exMessage, ex);
        } else {
            String s;
            try {
                s = MessageOutput.format(exMessage);
            } catch (MissingResourceException mex) {
                s = ex.toString();
            }
            MessageOutput.printDirectln(s);// Special case: use printDirectln()
        }
    }
    return result;
}
 
Example 20
Source File: Commands.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private Value evaluate(String expr) {
    Value result = null;
    ExpressionParser.GetFrame frameGetter = null;
    try {
        final ThreadInfo threadInfo = ThreadInfo.getCurrentThreadInfo();
        if ((threadInfo != null) && (threadInfo.getCurrentFrame() != null)) {
            frameGetter = new ExpressionParser.GetFrame() {
                    @Override
                    public StackFrame get() throws IncompatibleThreadStateException {
                        return threadInfo.getCurrentFrame();
                    }
                };
        }
        result = ExpressionParser.evaluate(expr, Env.vm(), frameGetter);
    } catch (InvocationException ie) {
        MessageOutput.println("Exception in expression:",
                              ie.exception().referenceType().name());
    } catch (Exception ex) {
        String exMessage = ex.getMessage();
        if (exMessage == null) {
            MessageOutput.printException(exMessage, ex);
        } else {
            String s;
            try {
                s = MessageOutput.format(exMessage);
            } catch (MissingResourceException mex) {
                s = ex.toString();
            }
            MessageOutput.printDirectln(s);// Special case: use printDirectln()
        }
    }
    return result;
}