MCPcopy Index your code
hub / github.com/processing/processing / getLocals

Method getLocals

java/src/processing/mode/java/Debugger.java:976–998  ·  view source on GitHub ↗

Compile a list of current locals usable for insertion into a JTree. Recursively resolves object references. @param t the suspended thread to get locals for @param depth how deep to resolve nested object references. 0 will not resolve nested objects. @return the list of current locals

(ThreadReference t, int depth)

Source from the content-addressed store, hash-verified

974 * @return the list of current locals
975 */
976 protected List<VariableNode> getLocals(ThreadReference t, int depth) {
977 //System.out.println("getting locals");
978 List<VariableNode> vars = new ArrayList<>();
979 try {
980 if (t.frameCount() > 0) {
981 StackFrame sf = t.frame(0);
982 for (LocalVariable lv : sf.visibleVariables()) {
983 //System.out.println("local var: " + lv.name());
984 Value val = sf.getValue(lv);
985 VariableNode var = new LocalVariableNode(lv.name(), lv.typeName(), val, lv, sf);
986 if (depth > 0) {
987 var.addChildren(getFields(val, depth - 1, true));
988 }
989 vars.add(var);
990 }
991 }
992 } catch (IncompatibleThreadStateException ex) {
993 logitse(ex);
994 } catch (AbsentInformationException ex) {
995 loge("local variable information not available", ex);
996 }
997 return vars;
998 }
999
1000
1001 /**

Callers 1

Calls 6

getFieldsMethod · 0.95
logitseMethod · 0.95
logeMethod · 0.95
getValueMethod · 0.80
addChildrenMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected