Add an indent parameter to DumpMemory().

- Adjust callers.
This commit is contained in:
Rene Gollent 2012-12-18 23:30:18 -05:00
parent ec7c59ca09
commit 9a4802db55
3 changed files with 9 additions and 4 deletions

View File

@ -120,7 +120,7 @@ CliDumpMemoryCommand::Execute(int argc, const char* const* argv,
printf("\"\n");
} else {
BString output;
UiUtils::DumpMemory(output, block, address, itemSize, displayWidth,
UiUtils::DumpMemory(output, 0, block, address, itemSize, displayWidth,
num);
printf("%s\n", output.String());
}

View File

@ -230,19 +230,23 @@ UiUtils::PrintValueNodeGraph(BString& _output, ValueNodeChild* child,
}
/*static*/ void UiUtils::DumpMemory(BString& _output, TeamMemoryBlock* block,
target_addr_t address, int32 itemSize, int32 displayWidth, int32 count)
/*static*/ void UiUtils::DumpMemory(BString& _output, int32 indentLevel,
TeamMemoryBlock* block, target_addr_t address, int32 itemSize,
int32 displayWidth, int32 count)
{
BString data;
int32 j;
_output.Append('\t', indentLevel);
for (int32 i = 0; i < count; i++) {
uint8* value;
if ((i % displayWidth) == 0) {
int32 displayed = min_c(displayWidth, (count-i)) * itemSize;
if (i != 0)
if (i != 0) {
_output.Append("\n");
_output.Append('\t', indentLevel);
}
data.SetToFormat("[%#" B_PRIx64 "] ", address + i * itemSize);
_output += data;

View File

@ -42,6 +42,7 @@ public:
int32 indentLevel, int32 maxDepth);
static void DumpMemory(BString& _output,
int32 indentLevel,
TeamMemoryBlock* block,
target_addr_t address, int32 itemSize,
int32 displayWidth, int32 count);