Fix various parameter errors and improve output formatting.
This commit is contained in:
@@ -96,7 +96,8 @@ DebugReportGenerator::_GenerateReportHeader(BString& _output)
|
|||||||
AutoLocker<Team> locker(fTeam);
|
AutoLocker<Team> locker(fTeam);
|
||||||
|
|
||||||
BString data;
|
BString data;
|
||||||
data.SetToFormat("Debug information for team %s (%" B_PRId32 "):\n\n");
|
data.SetToFormat("Debug information for team %s (%" B_PRId32 "):\n",
|
||||||
|
fTeam->Name(), fTeam->ID());
|
||||||
_output << data;
|
_output << data;
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -108,6 +109,7 @@ DebugReportGenerator::_DumpLoadedImages(BString& _output)
|
|||||||
{
|
{
|
||||||
AutoLocker<Team> locker(fTeam);
|
AutoLocker<Team> locker(fTeam);
|
||||||
|
|
||||||
|
_output << "\nLoaded Images:\n";
|
||||||
BString data;
|
BString data;
|
||||||
for (ImageList::ConstIterator it = fTeam->Images().GetIterator();
|
for (ImageList::ConstIterator it = fTeam->Images().GetIterator();
|
||||||
Image* image = it.Next();) {
|
Image* image = it.Next();) {
|
||||||
@@ -134,15 +136,17 @@ DebugReportGenerator::_DumpRunningThreads(BString& _output)
|
|||||||
{
|
{
|
||||||
AutoLocker<Team> locker(fTeam);
|
AutoLocker<Team> locker(fTeam);
|
||||||
|
|
||||||
|
_output << "\nActive Threads:\n";
|
||||||
BString data;
|
BString data;
|
||||||
status_t result = B_OK;
|
status_t result = B_OK;
|
||||||
for (ThreadList::ConstIterator it = fTeam->Threads().GetIterator();
|
for (ThreadList::ConstIterator it = fTeam->Threads().GetIterator();
|
||||||
Thread* thread = it.Next();) {
|
Thread* thread = it.Next();) {
|
||||||
try {
|
try {
|
||||||
data.SetToFormat("\t%s %s, id: %" B_PRId32", state: %" B_PRId32
|
data.SetToFormat("\t%s %s, id: %" B_PRId32", state: %s\n",
|
||||||
"\n", thread->Name(), thread->IsMainThread()
|
thread->Name(), thread->IsMainThread()
|
||||||
? "(main)" : "", UiUtils::ThreadStateToString(
|
? "(main)" : "", thread->ID(),
|
||||||
thread->State(), thread->StoppedReason()));
|
UiUtils::ThreadStateToString(thread->State(),
|
||||||
|
thread->StoppedReason()));
|
||||||
|
|
||||||
_output << data;
|
_output << data;
|
||||||
|
|
||||||
@@ -168,10 +172,12 @@ DebugReportGenerator::_DumpDebuggedThreadInfo(BString& _output, Thread* thread)
|
|||||||
if (trace == NULL)
|
if (trace == NULL)
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
|
_output << "\t\tFrame\t\tIP\t\t\tFunction Name\n";
|
||||||
|
_output << "\t\t-----------------------------------------------\n";
|
||||||
BString data;
|
BString data;
|
||||||
for (int32 i = 0; StackFrame* frame = trace->FrameAt(i); i++) {
|
for (int32 i = 0; StackFrame* frame = trace->FrameAt(i); i++) {
|
||||||
char functionName[512];
|
char functionName[512];
|
||||||
data.SetToFormat("0x%" B_PRIx64 "\t0x%" B_PRIx64 "\t%s\n",
|
data.SetToFormat("\t\t0x%08" B_PRIx64 "\t0x%08" B_PRIx64 "\t%s\n",
|
||||||
frame->FrameAddress(), frame->InstructionPointer(),
|
frame->FrameAddress(), frame->InstructionPointer(),
|
||||||
UiUtils::FunctionNameForFrame(frame, functionName,
|
UiUtils::FunctionNameForFrame(frame, functionName,
|
||||||
sizeof(functionName)));
|
sizeof(functionName)));
|
||||||
@@ -179,16 +185,17 @@ DebugReportGenerator::_DumpDebuggedThreadInfo(BString& _output, Thread* thread)
|
|||||||
_output << data;
|
_output << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
_output << "\nRegisters:\n\n";
|
_output << "\n\t\tRegisters:\n";
|
||||||
|
|
||||||
CpuState* state = thread->GetCpuState();
|
CpuState* state = thread->GetCpuState();
|
||||||
BVariant value;
|
BVariant value;
|
||||||
|
const Register* reg = NULL;
|
||||||
for (int32 i = 0; i < fArchitecture->CountRegisters(); i++) {
|
for (int32 i = 0; i < fArchitecture->CountRegisters(); i++) {
|
||||||
const Register* reg = fArchitecture->Registers() + i;
|
reg = fArchitecture->Registers() + i;
|
||||||
state->GetRegisterValue(reg, value);
|
state->GetRegisterValue(reg, value);
|
||||||
|
|
||||||
char buffer[64];
|
char buffer[64];
|
||||||
data.SetToFormat("%s\t%0x%s\n", reg->Name(),
|
data.SetToFormat("\t\t\t%5s:\t%s\n", reg->Name(),
|
||||||
UiUtils::VariantToString(value, buffer, sizeof(buffer)));
|
UiUtils::VariantToString(value, buffer, sizeof(buffer)));
|
||||||
_output << data;
|
_output << data;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user