void TraceLoader::loadTrace(const QString &filename) { if (m_helpHash.isEmpty()) { loadHelpFile(); } if (!m_frameBookmarks.isEmpty()) { qDeleteAll(m_signatures); qDeleteAll(m_enumSignatures); m_signatures.clear(); m_enumSignatures.clear(); m_frameBookmarks.clear(); m_createdFrames.clear(); m_parser.close(); } if (!m_parser.open(filename.toLatin1())) { qDebug() << "error: failed to open " << filename; return; } emit startedParsing(); if (m_parser.supportsOffsets()) { scanTrace(); } else { //Load the entire file into memory parseTrace(); } emit guessedApi(static_cast<int>(m_parser.api)); emit finishedParsing(); }
void TraceLoader::loadTrace(const QString &filename) { if (m_helpHash.isEmpty()) { loadHelpFile(); } if (!m_frameBookmarks.isEmpty()) { qDeleteAll(m_signatures); m_signatures.clear(); m_frameBookmarks.clear(); m_createdFrames.clear(); m_parser.close(); } if (!m_parser.open(filename.toLatin1())) { qDebug() << "error: failed to open " << filename; return; } if (!m_parser.supportsOffsets()) { emit parseProblem( "This trace in compressed in a format that does not allow random seeking.\n" "Please repack the trace with `apitrace repack`." ); m_parser.close(); return; } emit startedParsing(); scanTrace(); emit guessedApi(static_cast<int>(m_parser.api)); emit finishedParsing(); }