breakpoints; thread/frame selection that should work; TODO: is slow
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user