userfriendly bp numbers
This commit is contained in:
parent
4f317a3a71
commit
1b4300b357
2 changed files with 3 additions and 8 deletions
10
cpu.cpp
10
cpu.cpp
|
@ -57,15 +57,9 @@ std::optional<std::string> cpu::check_breakpoint()
|
||||||
|
|
||||||
int cpu::set_breakpoint(breakpoint *const bp)
|
int cpu::set_breakpoint(breakpoint *const bp)
|
||||||
{
|
{
|
||||||
int id = 0;
|
breakpoints.insert({ ++bp_nr, bp });
|
||||||
|
|
||||||
do {
|
return bp_nr;
|
||||||
id = rand();
|
|
||||||
} while(breakpoints.find(id) != breakpoints.end());
|
|
||||||
|
|
||||||
breakpoints.insert({ id, bp });
|
|
||||||
|
|
||||||
return id;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cpu::remove_breakpoint(const int bp_id)
|
bool cpu::remove_breakpoint(const int bp_id)
|
||||||
|
|
1
cpu.h
1
cpu.h
|
@ -64,6 +64,7 @@ private:
|
||||||
std::atomic_bool any_queued_interrupts { false };
|
std::atomic_bool any_queued_interrupts { false };
|
||||||
|
|
||||||
std::map<int, breakpoint *> breakpoints;
|
std::map<int, breakpoint *> breakpoints;
|
||||||
|
int bp_nr { 0 };
|
||||||
|
|
||||||
bus *const b { nullptr };
|
bus *const b { nullptr };
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue