try {
addr = convertStringToNum(in.back());
breakpoints.push_back(addr);
- cout << "Breakpoint 0x" << std::hex << setw(8) << setfill('0') << addr << std::hex << " set" << endl;
+ cout << "Breakpoint 0x" << std::hex << setw(8) << setfill('0') << addr << std::dec << " set" << endl;
}
catch(bad_cast&) {
cerr << "Given parameter is not a valid address" << endl;
}
}
+void listBreaks(const vector<string>&)
+{
+ for(auto iter = breakpoints.begin(); iter != breakpoints.end(); ++iter) {
+ cout << "Breakpoint at 0x" << std::hex << setw(8) << setfill('0') << *iter << std::dec << endl;
+ }
+}
+
void printStatus(const vector<string>&)
{
CDat stackp = global_cpu->getStack();
Completers.push_back(CompleterElement("ddata [s] [e]",&printRAM, "Prints RAM. if s is given, only RAM-Addr. s is printed. if s and e are given the RAM-Addrs from s to e are printed. if omitted the first 16 RAM-Addrs are printed."));
Completers.push_back(CompleterElement("dprog [s] [e]",&printPROG, "Prints program. if s is given, only Prog-Addr. s is printed. if s and e are given the Prog-Addrs from s to e are printed. if omitted the first 16 Prog-Addrs are printed."));
Completers.push_back(CompleterElement("break addr",&setBreak, "Sets a breakpoint for address addr."));
+ Completers.push_back(CompleterElement("listbreaks",&listBreaks, "Lists all breakpoints."));
Completers.push_back(CompleterElement("run",&execRun, "Runs till next breakpoint or end of program."));
Completers.push_back(CompleterElement("setpc [num]",&setPC, "Sets PC to num. if num is omitted 0 is used."));
Completers.push_back(CompleterElement("status",&printStatus, "Prints status of CPU."));