diff --git a/src/apps/debugger/controllers/DebugReportGenerator.cpp b/src/apps/debugger/controllers/DebugReportGenerator.cpp index 74c6e4281a..30dd8d84c3 100644 --- a/src/apps/debugger/controllers/DebugReportGenerator.cpp +++ b/src/apps/debugger/controllers/DebugReportGenerator.cpp @@ -21,12 +21,11 @@ #include "UiUtils.h" -DebugReportGenerator::DebugReportGenerator(::Team* team, - Architecture* architecture) +DebugReportGenerator::DebugReportGenerator(::Team* team) : BReferenceable(), fTeam(team), - fArchitecture(architecture) + fArchitecture(team->GetArchitecture()) { fArchitecture->AcquireReference(); } @@ -38,19 +37,21 @@ DebugReportGenerator::~DebugReportGenerator() } -void +status_t DebugReportGenerator::Init() { + // TODO: anything needed here? + return B_OK; } DebugReportGenerator* -DebugReportGenerator::Create(::Team* team, Architecture* architecture) +DebugReportGenerator::Create(::Team* team) { - DebugReportGenerator* self = new DebugReportGenerator(team, architecture); + DebugReportGenerator* self = new DebugReportGenerator(team); try { - self->_Init(); + self->Init(); } catch (...) { delete self; throw; @@ -89,16 +90,15 @@ DebugReportGenerator::GenerateReport(const entry_ref& outputPath) } -void -DebugReportGenerator::_Init() -{ - -} - - status_t DebugReportGenerator::_GenerateReportHeader(BString& _output) { + AutoLocker locker(fTeam); + + BString data; + data.SetToFormat("Debug information for team %s (%" B_PRId32 "):\n\n"); + _output << data; + return B_OK; } diff --git a/src/apps/debugger/controllers/DebugReportGenerator.h b/src/apps/debugger/controllers/DebugReportGenerator.h index 2e311086d4..a05ac5925b 100644 --- a/src/apps/debugger/controllers/DebugReportGenerator.h +++ b/src/apps/debugger/controllers/DebugReportGenerator.h @@ -18,20 +18,16 @@ class Thread; class DebugReportGenerator : public BReferenceable { public: - DebugReportGenerator(::Team* team, - Architecture* architecture); + DebugReportGenerator(::Team* team); ~DebugReportGenerator(); - void Init(); + status_t Init(); - static DebugReportGenerator* Create(::Team* team, - Architecture* architecture); + static DebugReportGenerator* Create(::Team* team); status_t GenerateReport(const entry_ref& outputPath); private: - void _Init(); - status_t _GenerateReportHeader(BString& output); status_t _DumpLoadedImages(BString& output); status_t _DumpRunningThreads(BString& output);