funcs["fregs"] = &sim_t::interactive_fregs;
funcs["fregd"] = &sim_t::interactive_fregd;
funcs["mem"] = &sim_t::interactive_mem;
+ funcs["str"] = &sim_t::interactive_str;
funcs["until"] = &sim_t::interactive_until;
funcs["while"] = &sim_t::interactive_until;
funcs["q"] = &sim_t::interactive_quit;
printf("0x%016llx\n",(unsigned long long)get_mem(args));
}
+void sim_t::interactive_str(const std::string& cmd, const std::vector<std::string>& args)
+{
+ if(args.size() != 1)
+ throw trap_illegal_instruction;
+
+ reg_t addr = strtol(args[0].c_str(),NULL,16);
+
+ mmu_t mmu(mem,memsz);
+ char ch;
+
+ while((ch = mmu.load_uint8(addr++)))
+ putchar(ch);
+
+ putchar('\n');
+}
+
void sim_t::interactive_until(const std::string& cmd, const std::vector<std::string>& args)
{
if(args.size() < 3)
void interactive_fregs(const std::string& cmd, const std::vector<std::string>& args);
void interactive_fregd(const std::string& cmd, const std::vector<std::string>& args);
void interactive_mem(const std::string& cmd, const std::vector<std::string>& args);
+ void interactive_str(const std::string& cmd, const std::vector<std::string>& args);
void interactive_until(const std::string& cmd, const std::vector<std::string>& args);
reg_t get_reg(const std::vector<std::string>& args);