parent
81ccf71fa2
commit
631624fb01
|
@ -23,6 +23,7 @@
|
|||
#include "Image.h"
|
||||
#include "MessageCodes.h"
|
||||
#include "Register.h"
|
||||
#include "SemaphoreInfo.h"
|
||||
#include "StackFrame.h"
|
||||
#include "StackTrace.h"
|
||||
#include "StringUtils.h"
|
||||
|
@ -129,6 +130,10 @@ DebugReportGenerator::_GenerateReport(const entry_ref& outputPath)
|
|||
if (result != B_OK)
|
||||
return result;
|
||||
|
||||
result = _DumpSemaphores(output);
|
||||
if (result != B_OK)
|
||||
return result;
|
||||
|
||||
result = _DumpRunningThreads(output);
|
||||
if (result != B_OK)
|
||||
return result;
|
||||
|
@ -298,6 +303,34 @@ DebugReportGenerator::_DumpAreas(BString& _output)
|
|||
}
|
||||
|
||||
|
||||
status_t
|
||||
DebugReportGenerator::_DumpSemaphores(BString& _output)
|
||||
{
|
||||
BObjectList<SemaphoreInfo> semaphores(20, true);
|
||||
status_t result = fDebuggerInterface->GetSemaphoreInfos(semaphores);
|
||||
if (result != B_OK)
|
||||
return result;
|
||||
|
||||
_output << "\nSemaphores:\n";
|
||||
BString data;
|
||||
SemaphoreInfo* info;
|
||||
for (int32 i = 0; (info = semaphores.ItemAt(i)) != NULL; i++) {
|
||||
try {
|
||||
data.SetToFormat("\t%s (%" B_PRId32 ") "
|
||||
"Count: %" B_PRId32 ", Latest Holding Thread: %" B_PRId32 "\n",
|
||||
info->Name().String(), info->SemID(), info->Count(),
|
||||
info->LatestHolder());
|
||||
|
||||
_output << data;
|
||||
} catch (...) {
|
||||
return B_NO_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
DebugReportGenerator::_DumpRunningThreads(BString& _output)
|
||||
{
|
||||
|
|
|
@ -60,6 +60,7 @@ private:
|
|||
status_t _GenerateReportHeader(BString& _output);
|
||||
status_t _DumpLoadedImages(BString& _output);
|
||||
status_t _DumpAreas(BString& _output);
|
||||
status_t _DumpSemaphores(BString& _output);
|
||||
status_t _DumpRunningThreads(BString& _output);
|
||||
status_t _DumpDebuggedThreadInfo(BString& _output,
|
||||
::Thread* thread);
|
||||
|
|
Loading…
Reference in New Issue