本文整理汇总了Java中com.sun.jdi.AbsentInformationException类的典型用法代码示例。如果您正苦于以下问题:Java AbsentInformationException类的具体用法?Java AbsentInformationException怎么用?Java AbsentInformationException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AbsentInformationException类属于com.sun.jdi包,在下文中一共展示了AbsentInformationException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sourceAvailable
import com.sun.jdi.AbsentInformationException; //导入依赖的package包/类
public boolean sourceAvailable (
CallStackFrame csf,
String stratumn
) {
String url = getClassURL(((CallStackFrameImpl) csf).getClassType(), stratumn);
if (url != null) {
return true;
}
try {
return sourceAvailable (
convertSlash (csf.getSourcePath (stratumn)), true
);
} catch (AbsentInformationException e) {
return sourceAvailable (
convertClassNameToRelativePath (csf.getClassName ()), true
);
}
}
示例2: popToHere
import com.sun.jdi.AbsentInformationException; //导入依赖的package包/类
private static void popToHere (final CallStackFrame frame) {
try {
JPDAThread t = frame.getThread ();
CallStackFrame[] stack = t.getCallStack ();
int i, k = stack.length;
if (k < 2) return ;
for (i = 0; i < k; i++)
if (stack [i].equals (frame)) {
if (i > 0) {
stack [i - 1].popFrame ();
}
return;
}
} catch (AbsentInformationException ex) {
}
}
示例3: getValueAt
import com.sun.jdi.AbsentInformationException; //导入依赖的package包/类
public Object getValueAt (Object row, String columnID) throws
UnknownTypeException {
if (row instanceof CallStackFrame) {
if (CALL_STACK_FRAME_LOCATION_COLUMN_ID.equals (columnID))
try {
return ((CallStackFrame) row).getSourceName (
null // default stratumn for current csf is used
);
} catch (AbsentInformationException e) {
return NbBundle.getMessage (
CallStackTableModel.class,
"MSG_Callstack_NoInformation"
);
}
}
throw new UnknownTypeException (row);
}
示例4: convertDebuggerStackFrameToClient
import com.sun.jdi.AbsentInformationException; //导入依赖的package包/类
private Types.StackFrame convertDebuggerStackFrameToClient(StackFrame stackFrame, int frameId, IDebugAdapterContext context)
throws URISyntaxException, AbsentInformationException {
Location location = stackFrame.location();
Method method = location.method();
Types.Source clientSource = this.convertDebuggerSourceToClient(location, context);
String methodName = formatMethodName(method, true, true);
int lineNumber = AdapterUtils.convertLineNumber(location.lineNumber(), context.isDebuggerLinesStartAt1(), context.isClientLinesStartAt1());
// Line number returns -1 if the information is not available; specifically, always returns -1 for native methods.
if (lineNumber < 0) {
if (method.isNative()) {
// For native method, display a tip text "native method" in the Call Stack View.
methodName += "[native method]";
} else {
// For other unavailable method, such as lambda expression's built-in methods run/accept/apply,
// display "Unknown Source" in the Call Stack View.
clientSource = null;
}
}
return new Types.StackFrame(frameId, methodName, clientSource, lineNumber, 0);
}
示例5: navigateToCustomCode
import com.sun.jdi.AbsentInformationException; //导入依赖的package包/类
final protected void navigateToCustomCode(final JPDAThread thread) {
CallStackFrame callStackFrame = null;
try {
CallStackFrame[] callStack = thread.getCallStack();
for (CallStackFrame csf : callStack) {
String cn = csf.getClassName();
if (JavaComponentInfo.isCustomType(cn)) {
callStackFrame = csf;
break;
}
}
} catch (AbsentInformationException ex) {
}
if (callStackFrame != null) {
((JPDAThreadImpl) thread).getDebugger().setPreferredTopFrame(callStackFrame);
}
}
示例6: checkForThreadJoin
import com.sun.jdi.AbsentInformationException; //导入依赖的package包/类
private ObjectVariable[] checkForThreadJoin(JPDAThread thread, ObjectVariable[] ownedMonitors) {
CallStackFrame[] callStack;
try {
callStack = thread.getCallStack(0, 2);
} catch (AbsentInformationException ex) {
return ownedMonitors;
}
if (callStack.length < 2) {
return ownedMonitors;
}
if (Thread.class.getName().equals(callStack[1].getClassName()) && "join".equals(callStack[1].getMethodName())) { // NOI18N
// This current thread is the "owned" monitor, it's joning the contended monitor.
ObjectVariable[] ownedMonitorsWithThread = Arrays.copyOf(ownedMonitors, ownedMonitors.length + 1);
ownedMonitorsWithThread[ownedMonitors.length] = (ObjectVariable) ((JPDAThreadImpl) thread).getDebugger().getVariable(((JPDAThreadImpl) thread).getThreadReference());
return ownedMonitorsWithThread;
} else {
return ownedMonitors;
}
}
示例7: stopHere
import com.sun.jdi.AbsentInformationException; //导入依赖的package包/类
/**
* Test whether we should stop here according to the smart-stepping rules.
*/
StopOrStep stopHere(JPDAThread t) {
CallStackFrame topFrame = null;
try {
CallStackFrame[] topFrameArr = t.getCallStack(0, 1);
if (topFrameArr.length > 0) {
topFrame = topFrameArr[0];
}
} catch (AbsentInformationException aiex) {}
if (topFrame != null) {
return getCompoundSmartSteppingListener().stopAt
(lookupProvider, topFrame, getSmartSteppingFilter());
} else {
return getCompoundSmartSteppingListener().stopHere
(lookupProvider, t, getSmartSteppingFilter()) ?
StopOrStep.stop() : StopOrStep.skip();
}
}
示例8: getTopFrame
import com.sun.jdi.AbsentInformationException; //导入依赖的package包/类
private CallStackFrame getTopFrame(JPDAThread thread) {
CallStackFrame callStackFrame;
if (preferredTopFrame != null) {
callStackFrame = preferredTopFrame;
preferredTopFrame = null;
return callStackFrame;
}
if ((thread == null) || (thread.getStackDepth () < 1)) {
callStackFrame = null;
} else {
try {
CallStackFrame[] csfs = thread.getCallStack(0, 1);
if (csfs.length > 0) {
callStackFrame = csfs[0];
} else {
callStackFrame = null;
}
} catch (AbsentInformationException e) {
callStackFrame = null;
}
}
return callStackFrame;
}
示例9: getSourceName
import com.sun.jdi.AbsentInformationException; //导入依赖的package包/类
/**
* Returns name of file of this frame.
*
* @return name of file of this frame
* @throws NoInformationException if informations about source are not included or some other error
* occurres.
*/
public synchronized String getSourceName (String stratum) throws AbsentInformationException {
if (!valid && sfLocation == null) return "";
assert !Mutex.EVENT.isReadAccess();
try {
Location l = getStackFrameLocation();
return LocationWrapper.sourceName(l, stratum);
} catch (InvalidStackFrameExceptionWrapper ex) {
// this stack frame is not available or information in it is not available
valid = false;
return "";
} catch (InternalExceptionWrapper ex) {
return "";
} catch (VMDisconnectedExceptionWrapper ex) {
return "";
}
}
示例10: getSourcePath
import com.sun.jdi.AbsentInformationException; //导入依赖的package包/类
/**
* Returns source path of file this frame is stopped in or null.
*
* @return source path of file this frame is stopped in or null
*/
public synchronized String getSourcePath (String stratum) throws AbsentInformationException {
if (!valid && sfLocation == null) return "";
assert !Mutex.EVENT.isReadAccess();
try {
Location l = getStackFrameLocation();
return LocationWrapper.sourcePath(l, stratum);
} catch (InvalidStackFrameExceptionWrapper ex) {
// this stack frame is not available or information in it is not available
valid = false;
return "";
} catch (InternalExceptionWrapper ex) {
return "";
} catch (VMDisconnectedExceptionWrapper ex) {
return "";
}
}
示例11: sourceFile
import com.sun.jdi.AbsentInformationException; //导入依赖的package包/类
/**
* Return a File cooresponding to the source of this location.
* Return null if not available.
*/
File sourceFile(Location loc) {
try {
String filename = loc.sourceName();
String refName = loc.declaringType().name();
int iDot = refName.lastIndexOf('.');
String pkgName = (iDot >= 0)? refName.substring(0, iDot+1) : "";
String full = pkgName.replace('.', File.separatorChar) + filename;
for (int i= 0; i < dirs.length; ++i) {
File path = new File(dirs[i], full);
if (path.exists()) {
return path;
}
}
return null;
} catch (AbsentInformationException e) {
return null;
}
}
示例12: addBreakpoint
import com.sun.jdi.AbsentInformationException; //导入依赖的package包/类
private static void addBreakpoint(VirtualMachine vm, ReferenceType refType) {
Location breakpointLocation = null;
List<Location> locs;
try {
locs = refType.allLineLocations();
for (Location loc: locs) {
if (loc.method().name().equals(METHOD_NAME)) {
breakpointLocation = loc;
break;
}
}
} catch (AbsentInformationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (breakpointLocation != null) {
EventRequestManager evtReqMgr = vm.eventRequestManager();
BreakpointRequest bReq = evtReqMgr.createBreakpointRequest(breakpointLocation);
bReq.setSuspendPolicy(BreakpointRequest.SUSPEND_ALL);
bReq.enable();
}
}
示例13: sourceNameFilter
import com.sun.jdi.AbsentInformationException; //导入依赖的package包/类
List<Location> sourceNameFilter(List<Location> list,
SDE.Stratum stratum,
String sourceName)
throws AbsentInformationException {
if (sourceName == null) {
return list;
} else {
/* needs sourceName filteration */
List<Location> locs = new ArrayList<>();
for (Location loc : list) {
if (((LocationImpl)loc).sourceName(stratum).equals(sourceName)) {
locs.add(loc);
}
}
return locs;
}
}
示例14: locationsOfLine
import com.sun.jdi.AbsentInformationException; //导入依赖的package包/类
List<Location> locationsOfLine(SDE.Stratum stratum,
String sourceName,
int lineNumber)
throws AbsentInformationException {
SoftLocationXRefs info = getLocations(stratum);
if (info.lineLocations.size() == 0) {
throw new AbsentInformationException();
}
/*
* Find the locations which match the line number
* passed in.
*/
List<Location> list = info.lineMapper.get(lineNumber);
if (list == null) {
list = new ArrayList<>(0);
}
return Collections.unmodifiableList(
sourceNameFilter(list, stratum, sourceName));
}
示例15: baseSourceName
import com.sun.jdi.AbsentInformationException; //导入依赖的package包/类
String baseSourceName() throws AbsentInformationException {
String bsn = baseSourceName;
if (bsn == null) {
// Does not need synchronization, since worst-case
// static info is fetched twice
try {
bsn = JDWP.ReferenceType.SourceFile.
process(vm, this).sourceFile;
} catch (JDWPException exc) {
if (exc.errorCode() == JDWP.Error.ABSENT_INFORMATION) {
bsn = ABSENT_BASE_SOURCE_NAME;
} else {
throw exc.toJDIException();
}
}
baseSourceName = bsn;
}
if (bsn == ABSENT_BASE_SOURCE_NAME) {
throw new AbsentInformationException();
}
return bsn;
}