Add memory dumping commands similar to those in KDL.

This commit is contained in:
Rene Gollent
2012-12-18 21:37:55 -05:00
parent c7f5dd6207
commit ec7c59ca09
4 changed files with 169 additions and 0 deletions
@@ -18,6 +18,7 @@
#include "CliContext.h"
#include "CliContinueCommand.h"
#include "CliDebugReportCommand.h"
#include "CliDumpMemoryCommand.h"
#include "CliPrintVariableCommand.h"
#include "CliQuitCommand.h"
#include "CliStackFrameCommand.h"
@@ -310,6 +311,24 @@ CommandLineUserInterface::_RegisterCommands()
BReference<CliCommand> stackTraceCommandReference2(
stackTraceCommandReference.Get());
BReference<CliCommand> dumpCommandReference(
new(std::nothrow) CliDumpMemoryCommand, true);
BReference<CliCommand> dumpCommandReference2(
dumpCommandReference.Get());
if (!_RegisterCommand("db", dumpCommandReference.Detach()))
return B_NO_MEMORY;
dumpCommandReference = dumpCommandReference2.Get();
if (!_RegisterCommand("ds", dumpCommandReference.Detach()))
return B_NO_MEMORY;
dumpCommandReference = dumpCommandReference2.Get();
if (!_RegisterCommand("dw", dumpCommandReference.Detach()))
return B_NO_MEMORY;
dumpCommandReference = dumpCommandReference2.Get();
if (!_RegisterCommand("dl", dumpCommandReference.Detach()))
return B_NO_MEMORY;
if (!_RegisterCommand("string", dumpCommandReference2.Detach()))
return B_NO_MEMORY;
if (_RegisterCommand("bt", stackTraceCommandReference.Detach())
&& _RegisterCommand("continue", new(std::nothrow) CliContinueCommand)
&& _RegisterCommand("frame", new(std::nothrow) CliStackFrameCommand)