本文整理汇总了Java中org.eclipse.debug.core.DebugException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java DebugException.printStackTrace方法的具体用法?Java DebugException.printStackTrace怎么用?Java DebugException.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.debug.core.DebugException
的用法示例。
在下文中一共展示了DebugException.printStackTrace方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: valueToString
import org.eclipse.debug.core.DebugException; //导入方法依赖的package包/类
private String valueToString(IJavaValue value) {
if(value instanceof IJavaArray) {
try {
IJavaArray array = (IJavaArray) value;
IJavaValue[] values = array.getValues();
String s = "";
for(int i = 0; i < values.length; i++) {
if(!s.isEmpty())
s += ", ";
s += valueSpecialChars(values[i]);
}
return "{" + s + "}";
}
catch (DebugException e) {
e.printStackTrace();
return null;
}
}
else
return valueSpecialChars(value);
}
示例2: valueSpecialChars
import org.eclipse.debug.core.DebugException; //导入方法依赖的package包/类
private String valueSpecialChars(IJavaValue value) {
try {
if(value.getReferenceTypeName().equals("char"))
return "'" + value.getValueString() + "'";
if(value.getReferenceTypeName().equals(String.class.getName()))
return "\"" + value.getValueString() + "\"";
if(value instanceof IJavaObject) {
if(((IJavaObject) value).isNull())
return "null";
else
return runtime.getObject((IJavaObject) value, false, null).toString();
}
return value.getValueString();
}
catch (DebugException e) {
e.printStackTrace();
return null;
}
}
示例3: getAllVariables
import org.eclipse.debug.core.DebugException; //导入方法依赖的package包/类
@Override
public Collection<IVariableModel<?>> getAllVariables() {
if(runtime.isEmpty())
return Collections.emptyList();
StackFrameModel topFrame = runtime.getTopFrame();
try {
String type = topFrame.getStackFrame().getDeclaringTypeName();
return map.entrySet().stream()
.filter((e) -> e.getKey().substring(0, e.getKey().lastIndexOf('.')).equals(type))
.map((e) -> e.getValue())
.collect(Collectors.toList());
} catch (DebugException e1) {
e1.printStackTrace();
}
return Collections.emptyList();
}
示例4: getInt
import org.eclipse.debug.core.DebugException; //导入方法依赖的package包/类
public int getInt(String fieldName) {
try {
IJavaFieldVariable field = getContent().getField(fieldName, false);
if(field == null)
throw new IllegalArgumentException(fieldName + " is not a field");
if(!field.getJavaType().getName().equals("int"))
throw new IllegalAccessError(fieldName + " is not of type int");
IJavaPrimitiveValue value = (IJavaPrimitiveValue) field.getValue();
return value.getIntValue();
} catch (DebugException e) {
e.printStackTrace();
return 0;
}
}
示例5: getArray
import org.eclipse.debug.core.DebugException; //导入方法依赖的package包/类
public IArrayModel getArray(String fieldName) {
try {
IJavaFieldVariable field = getContent().getField(fieldName, false);
if(field == null)
throw new IllegalArgumentException(fieldName + " is not a field");
// if(!(field.getJavaType() instanceof IJavaArrayType))
// throw new IllegalArgumentException(fieldName + " is not an array field");
IEntityModel t = references.get(fieldName).getModelTarget();
return t instanceof IArrayModel ? (IArrayModel) t : null;
} catch (DebugException e) {
e.printStackTrace();
return null;
}
}
示例6: update
import org.eclipse.debug.core.DebugException; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public boolean update(int step) {
try {
StepValue current = history.get(history.size()-1);
boolean equals = variable.getValue().equals(current.value);
if(!equals) {
StepValue sv = new StepValue((T) variable.getValue(), step);
history.add(sv);
stepPointer++;
setChanged();
notifyObservers();
return true;
}
}
catch(DebugException e) {
e.printStackTrace(); // TODO terminate
}
return false;
}
示例7: isMatrix
import org.eclipse.debug.core.DebugException; //导入方法依赖的package包/类
@Override
public boolean isMatrix() {
if(dimensions < 2)
return false;
try {
for(int i = 0; i < elements.length-1; i++) {
if(elements[i].isNull() || elements[i+1].isNull())
return false;
else
if(((IJavaArray) elements[i]).getLength() != ((IJavaArray) elements[i+1]).getLength())
return false;
}
} catch (DebugException e) {
e.printStackTrace(); // TODO termination
}
return true;
}
示例8: resume
import org.eclipse.debug.core.DebugException; //导入方法依赖的package包/类
static void resume(ExecutionEvent event) {
if(launch != null) {
try {
IDebugTarget debugTarget = launch.getDebugTarget();
if(debugTarget != null)
debugTarget.resume();
} catch (DebugException e) {
e.printStackTrace();
}
}
// showView(event);
}
示例9: stepInto
import org.eclipse.debug.core.DebugException; //导入方法依赖的package包/类
static void stepInto(ExecutionEvent event) {
if(launch != null) {
try {
for(IThread t : launch.getDebugTarget().getThreads())
if(t.canStepInto())
t.stepInto();
} catch (DebugException e) {
e.printStackTrace();
}
}
// showView(event);
}
示例10: stepOver
import org.eclipse.debug.core.DebugException; //导入方法依赖的package包/类
static void stepOver(ExecutionEvent event) {
if(launch != null) {
try {
for(IThread t : launch.getDebugTarget().getThreads())
if(t.canStepOver())
t.stepOver();
} catch (DebugException e) {
e.printStackTrace();
}
}
// showView(event);
}
示例11: stepReturn
import org.eclipse.debug.core.DebugException; //导入方法依赖的package包/类
static void stepReturn(ExecutionEvent event) {
if(launch != null) {
try {
for(IThread t : launch.getDebugTarget().getThreads())
if(t.canStepReturn())
t.stepReturn();
} catch (DebugException e) {
e.printStackTrace();
}
}
// showView(event);
}
示例12: terminate
import org.eclipse.debug.core.DebugException; //导入方法依赖的package包/类
static void terminate(ExecutionEvent event) {
if(launch != null) {
try {
IDebugTarget debugTarget = launch.getDebugTarget();
if(debugTarget != null)
debugTarget.terminate();
} catch (DebugException e) {
e.printStackTrace();
}
}
// showView(event);
}
示例13: getLineNumber
import org.eclipse.debug.core.DebugException; //导入方法依赖的package包/类
public int getLineNumber() {
try {
return frame.getLineNumber();
} catch (DebugException e) {
e.printStackTrace();
return -1;
}
}
示例14: update
import org.eclipse.debug.core.DebugException; //导入方法依赖的package包/类
public void update() throws DebugException {
handleVariables();
step++;
stepPointer = step;
stepLines.put(step, lastLine);
try {
lastLine = frame.getLineNumber();
} catch (DebugException e) {
e.printStackTrace();
}
setChanged();
notifyObservers(new IStackFrameModel.StackEvent<Object>(StackEvent.Type.STEP, step));
}
示例15: traverseSiblings
import org.eclipse.debug.core.DebugException; //导入方法依赖的package包/类
public void traverseSiblings(SiblingVisitor v, boolean visitNulls) {
try {
traverseSiblings(this, null, -1, new HashSet<>(), v, 0, null, visitNulls);
} catch (DebugException e) {
e.printStackTrace();
}
}