breakpoints; thread/frame selection that should work; TODO: is slow

This commit is contained in:
T0b1
2023-06-08 01:07:57 +02:00
parent 78e7f5cca7
commit b393f3dd28
14 changed files with 1098 additions and 73 deletions

View File

@@ -41,11 +41,41 @@ namespace dbgui::frontend
std::string display_name;
};
// TODO: need a way for the backend to report where the breakpoint was actually placed
// (might have been moved) or if it could be placed at all
// iow let the backend resolve the address + possible file location for the breakpoint
// and then display it
// this should be needed anyways when you want to add expression-based breakpoints, e.g. 'main'
struct Breakpoint
{
struct FileLoc
{
std::string name;
uint32_t line;
};
bool removed = false;
// TODO: srcloc
uint64_t addr;
std::variant<uint64_t, FileLoc> data;
bool at_addr(uint64_t addr) const
{
return this->data.index() == 0
&& std::get<uint64_t>(this->data) == addr;
}
bool at_file_loc(std::string_view file, uint32_t line) const
{
if (this->data.index() != 1)
{
return false;
}
const auto &loc = std::get<FileLoc>(this->data);
if (loc.line == line && loc.name == file)
{
return true;
}
return false;
}
};
Target(std::string filename);
@@ -55,6 +85,9 @@ namespace dbgui::frontend
uint64_t id;
size_t data_node_id = 0;
Arch arch;
bool step_instruction = false;
uint16_t selected_thread = 0;
uint16_t selected_frame = 0;
std::vector<RegSet> reg_sets;
std::vector<std::optional<Thread>> threads;