From 0bbe873d9ef75106185e529f07d79695f1273b70 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Fri, 23 Nov 2012 10:56:06 -0500 Subject: [PATCH] Add some basic system information to the report header. --- .../controllers/DebugReportGenerator.cpp | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/apps/debugger/controllers/DebugReportGenerator.cpp b/src/apps/debugger/controllers/DebugReportGenerator.cpp index 254f0b8de2..82f9d52e10 100644 --- a/src/apps/debugger/controllers/DebugReportGenerator.cpp +++ b/src/apps/debugger/controllers/DebugReportGenerator.cpp @@ -6,8 +6,12 @@ #include "DebugReportGenerator.h" +#include +#include + #include #include +#include #include "Architecture.h" #include "CpuState.h" @@ -100,6 +104,29 @@ DebugReportGenerator::_GenerateReportHeader(BString& _output) fTeam->Name(), fTeam->ID()); _output << data; + // TODO: this information should probably be requested via the debugger + // interface, since e.g. in the case of a remote team, the report should + // include data about the target, not the debugging host + system_info info; + if (get_system_info(&info) == B_OK) { + data.SetToFormat("CPU(s): %" B_PRId32 "x %s %s\n", + info.cpu_count, get_cpu_vendor_string(info.cpu_type), + get_cpu_model_string(&info)); + _output << data; + char maxSize[32]; + char usedSize[32]; + + data.SetToFormat("Memory: %s total, %s used\n", + BPrivate::string_for_size((int64)info.max_pages * B_PAGE_SIZE, + maxSize, sizeof(maxSize)), + BPrivate::string_for_size((int64)info.used_pages * B_PAGE_SIZE, + usedSize, sizeof(usedSize))); + _output << data; + } + + data.SetToFormat("Haiku revision: %s\n", __get_haiku_revision()); + _output << data; + return B_OK; }