static L> heapWalker_pathToGCRootWithFieldNames(Instance baseInstance) { bool debug = false; L> path = map(func(Instance i) -> Pair { pair(i, null) }, heapWalker_pathToGCRoot(baseInstance)); bigLoop: for (int i = 1; i < l(path); i++) { long i0 = path.get(i-1).a.getInstanceId(); Instance i1 = path.get(i).a; L fieldValues; if (eq(shortClassName(i1), 'ClassDumpInstance)) fieldValues = (L) call(get(i1, 'classDump), 'getStaticFieldValues); else fieldValues = i1.getFieldValues(); if (debug) { print("Fields: " + map(fieldValues, func(FieldValue fv) -> S { fv.getField().getName() })); print("Types: " + map className(fieldValues)); print("Looking for: " + i0); print("Instances: " + map(filterByType(ObjectFieldValue.class, fieldValues), func(ObjectFieldValue fv) -> Long { fv.getInstanceId() })); } for (FieldValue fv : fieldValues) if (fv instanceof ObjectFieldValue && ((ObjectFieldValue) fv).getInstanceId() == i0) { path.get(i).b = fv.getField().getName(); continue bigLoop; } } ret path; }