/** * Writes a trace which has a source location * * @param refId file reference number * @param trace the trace */ private void writeTraceWithLocation(int refId, Trace trace) { LocationProperties loc = findFirstLocation(trace); int line = 0; String className = ""; // $NON-NLS-1$ String functionName = ""; // $NON-NLS-1$ if (loc != null) { line = loc.getLineNumber(); className = loc.getClassName(); functionName = loc.getFunctionName(); } com.nokia.tracecompiler.decodeplugins.dictionary.encoder.Trace.writeInstance( trace.getID(), refId, line, functionName, className); }
/** * Writes the location of a trace * * @param files file references * @param trace trace to be written */ private void writeLocation(ArrayList<DictionaryFileRef> files, Trace trace) { LocationProperties loc = findFirstLocation(trace); if (loc != null) { String path = loc.getFilePath(); String file = loc.getFileName(); if (path != null) { path = FileUtils.convertSeparators(SourceConstants.FORWARD_SLASH_CHAR, path, true); // TODO: Remove drive letter. Actually cannot remove drive // letter because EPOCROOT might not be in the root of the drive } DictionaryFileRef ref = getRef(files, file, path); if (ref == null) { ref = new DictionaryFileRef(file, path, trace); files.add(ref); trace.addExtension(ref); } else { trace.addExtension(ref); } } }