#include <vector>
#include <algorithm>
+DECLARE_TRAP(-1, interactive)
+
processor_t *sim_t::get_core(const std::string& i)
{
char *ptr;
unsigned long p = strtoul(i.c_str(), &ptr, 10);
if (*ptr || p >= num_cores())
- throw trap_illegal_instruction();
+ throw trap_interactive();
return get_core(p);
}
reg_t sim_t::get_pc(const std::vector<std::string>& args)
{
if(args.size() != 1)
- throw trap_illegal_instruction();
+ throw trap_interactive();
processor_t *p = get_core(args[0]);
return p->state.pc;
reg_t sim_t::get_reg(const std::vector<std::string>& args)
{
if(args.size() != 2)
- throw trap_illegal_instruction();
+ throw trap_interactive();
processor_t *p = get_core(args[0]);
}
if (r >= NXPR)
- throw trap_illegal_instruction();
+ throw trap_interactive();
return p->state.XPR[r];
}
reg_t sim_t::get_freg(const std::vector<std::string>& args)
{
if(args.size() != 2)
- throw trap_illegal_instruction();
+ throw trap_interactive();
processor_t *p = get_core(args[0]);
int r = std::find(fpr_name, fpr_name + NFPR, args[1]) - fpr_name;
if (r == NFPR)
r = atoi(args[1].c_str());
if (r >= NFPR)
- throw trap_illegal_instruction();
+ throw trap_interactive();
return p->state.FPR[r];
}
reg_t sim_t::get_mem(const std::vector<std::string>& args)
{
if(args.size() != 1 && args.size() != 2)
- throw trap_illegal_instruction();
+ throw trap_interactive();
std::string addr_str = args[0];
mmu_t* mmu = debug_mmu;
void sim_t::interactive_str(const std::string& cmd, const std::vector<std::string>& args)
{
if(args.size() != 1)
- throw trap_illegal_instruction();
+ throw trap_interactive();
reg_t addr = strtol(args[0].c_str(),NULL,16);