Skip to content

Commit

Permalink
Revert "[BUGFIX] Added tracing to listing file"
Browse files Browse the repository at this point in the history
This reverts commit 7052232.
  • Loading branch information
hasherezade committed Oct 19, 2024
1 parent 7052232 commit 9231980
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
10 changes: 0 additions & 10 deletions TraceLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,6 @@ void TraceLog::logLine(const std::string &str)
m_traceFile.flush();
}


void TraceLog::logListingLine(const std::string& str)
{
if (!_createFile(m_ListingFile, m_logFileName + ".listing.txt")) return;

m_ListingFile
<< str
<< std::endl;
m_ListingFile.flush();
}
void TraceLog::logNewSectionCalled(const ADDRINT prevAddr, const std::string &prevSection, const std::string &currSection)
{
createFile();
Expand Down
17 changes: 5 additions & 12 deletions TraceLog.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ class TraceLog
if (fileName.empty()) fileName = "output.txt";
m_logFileName = fileName;
m_shortLog = is_short;
_createFile(m_traceFile, m_logFileName);
_createFile(m_ListingFile, m_logFileName + ".listing.txt");
createFile();
}

void logCall(const ADDRINT prevModuleBase, const ADDRINT prevAddr, bool isRVA, const std::string &module, const std::string &func = "");
Expand All @@ -41,28 +40,22 @@ class TraceLog
void logSyscall(const ADDRINT base, const ADDRINT rva, const ADDRINT param, const std::string &funcName);

void logLine(const std::string &str);
void logListingLine(const std::string& str);

protected:

bool createFile()
{
return _createFile(m_traceFile, m_logFileName);
}

bool _createFile(std::ofstream &file, const std::string &fileName)
{
if (file.is_open()) {
if (m_traceFile.is_open()) {
return true;
}
file.open(fileName.c_str());
if (file.is_open()) {
m_traceFile.open(m_logFileName.c_str());
if (m_traceFile.is_open()) {
return true;
}
return false;
}

std::string m_logFileName;
std::ofstream m_traceFile;
std::ofstream m_ListingFile;
bool m_shortLog;
};

0 comments on commit 9231980

Please sign in to comment.