private static String smgObjectAsDot(SMGObject pObject, CLangSMG pSmg) { String valid = pSmg.isObjectValid(pObject) ? "" : " : invalid "; return pObject.getLabel() + " [ shape=rectangle, label = \"" + pObject.toString() + valid + "\"];"; }
@Nullable private String smgScopeFrameAsDot( Map<String, SMGRegion> pNamespace, String pStructId, String pFunctionName) { StringBuilder sb = new StringBuilder(); sb.append("struct" + pStructId + "[shape=record,label=\" "); // I sooo wish for Python list comprehension here... ArrayList<String> nodes = new ArrayList<>(); for (Entry<String, SMGRegion> entry : pNamespace.entrySet()) { String key = entry.getKey(); SMGObject obj = entry.getValue(); if (key.equals("node")) { // escape Node1 key = "node1"; } nodes.add("<" + key + "> " + obj.toString()); Location location = Location.valueOf(obj, pFunctionName); locationIndex.put(location, "struct" + pStructId + ":" + key); } Set<MemoryLocation> memoryLocations; if (pFunctionName == null) { memoryLocations = explicitState.getGlobalMemoryLocations(); } else { memoryLocations = explicitState.getMemoryLocationsOnStack(pFunctionName); } for (MemoryLocation memloc : memoryLocations) { Location location = Location.valueOf(memloc); // We don't consider values written into explicit cpa under the old // Nomenclature if (!locationIndex.containsKey(location) && !location.location.contains("->")) { // We don't know the size of the memory location nodes.add("<" + memloc.getIdentifier() + "> " + memloc.getIdentifier()); locationIndex.put(location, "struct" + pStructId + ":" + memloc.getIdentifier()); } } sb.append(Joiner.on(" | ").join(nodes)); sb.append("\"];\n"); return sb.toString(); }