diff options
-rw-r--r-- | lib/MiddleWare/MiddleWare.cpp | 19 | ||||
-rw-r--r-- | lib/Plugins/CCpp.cpp | 14 |
2 files changed, 27 insertions, 6 deletions
diff --git a/lib/MiddleWare/MiddleWare.cpp b/lib/MiddleWare/MiddleWare.cpp index d258814..d60e645 100644 --- a/lib/MiddleWare/MiddleWare.cpp +++ b/lib/MiddleWare/MiddleWare.cpp @@ -183,10 +183,13 @@ void CMiddleWare::CreateReportApplication(const std::string& pApplication, return application->CreateReport(pDebugDumpDir); } +#include <iostream> +#include <stdio.h> void CMiddleWare::CreateReport(const std::string& pUUID, const std::string& pUID, crash_report_t& pCrashReport) { + std::cout << "CMiddleWare::CreateReport() s" << std::endl; CDatabase* database = m_pPluginManager->GetDatabase(m_sDatabase); database_row_t row; database->Connect(); @@ -216,14 +219,27 @@ void CMiddleWare::CreateReport(const std::string& pUUID, } dd.SaveText(FILENAME_UUID, UUID); dd.Close(); + fflush(stdout); + fflush(stderr); + std::cerr << "CMiddleWare::CreateReport() e1" << std::endl; + fflush(stdout); + fflush(stderr); DebugDump2Report(row.m_sDebugDumpDir, pCrashReport); + fflush(stdout); + fflush(stderr); + std::cerr << "CMiddleWare::CreateReport() e2" << std::endl; pCrashReport.m_sMWID = appLan + ";" + pUID + ";" + pUUID ; + fflush(stdout); + fflush(stderr); + + std::cerr << "CMiddleWare::CreateReport() e3" << std::endl; } -#include <iostream> + void CMiddleWare::Report(const crash_report_t& pCrashReport) { + std::cout << "CMiddleWare::Report() s" << std::endl; std::string::size_type pos1 = 0; std::string::size_type pos2 = pCrashReport.m_sMWID.find(";", pos1); std::string lanAppPlugin = pCrashReport.m_sMWID.substr(pos1, pos2); @@ -249,6 +265,7 @@ void CMiddleWare::Report(const crash_report_t& pCrashReport) reporter->Report(pCrashReport); } } + std::cout << "CMiddleWare::Report() e" << std::endl; } void CMiddleWare::DeleteDebugDump(const std::string& pUUID, diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp index f1c692e..08228eb 100644 --- a/lib/Plugins/CCpp.cpp +++ b/lib/Plugins/CCpp.cpp @@ -88,7 +88,7 @@ void CLanguageCCpp::GetBacktrace(const std::string& pDebugDumpDir, std::string& dd.Close(); fTmp << "file " << executable << std::endl; fTmp << "core " << pDebugDumpDir << "/" << FILENAME_BINARYDATA1 << std::endl; - fTmp << "bt full" << std::endl; + fTmp << "bt" << std::endl; fTmp << "q" << std::endl; fTmp.close(); } @@ -146,22 +146,26 @@ void CLanguageCCpp::GetIndependentBacktrace(const std::string& pBacktrace, std:: void CLanguageCCpp::RunCommand(const std::string& pCommand, std::string& pOutput) { char line[1024]; - + std::string output; FILE *fp = popen(pCommand.c_str(), "r"); if (fp == NULL) { throw "CLanguageCCpp::GetBacktrace(): cannot execute " + pCommand ; } pOutput = ""; - while (fgets(line, sizeof(line), fp)) + while (fgets(line, 1024, fp) != NULL) { - pOutput += line; + output += line; } + + pOutput = output; + pclose(fp); } std::string CLanguageCCpp::GetLocalUUID(const std::string& pDebugDumpDir) { + std::stringstream ss; char* core; unsigned int size; @@ -174,6 +178,7 @@ std::string CLanguageCCpp::GetLocalUUID(const std::string& pDebugDumpDir) dd.Close(); // TODO: compute local UUID, remove this hack ss << executable << "_" << size; + return ss.str(); } std::string CLanguageCCpp::GetGlobalUUID(const std::string& pDebugDumpDir) @@ -203,7 +208,6 @@ void CLanguageCCpp::CreateReport(const std::string& pDebugDumpDir) InstallDebugInfos(package); GetBacktrace(pDebugDumpDir, backtrace); - dd.SaveText(FILENAME_TEXTDATA1, backtrace); if (m_bMemoryMap) { |