Line 8... |
Line 8... |
#include <string.h>
|
#include <string.h>
|
#include "cmdexec.h"
|
#include "cmdexec.h"
|
#include "cmd/cmd_regs.h"
|
#include "cmd/cmd_regs.h"
|
#include "cmd/cmd_reg.h"
|
#include "cmd/cmd_reg.h"
|
#include "cmd/cmd_loadelf.h"
|
#include "cmd/cmd_loadelf.h"
|
|
#include "cmd/cmd_loadsrec.h"
|
#include "cmd/cmd_log.h"
|
#include "cmd/cmd_log.h"
|
#include "cmd/cmd_isrunning.h"
|
#include "cmd/cmd_isrunning.h"
|
#include "cmd/cmd_read.h"
|
#include "cmd/cmd_read.h"
|
#include "cmd/cmd_write.h"
|
#include "cmd/cmd_write.h"
|
#include "cmd/cmd_run.h"
|
#include "cmd/cmd_run.h"
|
Line 25... |
Line 26... |
#include "cmd/cmd_reset.h"
|
#include "cmd/cmd_reset.h"
|
#include "cmd/cmd_disas.h"
|
#include "cmd/cmd_disas.h"
|
#include "cmd/cmd_busutil.h"
|
#include "cmd/cmd_busutil.h"
|
#include "cmd/cmd_symb.h"
|
#include "cmd/cmd_symb.h"
|
#include "cmd/cmd_stack.h"
|
#include "cmd/cmd_stack.h"
|
|
#include "cmd/cmd_loadbin.h"
|
|
|
namespace debugger {
|
namespace debugger {
|
|
|
/** Class registration in the Core */
|
/** Class registration in the Core */
|
REGISTER_CLASS(CmdExecutor)
|
REGISTER_CLASS(CmdExecutor)
|
Line 73... |
Line 75... |
registerCommand(new CmdCsr(itap_, info_));
|
registerCommand(new CmdCsr(itap_, info_));
|
registerCommand(new CmdDisas(itap_, info_));
|
registerCommand(new CmdDisas(itap_, info_));
|
registerCommand(new CmdExit(itap_, info_));
|
registerCommand(new CmdExit(itap_, info_));
|
registerCommand(new CmdHalt(itap_, info_));
|
registerCommand(new CmdHalt(itap_, info_));
|
registerCommand(new CmdIsRunning(itap_, info_));
|
registerCommand(new CmdIsRunning(itap_, info_));
|
|
registerCommand(new CmdLoadBin(itap_, info_));
|
registerCommand(new CmdLoadElf(itap_, info_));
|
registerCommand(new CmdLoadElf(itap_, info_));
|
|
registerCommand(new CmdLoadSrec(itap_, info_));
|
registerCommand(new CmdLog(itap_, info_));
|
registerCommand(new CmdLog(itap_, info_));
|
registerCommand(new CmdMemDump(itap_, info_));
|
registerCommand(new CmdMemDump(itap_, info_));
|
registerCommand(new CmdRead(itap_, info_));
|
registerCommand(new CmdRead(itap_, info_));
|
registerCommand(new CmdRun(itap_, info_));
|
registerCommand(new CmdRun(itap_, info_));
|
registerCommand(new CmdReg(itap_, info_));
|
registerCommand(new CmdReg(itap_, info_));
|
Line 173... |
Line 177... |
const char *helpcmd = (*cmd)[1].to_string();
|
const char *helpcmd = (*cmd)[1].to_string();
|
icmd = getICommand(helpcmd);
|
icmd = getICommand(helpcmd);
|
if (icmd) {
|
if (icmd) {
|
RISCV_printf0("\n%s", icmd->detailedDescr());
|
RISCV_printf0("\n%s", icmd->detailedDescr());
|
} else {
|
} else {
|
RISCV_error("Command '%s' not found", helpcmd);
|
RISCV_error("Command \\'%s\\' not found", helpcmd);
|
}
|
}
|
}
|
}
|
return;
|
return;
|
}
|
}
|
|
|
AttributeType u;
|
AttributeType u;
|
icmd = getICommand(cmd);
|
icmd = getICommand(cmd);
|
if (!icmd) {
|
if (!icmd) {
|
RISCV_error("Command '%s' not found. Use 'help' to list commands",
|
RISCV_error("Command \\'%s\\' not found. "
|
(*cmd)[0u].to_string());
|
"Use \\'help\\' to list commands", (*cmd)[0u].to_string());
|
return;
|
return;
|
}
|
}
|
icmd->exec(cmd, res);
|
icmd->exec(cmd, res);
|
|
|
if (cmdIsError(res)) {
|
if (cmdIsError(res)) {
|
RISCV_error("Command '%s' error: '%s'",
|
RISCV_error("Command \\'%s\\' error: \\'%s\\'",
|
(*res)[1].to_string(), (*res)[2].to_string());
|
(*res)[1].to_string(), (*res)[2].to_string());
|
}
|
}
|
}
|
}
|
|
|
bool CmdExecutor::cmdIsError(AttributeType *res) {
|
bool CmdExecutor::cmdIsError(AttributeType *res) {
|