Add simple report header.

Minor cleanups.
This commit is contained in:
Rene Gollent
2012-11-18 13:10:30 -05:00
parent 5e520ef399
commit 8e0e0918b6
2 changed files with 17 additions and 21 deletions
@@ -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<Team> locker(fTeam);
BString data;
data.SetToFormat("Debug information for team %s (%" B_PRId32 "):\n\n");
_output << data;
return B_OK;
}
@@ -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);