public abstract class DebuggerUtilsEx extends DebuggerUtils
DebuggerUtils.ArrayClass
Modifier and Type | Field and Description |
---|---|
static java.util.Comparator<com.sun.jdi.Method> |
LAMBDA_ORDINAL_COMPARATOR |
MAX_DISPLAY_LABEL_LENGTH, ourPrimitiveTypeNames
Constructor and Description |
---|
DebuggerUtilsEx() |
Modifier and Type | Method and Description |
---|---|
static void |
addThreadDump(Project project,
java.util.List<ThreadState> threads,
RunnerLayoutUi ui,
GlobalSearchScope searchScope) |
static java.util.List<com.sun.jdi.Location> |
allLineLocations(com.sun.jdi.Method method) |
static java.util.List<com.sun.jdi.Location> |
allLineLocations(com.sun.jdi.ReferenceType cls) |
static int |
bytecodeToSourceLine(PsiFile psiFile,
int originalLine)
Provides mapping from decompiled file line number to the original source code line numbers
|
static java.util.List<PsiLambdaExpression> |
collectLambdas(SourcePosition position,
boolean onlyOnTheLine) |
static ClassFilter |
create(Element element) |
static com.sun.jdi.Value |
createValue(VirtualMachineProxyImpl vm,
java.lang.String expectedType,
boolean value) |
static com.sun.jdi.Value |
createValue(VirtualMachineProxyImpl vm,
java.lang.String expectedType,
char value) |
static com.sun.jdi.Value |
createValue(VirtualMachineProxyImpl vm,
java.lang.String expectedType,
double value) |
static com.sun.jdi.Value |
createValue(VirtualMachineProxyImpl vm,
java.lang.String expectedType,
long value) |
static java.util.List<com.sun.jdi.Method> |
declaredMethodsByName(com.sun.jdi.ReferenceType type,
java.lang.String name) |
static void |
disableCollection(com.sun.jdi.ObjectReference reference) |
static boolean |
elementsEqual(Element e1,
Element e2) |
static void |
enableCollection(com.sun.jdi.ObjectReference reference) |
static boolean |
evaluateBoolean(ExpressionEvaluator evaluator,
EvaluationContextImpl context) |
static boolean |
externalizableEqual(JDOMExternalizable e1,
JDOMExternalizable e2) |
static boolean |
filterEquals(ClassFilter[] filters1,
ClassFilter[] filters2) |
static CodeFragmentFactory |
findAppropriateCodeFragmentFactory(TextWithImports text,
PsiElement context) |
static PsiElement |
findElementAt(PsiFile file,
int offset)
Decompiler aware version
|
static PsiMethod |
findPsiMethod(PsiFile file,
int offset) |
static java.lang.String |
getAlternativeSourceUrl(java.lang.String className,
Project project) |
static java.util.List<com.sun.jdi.Value> |
getArgumentValues(com.sun.jdi.StackFrame frame) |
static PsiElement |
getBody(PsiElement method) |
static java.util.List<CodeFragmentFactory> |
getCodeFragmentFactories(PsiElement context) |
static CodeFragmentFactory |
getCodeFragmentFactory(PsiElement context,
FileType fileType) |
static PsiElement |
getContainingMethod(PsiElement elem) |
static PsiElement |
getContainingMethod(SourcePosition position) |
static ThreeState |
getEffectiveAssertionStatus(com.sun.jdi.Location location) |
static int |
getEnabledNumber(ClassFilter[] classFilters) |
static java.util.List<Pair<Breakpoint,com.sun.jdi.event.Event>> |
getEventDescriptors(SuspendContextImpl suspendContext) |
static PsiElement |
getFirstElementOnTheLine(PsiLambdaExpression lambda,
Document document,
int line) |
static java.lang.String |
getLambdaBaseClassName(java.lang.String typeName) |
static int |
getLambdaOrdinal(java.lang.String name) |
static int |
getLineNumber(com.sun.jdi.Location location,
boolean zeroBased) |
static java.lang.String |
getLocationMethodQName(com.sun.jdi.Location location) |
static com.sun.jdi.Method |
getMethod(com.sun.jdi.Location location) |
static PsiParameter [] |
getParameters(PsiElement method) |
static PsiFile |
getPsiFile(XSourcePosition position,
Project project) |
static java.lang.String |
getSourceName(com.sun.jdi.Location location,
java.util.function.Function<? super java.lang.Throwable,java.lang.String> defaultName) |
static com.sun.jdi.ReferenceType |
getSuperClass(java.lang.String baseQualifiedName,
com.sun.jdi.ReferenceType checkedType) |
static java.lang.String |
getThreadStatusText(int statusId) |
static boolean |
intersects(TextRange range,
PsiElement elem) |
static TextRange |
intersectWithLine(TextRange range,
PsiFile file,
int line) |
static boolean |
inTheMethod(SourcePosition pos,
PsiElement method) |
static boolean |
isAssignableFrom(java.lang.String baseQualifiedName,
com.sun.jdi.Type checkedType) |
static boolean |
isFiltered(java.lang.String qName,
ClassFilter[] classFilters) |
static boolean |
isFiltered(java.lang.String qName,
java.util.List<? extends ClassFilter> classFilters) |
static boolean |
isInLibraryContent(VirtualFile file,
Project project) |
static boolean |
isLambda(com.sun.jdi.Method method) |
static boolean |
isLambdaClassName(java.lang.String typeName) |
static boolean |
isLambdaName(java.lang.String name) |
static boolean |
isProxyClass(com.sun.jdi.ReferenceType type) |
static boolean |
isProxyClassName(java.lang.String name) |
static boolean |
isVoid(com.sun.jdi.Method method) |
static void |
keep(com.sun.jdi.Value value,
EvaluationContext context)
Deprecated.
use
EvaluationContext.keep(Value) directly |
static java.util.List<com.sun.jdi.Location> |
locationsOfLine(com.sun.jdi.Method method,
int line) |
static java.lang.String |
methodKey(com.sun.jdi.Method m) |
static boolean |
methodMatches(PsiMethod psiMethod,
java.lang.String className,
java.lang.String name,
java.lang.String signature,
DebugProcessImpl process) |
static java.lang.String |
methodName(com.sun.jdi.Method m) |
static java.lang.String |
methodName(java.lang.String className,
java.lang.String methodName,
java.lang.String signature) |
static java.lang.String |
methodNameWithArguments(com.sun.jdi.Method m) |
static com.sun.jdi.ArrayReference |
mirrorOfArray(com.sun.jdi.ArrayType arrayType,
int dimension,
EvaluationContext context) |
static com.sun.jdi.StringReference |
mirrorOfString(java.lang.String s,
VirtualMachineProxyImpl virtualMachineProxy,
EvaluationContext context) |
static java.lang.String |
prepareValueText(java.lang.String text,
Project project) |
static ClassFilter[] |
readFilters(java.util.List<? extends Element> children) |
static void |
setAlternativeSourceUrl(java.lang.String className,
java.lang.String source,
Project project) |
static java.lang.String |
signatureToName(java.lang.String s) |
static SourcePosition |
toSourcePosition(XSourcePosition position,
Project project) |
static XSourcePosition |
toXSourcePosition(SourcePosition position) |
static java.lang.String |
truncateString(java.lang.String str) |
static boolean |
valuesEqual(com.sun.jdi.Value val1,
com.sun.jdi.Value val2) |
static void |
writeFilters(Element parentNode,
java.lang.String tagName,
ClassFilter[] filters) |
checkSyntax, chooseClassDialog, cleanupAfterProcessFinish, convertToPresentationString, createExpressionWithImports, ensureNotInsideObjectConstructor, findAvailableDebugAddress, findClass, findMethod, getArrayClass, getContextElement, getDebuggerContext, getInstance, getSuperType, getType, getValueAsString, hasSideEffects, hasSideEffectsOrReferencesMissingVars, instanceOf, instanceOf, isAndroidVM, isBreakpointAware, isInsideSimpleGetter, isInteger, isNumeric, isPrimitiveType, isSynthetic, processCollectibleValue, readTextWithImports, readTextWithImports, substituteThis, translateStringValue, writeTextWithImports, writeTextWithImports
public static final java.util.Comparator<com.sun.jdi.Method> LAMBDA_ORDINAL_COMPARATOR
public static java.util.List<CodeFragmentFactory> getCodeFragmentFactories(PsiElement context)
context
- public static boolean isAssignableFrom(java.lang.String baseQualifiedName, com.sun.jdi.Type checkedType)
public static com.sun.jdi.ReferenceType getSuperClass(java.lang.String baseQualifiedName, com.sun.jdi.ReferenceType checkedType)
public static boolean valuesEqual(com.sun.jdi.Value val1, com.sun.jdi.Value val2)
public static ClassFilter create(Element element) throws InvalidDataException
InvalidDataException
public static boolean isFiltered(java.lang.String qName, ClassFilter[] classFilters)
public static boolean isFiltered(java.lang.String qName, java.util.List<? extends ClassFilter> classFilters)
public static int getEnabledNumber(ClassFilter[] classFilters)
public static ClassFilter[] readFilters(java.util.List<? extends Element> children)
public static void writeFilters(Element parentNode, java.lang.String tagName, ClassFilter[] filters) throws WriteExternalException
WriteExternalException
public static boolean filterEquals(ClassFilter[] filters1, ClassFilter[] filters2)
public static boolean elementsEqual(Element e1, Element e2)
public static boolean externalizableEqual(JDOMExternalizable e1, JDOMExternalizable e2)
public static java.util.List<Pair<Breakpoint,com.sun.jdi.event.Event>> getEventDescriptors(SuspendContextImpl suspendContext)
public static void addThreadDump(Project project, java.util.List<ThreadState> threads, RunnerLayoutUi ui, GlobalSearchScope searchScope)
@Deprecated public static void keep(com.sun.jdi.Value value, EvaluationContext context)
EvaluationContext.keep(Value)
directlypublic static com.sun.jdi.StringReference mirrorOfString(java.lang.String s, VirtualMachineProxyImpl virtualMachineProxy, EvaluationContext context) throws EvaluateException
EvaluateException
public static com.sun.jdi.ArrayReference mirrorOfArray(com.sun.jdi.ArrayType arrayType, int dimension, EvaluationContext context) throws EvaluateException
EvaluateException
public static CodeFragmentFactory getCodeFragmentFactory(PsiElement context, FileType fileType)
public static CodeFragmentFactory findAppropriateCodeFragmentFactory(TextWithImports text, PsiElement context)
public static ThreeState getEffectiveAssertionStatus(com.sun.jdi.Location location)
location
- location to get the assertion status forThreeState.YES
means assertions are enabled
ThreeState.NO
means assertions are disabled
ThreeState.UNSURE
means there are no assertions in the current class, so the status was not requested by the runtimepublic static java.lang.String methodKey(com.sun.jdi.Method m)
public static java.lang.String methodNameWithArguments(com.sun.jdi.Method m)
public static java.lang.String methodName(com.sun.jdi.Method m)
public static java.lang.String methodName(java.lang.String className, java.lang.String methodName, java.lang.String signature)
public static java.lang.String signatureToName(java.lang.String s)
public static java.util.List<com.sun.jdi.Method> declaredMethodsByName(com.sun.jdi.ReferenceType type, java.lang.String name)
public static java.util.List<com.sun.jdi.Location> allLineLocations(com.sun.jdi.Method method)
public static java.util.List<com.sun.jdi.Location> allLineLocations(com.sun.jdi.ReferenceType cls)
public static int getLineNumber(com.sun.jdi.Location location, boolean zeroBased)
public static java.lang.String getSourceName(com.sun.jdi.Location location, java.util.function.Function<? super java.lang.Throwable,java.lang.String> defaultName)
public static boolean isVoid(com.sun.jdi.Method method)
public static com.sun.jdi.Method getMethod(com.sun.jdi.Location location)
public static java.util.List<com.sun.jdi.Location> locationsOfLine(com.sun.jdi.Method method, int line)
public static java.util.List<com.sun.jdi.Value> getArgumentValues(com.sun.jdi.StackFrame frame)
public static com.sun.jdi.Value createValue(VirtualMachineProxyImpl vm, java.lang.String expectedType, double value)
public static com.sun.jdi.Value createValue(VirtualMachineProxyImpl vm, java.lang.String expectedType, long value)
public static com.sun.jdi.Value createValue(VirtualMachineProxyImpl vm, java.lang.String expectedType, boolean value)
public static com.sun.jdi.Value createValue(VirtualMachineProxyImpl vm, java.lang.String expectedType, char value)
public static java.lang.String truncateString(java.lang.String str)
public static java.lang.String getThreadStatusText(int statusId)
public static java.lang.String prepareValueText(java.lang.String text, Project project)
public static void setAlternativeSourceUrl(java.lang.String className, java.lang.String source, Project project)
public static java.lang.String getAlternativeSourceUrl(java.lang.String className, Project project)
public static XSourcePosition toXSourcePosition(SourcePosition position)
public static SourcePosition toSourcePosition(XSourcePosition position, Project project)
public static TextRange intersectWithLine(TextRange range, PsiFile file, int line)
public static PsiFile getPsiFile(XSourcePosition position, Project project)
public static PsiElement findElementAt(PsiFile file, int offset)
public static java.lang.String getLocationMethodQName(com.sun.jdi.Location location)
public static boolean isLambdaClassName(java.lang.String typeName)
public static java.lang.String getLambdaBaseClassName(java.lang.String typeName)
public static boolean isLambdaName(java.lang.String name)
public static boolean isLambda(com.sun.jdi.Method method)
public static boolean isProxyClassName(java.lang.String name)
public static boolean isProxyClass(com.sun.jdi.ReferenceType type)
public static int getLambdaOrdinal(java.lang.String name)
public static java.util.List<PsiLambdaExpression> collectLambdas(SourcePosition position, boolean onlyOnTheLine)
public static PsiElement getBody(PsiElement method)
public static PsiParameter [] getParameters(PsiElement method)
public static boolean evaluateBoolean(ExpressionEvaluator evaluator, EvaluationContextImpl context) throws EvaluateException
EvaluateException
public static boolean intersects(TextRange range, PsiElement elem)
public static PsiElement getFirstElementOnTheLine(PsiLambdaExpression lambda, Document document, int line)
public static boolean inTheMethod(SourcePosition pos, PsiElement method)
public static boolean methodMatches(PsiMethod psiMethod, java.lang.String className, java.lang.String name, java.lang.String signature, DebugProcessImpl process)
public static PsiElement getContainingMethod(PsiElement elem)
public static PsiElement getContainingMethod(SourcePosition position)
public static void disableCollection(com.sun.jdi.ObjectReference reference)
public static void enableCollection(com.sun.jdi.ObjectReference reference)
public static int bytecodeToSourceLine(PsiFile psiFile, int originalLine)
psiFile
- decompiled fileoriginalLine
- zero-based decompiled file line numberpublic static boolean isInLibraryContent(VirtualFile file, Project project)