Add an indent parameter to DumpMemory().
- Adjust callers.
This commit is contained in:
parent
ec7c59ca09
commit
9a4802db55
@ -120,7 +120,7 @@ CliDumpMemoryCommand::Execute(int argc, const char* const* argv,
|
|||||||
printf("\"\n");
|
printf("\"\n");
|
||||||
} else {
|
} else {
|
||||||
BString output;
|
BString output;
|
||||||
UiUtils::DumpMemory(output, block, address, itemSize, displayWidth,
|
UiUtils::DumpMemory(output, 0, block, address, itemSize, displayWidth,
|
||||||
num);
|
num);
|
||||||
printf("%s\n", output.String());
|
printf("%s\n", output.String());
|
||||||
}
|
}
|
||||||
|
@ -230,19 +230,23 @@ UiUtils::PrintValueNodeGraph(BString& _output, ValueNodeChild* child,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*static*/ void UiUtils::DumpMemory(BString& _output, TeamMemoryBlock* block,
|
/*static*/ void UiUtils::DumpMemory(BString& _output, int32 indentLevel,
|
||||||
target_addr_t address, int32 itemSize, int32 displayWidth, int32 count)
|
TeamMemoryBlock* block, target_addr_t address, int32 itemSize,
|
||||||
|
int32 displayWidth, int32 count)
|
||||||
{
|
{
|
||||||
BString data;
|
BString data;
|
||||||
|
|
||||||
int32 j;
|
int32 j;
|
||||||
|
_output.Append('\t', indentLevel);
|
||||||
for (int32 i = 0; i < count; i++) {
|
for (int32 i = 0; i < count; i++) {
|
||||||
uint8* value;
|
uint8* value;
|
||||||
|
|
||||||
if ((i % displayWidth) == 0) {
|
if ((i % displayWidth) == 0) {
|
||||||
int32 displayed = min_c(displayWidth, (count-i)) * itemSize;
|
int32 displayed = min_c(displayWidth, (count-i)) * itemSize;
|
||||||
if (i != 0)
|
if (i != 0) {
|
||||||
_output.Append("\n");
|
_output.Append("\n");
|
||||||
|
_output.Append('\t', indentLevel);
|
||||||
|
}
|
||||||
|
|
||||||
data.SetToFormat("[%#" B_PRIx64 "] ", address + i * itemSize);
|
data.SetToFormat("[%#" B_PRIx64 "] ", address + i * itemSize);
|
||||||
_output += data;
|
_output += data;
|
||||||
|
@ -42,6 +42,7 @@ public:
|
|||||||
int32 indentLevel, int32 maxDepth);
|
int32 indentLevel, int32 maxDepth);
|
||||||
|
|
||||||
static void DumpMemory(BString& _output,
|
static void DumpMemory(BString& _output,
|
||||||
|
int32 indentLevel,
|
||||||
TeamMemoryBlock* block,
|
TeamMemoryBlock* block,
|
||||||
target_addr_t address, int32 itemSize,
|
target_addr_t address, int32 itemSize,
|
||||||
int32 displayWidth, int32 count);
|
int32 displayWidth, int32 count);
|
||||||
|
Loading…
Reference in New Issue
Block a user